From b2c85170ad43fd26fa062c1c098e820bc09a6072 Mon Sep 17 00:00:00 2001 From: hanez Date: Sat, 21 Nov 2026 11:49:28 +0100 Subject: [PATCH 1/3] Fixed bug: Home(Pos1) and End keys are working properly now. --- APKBUILD | 4 ++-- PKGBUILD | 4 ++-- README.md | 1 + murx.c | 30 ++++++++++++++++++++++++++---- 4 files changed, 31 insertions(+), 8 deletions(-) diff --git a/APKBUILD b/APKBUILD index 4d3ea24..ef5a230 100644 --- a/APKBUILD +++ b/APKBUILD @@ -26,10 +26,10 @@ package() { } sha512sums=" -95b73a9ce945da4071f60007a5c57f288b68e0677b05f8a4ffc8c0a10940e5ed57e9df1840e6ce2741d471e15375cfb5a4a09edade51c6b4866160a3c507cd73 murx.c +0a297bc9295533c76b9e4b271b0f4472bf6f36caca68a2480bb0a54d435972d5f205ff9cd272c7f9038dfe59e87840f8a342e636d6f31ce8659b13f05da1ef35 murx.c ca73b902d64fc9dc52d8d14b6c8ca6b494f4bea3f3602c29fd2909252668e110edff075c881e014e689d7c7d990dee2a4a96208276bae50243ca382adc5ead80 Makefile db9fe919bac2b4976efa6d760b1f917ec6fee88a4f2811ea4ac69334f6f24d522569c2cd3c3d087eb43cace659bf4c00f3c4097cc901d769b4e4000342d65c45 murx.1 -153e4c4d23e64b74119714790c3701cc3cb2883494237fb44974efb9fc95a9adbc9a3425b1ed93d6e14014d8b3861e08ce2ef658093cd3ea151d9cf9fdada07f README.md +e7393bfcbf2a10d7251c0ae5f9fdc18534b7989bb6688fa71d0cd52eaea9db5744413963acdbefc66951d246b3f2db061168507b8bda2c516f992b9ce5ee0f72 README.md 2fe33ba22c5f68e124904be594208f050be20f33d115f9a56f60cac93304102da32e6a7e78154e831d3704da7ca8bfefd7025e7b8901e65babcd83e7342f6382 LICENSE 4d32dba475e5f9818fcd008068b011cbae9fc4b8e29897c933775d6660f44a7992d08a1550320d83233af729a42b241ef1d182bf5983ef2f64deab76cab2260d AUTHORS " diff --git a/PKGBUILD b/PKGBUILD index 8dbf3f5..1b420ae 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -8,10 +8,10 @@ url='https://codeberg.org/armin/murx' license=('Apache-2.0') depends=('glibc') source=('murx.c' 'Makefile' 'murx.1' 'README.md' 'LICENSE' 'AUTHORS') -sha256sums=('ef7a6d215ec78876a7eb850eae5bb554011c4e12b4f0607f57d9195d9e2ba821' +sha256sums=('50f141c6b6c42bdc13cf7018c2723b58e69fe0027e4f8befcd82dab598478852' 'c683ed74c664ebb2a72603297367ed102afdf27e4d6cee47920db8632a8efa91' 'd2219b9be02a6d588c593eb001c2c7f1ada845c4c72fa5837937d08192572678' - '7b47bf380ba9c9c5defede500514fba6527c8202e64d8f9f622c09de7c5610e8' + '624618abc7dbe0154bc304cf97ff414932215455a5d23ee731806b222c74681c' '31c5556be4cdd9bf52bb55f18ead0c68a4f0e793c2c2dab0a2a2c6d92407d0d4' 'dbc8a4fc569d4cd7bcd45516ccc98c1396fce0682c262103069c8f5150538cdb') diff --git a/README.md b/README.md index a545100..01081d6 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,7 @@ and `murx-root`. - Application cursor-key mode follows the active pane, so arrow navigation works in programs such as Midnight Commander. Menus and prompts use normal cursor-key mode; detaching restores normal cursor keys in the outer terminal. +- Home (Pos1) and End use the pane’s `screen-256color` key sequences. - Multiple clients can attach to the same session. The most recently attached or resized client sets the session size; a larger client shows the session centred in its terminal, while a smaller client shows the top-left part. diff --git a/murx.c b/murx.c index 3523ed8..72d7fe6 100644 --- a/murx.c +++ b/murx.c @@ -3313,10 +3313,12 @@ static void menu_key(Client *c, Session *s, const unsigned char *buf, size_t n, static void client_feed(Client *c, Session *s, const unsigned char *buf, size_t n) { if (n > sizeof c->in - c->inlen) n = sizeof c->in - c->inlen; - if (n == 0 && c->inlen == 1 && c->in[0] == 27 && c->escape_since && + if (n == 0 && c->escape_since && now_ms() - c->escape_since >= 100) { Scrollback *view = scrollback_current(c, s); if (view) scrollback_remove(scrollback_slot(c, view->pane)); + if (!view && !c->prefix_pending && s->cur && s->cur->active) + pane_write(s->cur->active, c->in, c->inlen); c->prefix_pending = 0; c->inlen = 0; c->escape_since = 0; @@ -3384,8 +3386,21 @@ static void client_feed(Client *c, Session *s, const unsigned char *buf, size_t i++; continue; } - size_t j = i; - while (j < c->inlen && c->in[j] != c->prefix) j++; + /* screen-256color describes Home and End as CSI 1~ and CSI 4~. */ + if (p[0] == 27) { + if (left == 1) break; + if (p[1] == '[' || p[1] == 'O') { + if (left == 2) break; + if (p[2] == 'H' || p[2] == 'F') { + if (s->cur && s->cur->active) + pane_write(s->cur->active, p[2] == 'H' ? "\x1b[1~" : "\x1b[4~", 4); + i += 3; + continue; + } + } + } + size_t j = i + 1; + while (j < c->inlen && c->in[j] != c->prefix && c->in[j] != 27) j++; if (s->cur && s->cur->active) pane_write(s->cur->active, c->in + i, j - i); i = j; } @@ -3393,7 +3408,9 @@ static void client_feed(Client *c, Session *s, const unsigned char *buf, size_t memmove(c->in, c->in + i, c->inlen - i); c->inlen -= i; } - if (c->inlen == 1 && c->in[0] == 27 && (scrollback_current(c, s) || c->prefix_pending)) { + if (c->inlen && c->in[0] == 27 && + ((!c->mode && !c->locked && !scrollback_current(c, s) && !c->prefix_pending) || + (c->inlen == 1 && (scrollback_current(c, s) || c->prefix_pending)))) { if (!c->escape_since) c->escape_since = now_ms(); } else c->escape_since = 0; } @@ -3663,6 +3680,11 @@ static void run_server(Session *s) { } int timeout = 200; + for (Client *c = s->clients; c; c = c->next) { + if (!c->escape_since) continue; + long long remaining = 100 - (now_ms() - c->escape_since); + if (remaining < timeout) timeout = remaining > 0 ? (int)remaining : 0; + } int pr = poll(pfds, (nfds_t)idx, timeout); if (pr < 0) { int interrupted = errno == EINTR; From c2e697b9f773ca5690e57aa31190aed3f52109f5 Mon Sep 17 00:00:00 2001 From: hanez Date: Sat, 21 Nov 2026 12:16:50 +0100 Subject: [PATCH 2/3] Added -v and --version to show the program version. 1.0 today! :) --- APKBUILD | 12 ++++++------ Makefile | 10 ++++++++++ PKGBUILD | 12 ++++++------ README.md | 13 +++++++------ murx.1 | 8 +++++++- murx.c | 10 +++++++++- 6 files changed, 45 insertions(+), 20 deletions(-) diff --git a/APKBUILD b/APKBUILD index ef5a230..c7223c4 100644 --- a/APKBUILD +++ b/APKBUILD @@ -1,6 +1,6 @@ -# Local source snapshot; refresh checksums with `abuild checksum` after edits. +# Local source snapshot; refresh version and checksums with `make pkgsums`. pkgname=murx -pkgver=0.20261116 +pkgver=1.0 pkgrel=0 pkgdesc="Small persistent terminal multiplexer" url="https://codeberg.org/armin/murx" @@ -26,10 +26,10 @@ package() { } sha512sums=" -0a297bc9295533c76b9e4b271b0f4472bf6f36caca68a2480bb0a54d435972d5f205ff9cd272c7f9038dfe59e87840f8a342e636d6f31ce8659b13f05da1ef35 murx.c -ca73b902d64fc9dc52d8d14b6c8ca6b494f4bea3f3602c29fd2909252668e110edff075c881e014e689d7c7d990dee2a4a96208276bae50243ca382adc5ead80 Makefile -db9fe919bac2b4976efa6d760b1f917ec6fee88a4f2811ea4ac69334f6f24d522569c2cd3c3d087eb43cace659bf4c00f3c4097cc901d769b4e4000342d65c45 murx.1 -e7393bfcbf2a10d7251c0ae5f9fdc18534b7989bb6688fa71d0cd52eaea9db5744413963acdbefc66951d246b3f2db061168507b8bda2c516f992b9ce5ee0f72 README.md +0a40b60d95effbf69c8a0904c2031260d8398d9a0fc8f91fc45e260d655d240f6ef0cadaf0d1324b420da7031e43ed13325559d0b9026a4fba9a4eef481ecbbe murx.c +ebce5c1268253d4dbf1cc1c7d6200c3bad97cba6361d8ff3c5d4563b670565a1a70d83d7bcb2dc0b1ca9fad9ca49d2ff8366b21ac73fb26cb7b46730d0acc425 Makefile +c79bb8fc5c00b9ed784a3221e33a9a341ad4ce5b9880585409cce8e068a1e8be1ecb77115784cca0247250870069e3d63b23833857e5e9c5ab3e8da4c036eb4f murx.1 +c8a4f7661af194b2b5d04edb90b6d4d87838711d59d12039bc8adaf84c724d311301aad0e2e1ced69719b491b910c0bbb01e610b508348cd6c860bd2c3a0723c README.md 2fe33ba22c5f68e124904be594208f050be20f33d115f9a56f60cac93304102da32e6a7e78154e831d3704da7ca8bfefd7025e7b8901e65babcd83e7342f6382 LICENSE 4d32dba475e5f9818fcd008068b011cbae9fc4b8e29897c933775d6660f44a7992d08a1550320d83233af729a42b241ef1d182bf5983ef2f64deab76cab2260d AUTHORS " diff --git a/Makefile b/Makefile index 3f28aa6..44ec907 100644 --- a/Makefile +++ b/Makefile @@ -40,6 +40,16 @@ pkgarch: pkgclean makepkg pkgsums: + @version=$$(sed -n 's/^#define MURX_VERSION "\([^"]*\)"$$/\1/p' murx.c); \ + if [ -z "$$version" ]; then \ + echo "Could not read MURX_VERSION from murx.c" >&2; exit 1; \ + fi; \ + tmp=$$(mktemp .pkgsums.XXXXXX) || exit 1; \ + trap 'rm -f "$$tmp"' 0; \ + for recipe in APKBUILD PKGBUILD; do \ + sed "s/^pkgver=.*/pkgver=$$version/" "$$recipe" > "$$tmp" && \ + cat "$$tmp" > "$$recipe" || exit 1; \ + done abuild checksum updpkgsums diff --git a/PKGBUILD b/PKGBUILD index 1b420ae..1c0115e 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,6 +1,6 @@ -# Local source snapshot; refresh checksums with `updpkgsums` after edits. +# Local source snapshot; refresh version and checksums with `make pkgsums`. pkgname=murx -pkgver=0.20261116 +pkgver=1.0 pkgrel=1 pkgdesc='Small persistent terminal multiplexer' arch=('x86_64' 'aarch64') @@ -8,10 +8,10 @@ url='https://codeberg.org/armin/murx' license=('Apache-2.0') depends=('glibc') source=('murx.c' 'Makefile' 'murx.1' 'README.md' 'LICENSE' 'AUTHORS') -sha256sums=('50f141c6b6c42bdc13cf7018c2723b58e69fe0027e4f8befcd82dab598478852' - 'c683ed74c664ebb2a72603297367ed102afdf27e4d6cee47920db8632a8efa91' - 'd2219b9be02a6d588c593eb001c2c7f1ada845c4c72fa5837937d08192572678' - '624618abc7dbe0154bc304cf97ff414932215455a5d23ee731806b222c74681c' +sha256sums=('dc7eea9afcc33209d52a0a0a9f654444ece16a122127ffae8ac7f19942521908' + '4301fe8afe6a6e7cc665d8820ec43047f6af6f3b394a3a3a4f6e52dcf32fdec2' + '9788331168223850709fc3c6cda9c9ab4563ff0ee4e58b992d7c2d24e02bb695' + '4f6f36d91e4363f37d9b72b506198658619550a93ec07f122a26d009846e3a7f' '31c5556be4cdd9bf52bb55f18ead0c68a4f0e793c2c2dab0a2a2c6d92407d0d4' 'dbc8a4fc569d4cd7bcd45516ccc98c1396fce0682c262103069c8f5150538cdb') diff --git a/README.md b/README.md index 01081d6..a627413 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,8 @@ make ./murx --clock work # show the status bar clock ./murx --hostname work # show the hostname: prefix in window titles ./murx -l, --list-sessions # list running sessions without attaching -./murx --help # all shortcuts +./murx --help # version, usage and all shortcuts +./murx --version # print the version and exit (also -v) ``` Detach with `Ctrl-A d`. Run `murx` again to reattach. @@ -392,8 +393,8 @@ that otherwise collapses pane grids to 1x1. The root directory includes [APKBUILD](APKBUILD) for Alpine Linux and [PKGBUILD](PKGBUILD) for Arch Linux. Both build the local source files rather -than downloading a release. Version `0.20261116` identifies an unreleased -snapshot; update the version and release fields when packaging a newer snapshot. +than downloading a release. The package version comes from `MURX_VERSION` in +`murx.c`. Adjust the package release fields separately as needed. Both recipes build with the default C compiler, so plain `make` works there too. The packages install under `/usr`, including the manual, README and license. @@ -418,9 +419,9 @@ makepkg -si This builds the package and installs it through pacman. The recipe lists `x86_64` and `aarch64`; builds run on the current architecture. -After changing any packaged source file (`murx.c`, `Makefile`, `murx.1`, -`README.md`, `LICENSE` or `AUTHORS`), refresh recipe checksums with `abuild checksum` -on Alpine and `updpkgsums` (from `pacman-contrib`) on Arch. Neither recipe +After changing a packaged source file, run `make pkgsums` to sync both package +versions and refresh both sets of checksums. This target requires `abuild` +and `updpkgsums` (from `pacman-contrib`). Neither recipe requires a test suite; its check step runs `murx --help` as a smoke check. ## Authors diff --git a/murx.1 b/murx.1 index 7972858..033a25d 100644 --- a/murx.1 +++ b/murx.1 @@ -17,6 +17,9 @@ murx \- small persistent terminal multiplexer .BR \-h " | " \-\-help .br .B murx +.BR \-v " | " \-\-version +.br +.B murx .BR \-l " | " \-\-list\-sessions .SH DESCRIPTION .B murx @@ -79,7 +82,10 @@ is not enabled. The directory takes precedence if both options are supplied. Show the hostname: prefix in window names and the outer terminal title. .TP .BR \-h ", " \-\-help -Print usage and keyboard shortcuts, then exit. +Print the program version, usage and keyboard shortcuts, then exit. +.TP +.BR \-v ", " \-\-version +Print the program version and exit. .PP These four display features are disabled by default. Their options apply only when creating a session; they do not change a running server. diff --git a/murx.c b/murx.c index 72d7fe6..2f66345 100644 --- a/murx.c +++ b/murx.c @@ -33,7 +33,8 @@ * One binary, no config file. Shortcuts and the interface palette have built-in defaults. * * murx [session] attach to session (default "0"), or start it - * murx -h|--help show usage and all Ctrl-A shortcut chains + * murx -h|--help show version, usage and all Ctrl-A shortcut chains + * murx -v|--version show version * * Pure C99 + POSIX (macOS / Linux / FreeBSD / OpenBSD). */ @@ -85,6 +86,7 @@ #define MURX_NOIPA #endif +#define MURX_VERSION "1.0" #define DEFAULT_PREFIX 0x01 /* client -> server */ @@ -4353,9 +4355,11 @@ static int run_client(int fd, const char *name, unsigned char prefix, int status static void print_help(FILE *out) { fprintf(out, + "murx " MURX_VERSION "\n\n" "usage: murx [-p letter] [-s top|bottom] [-c RRGGBB] [--cwd] [--clock] [--murx] [--hostname] [session]\n" " murx -l | --list-sessions\n" " murx -h | --help\n" + " murx -v | --version\n" "\n" "Attach to a running session, or start it if it is not running.\n" "The session name defaults to \"0\".\n" @@ -4458,6 +4462,10 @@ int main(int argc, char **argv) { print_help(stdout); return 0; } + if (strcmp(option, "-v") == 0 || strcmp(option, "--version") == 0) { + puts("murx " MURX_VERSION); + return 0; + } if (strcmp(option, "-l") == 0 || strcmp(option, "--list-sessions") == 0) { list = 1; } else if (strcmp(option, "--cwd") == 0) { From da175fa5a7044998b821e974e2b19b4b969e9053 Mon Sep 17 00:00:00 2001 From: hanez Date: Sat, 21 Nov 2026 14:05:17 +0100 Subject: [PATCH 3/3] Added RELEASES.md as kind of changelog. --- RELEASES.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 RELEASES.md diff --git a/RELEASES.md b/RELEASES.md new file mode 100644 index 0000000..16724e9 --- /dev/null +++ b/RELEASES.md @@ -0,0 +1,34 @@ +# murx 1.0 released + +**November 21, 2026** — murx has reached 1.0. It is a deliberately small terminal multiplexer: one C99 source file, no config file, no dependencies, and no scripting layer. Build it with `make`, run `./murx`, and detach with `Ctrl-A d`. + +## What you get + +- Persistent named sessions, each with its own small server and Unix socket. Programs keep running when you detach. +- Windows, split panes, resizing, renaming, scrollback and a configurable status line. +- Multiple clients attached to one session, each with its own prefix, scrollback position and lock state. +- Real ptys with a built-in terminal emulator: colors, 256-color and truecolor, UTF-8, wide characters, alternate screen and 2,000 lines of history per pane. +- Optional per-client prefix (`-p x`), status line position (`-s top|bottom`), status bar background (`-c RRGGBB`), clock, hostname and current-directory display. +- Optional SSH shell hooks for remote window names, directory reporting and root-shell highlighting. +- Linux, macOS, FreeBSD and OpenBSD support, plus an `APKBUILD` and `PKGBUILD` for packaging. + +## Highlights since the early releases + +The project was renamed from moerx to murx, gained a manual page and `Apache-2.0` license, and now ships a manpage, package recipes and install/uninstall targets. Session listing via `murx -l`, status bar colors, scrollback-mode window switching, fixed Home/End handling and `murx -v` / `murx --version` are all part of this release. + +Navigation was also tightened: `Ctrl-A h/j/k/l` and the arrow keys now pick the pane truly in the requested direction, preferring overlapping panes, and terminal resizing is reconciled every 250 ms in addition to `SIGWINCH`. + +## Upgrading + +If you are coming from moerx, update aliases and scripts to use `murx`, finish old sessions before removing the old executable, and replace the remote shell hooks with the `murx-cwd` and `murx-root` variants. Display options are now opt-in: use `murx --cwd --clock --hostname SESSION` for the older busy status bar. Restart long-running session servers once after upgrading. + +## Build and install + +```sh +make +sudo make install +``` + +Set `PREFIX`, `BINDIR`, `MANDIR` or `DESTDIR` as needed. Read `murx.1` for full option and shortcut documentation, or run `murx --help`. + +Thanks to Armin Jenewein (founder) and Johannes Findeisen (contributor). Licensed under Apache-2.0.