From 71517ec2465c485c7b4ca2d336d041203ddbb474 Mon Sep 17 00:00:00 2001 From: hanez Date: Mon, 23 Nov 2026 18:16:04 +0100 Subject: [PATCH] Add short aliases for all command-line options --- README.md | 18 +++++++++--------- RELEASES.md | 3 +++ murx.1 | 24 ++++++++++++------------ murx.c | 24 ++++++++++++------------ 4 files changed, 36 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index 7fa9e71..0e388e4 100644 --- a/README.md +++ b/README.md @@ -14,16 +14,16 @@ make ./murx --prefix x work # same as -p x ./murx -s bottom work # show the session status line at the bottom ./murx --status bottom work # same as -s bottom -./murx --cwd work # show the current directory in the status bar -./murx --murx work # show [murx] on the left of the status bar +./murx -d work # --cwd, show the current directory in the status bar +./murx -m work # --murx, show [murx] on the left of the status bar ./murx -c 191a1c work # use a grey status bar background -./murx --history 10000 work # keep up to 10,000 history lines per pane -./murx --clock work # show the status bar clock -./murx --hostname work # show the hostname: prefix in window titles -./murx --titles work # show a title row above each pane -./murx -l, --list-sessions # list running sessions without attaching -./murx --help # logo, version, usage and shortcuts -./murx -v, --version # print the version and exit +./murx -H 10000 work # --history, keep up to 10,000 history lines per pane +./murx -C work # --clock, show the status bar clock +./murx -n work # --hostname, show the hostname: prefix in window titles +./murx -t work # --titles, show a title row above each pane +./murx -l # --list-sessions, list running sessions without attaching +./murx -h # --help, logo, version, usage and shortcuts +./murx -v # --version, print the version and exit ``` Detach with `Ctrl-A d`. Run `murx` again to reattach. diff --git a/RELEASES.md b/RELEASES.md index e925faa..0fda5c4 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1,5 +1,8 @@ # Unreleased +- Added short options for `--history` (`-H`), `--cwd` (`-d`), + `--clock` (`-C`), `--murx` (`-m`), `--hostname` (`-n`), and + `--titles` (`-t`). - Renamed `--pane-titles` to `--titles`. # murx 1.0.3 released diff --git a/murx.1 b/murx.1 index 37eb733..7bf930f 100644 --- a/murx.1 +++ b/murx.1 @@ -6,12 +6,12 @@ murx \- small persistent terminal multiplexer .RB [ \-p " letter"] .RB [ \-s " top|bottom"] .RB [ \-c " RRGGBB"] -.RB [ \-\-history " lines"] -.RB [ \-\-cwd ] -.RB [ \-\-clock ] -.RB [ \-\-murx ] -.RB [ \-\-hostname ] -.RB [ \-\-titles ] +.RB [ \-H " lines"] +.RB [ \-d ] +.RB [ \-C ] +.RB [ \-m ] +.RB [ \-n ] +.RB [ \-t ] .RB [ \-\- ] .RI [ session ] .br @@ -46,7 +46,7 @@ hyphens or underscores. Use before a name beginning with a hyphen. .SH OPTIONS .TP -.BR \-\-history " lines" +.BR \-H ", " \-\-history " lines" Set the maximum number of normal-screen history lines retained per pane in a new session. Accepts 0 to 100,000, with 0 disabling history retention. Reattaching preserves the existing session's limit. @@ -78,21 +78,21 @@ Supply six hexadecimal digits, such as 000000 for black. Omitting this option preserves the session's color when reattaching. New sessions use the terminal's default background unless a color is supplied. .TP -.B \-\-cwd +.BR \-d ", " \-\-cwd Show the current directory at the left of the status line. .TP -.B \-\-clock +.BR \-C ", " \-\-clock Show the status clock. .TP -.B \-\-murx +.BR \-m ", " \-\-murx Show the [murx] label at the left of the status line when .B \-\-cwd is not enabled. The directory takes precedence if both options are supplied. .TP -.B \-\-hostname +.BR \-n ", " \-\-hostname Show the hostname: prefix in window names and the outer terminal title. .TP -.B \-\-titles +.BR \-t ", " \-\-titles Show the title row above each pane. Pane titles are off by default. .TP .BR \-h ", " \-\-help diff --git a/murx.c b/murx.c index ad70350..c85958c 100644 --- a/murx.c +++ b/murx.c @@ -4989,12 +4989,12 @@ static void print_help(FILE *out) { snprintf(history_help, sizeof history_help, "history lines per pane in new sessions (0-%d, default: %d)", MAX_HISTORY_LINES, DEFAULT_HISTORY_LINES); - help_row(out, "--history LINES", history_help); - help_row(out, "--cwd", "show current directory in status bar"); - help_row(out, "--clock", "show clock in status bar"); - help_row(out, "--murx", "show [murx] in status bar unless --cwd is set"); - help_row(out, "--hostname", "show hostname: prefix in window titles"); - help_row(out, "--titles", "show the title row above each pane (default: off)"); + help_row(out, "-H, --history LINES", history_help); + help_row(out, "-d, --cwd", "show current directory in status bar"); + help_row(out, "-C, --clock", "show clock in status bar"); + help_row(out, "-m, --murx", "show [murx] in status bar unless --cwd is set"); + help_row(out, "-n, --hostname", "show hostname: prefix in window titles"); + help_row(out, "-t, --titles", "show the title row above each pane (default: off)"); fputs("\n" "Without -s or -c, an existing session keeps its position and color.\n" @@ -5076,7 +5076,7 @@ int main(int argc, char **argv) { } if (strcmp(option, "-l") == 0 || strcmp(option, "--list-sessions") == 0) { list = 1; - } else if (strcmp(option, "--history") == 0) { + } else if (strcmp(option, "-H") == 0 || strcmp(option, "--history") == 0) { const char *value = argi < argc ? argv[argi] : ""; char *end; long lines = strtol(value, &end, 10); @@ -5087,15 +5087,15 @@ int main(int argc, char **argv) { } history_limit = (int)lines; argi++; - } else if (strcmp(option, "--cwd") == 0) { + } else if (strcmp(option, "-d") == 0 || strcmp(option, "--cwd") == 0) { display.show_cwd = 1; - } else if (strcmp(option, "--clock") == 0) { + } else if (strcmp(option, "-C") == 0 || strcmp(option, "--clock") == 0) { display.show_clock = 1; - } else if (strcmp(option, "--murx") == 0) { + } else if (strcmp(option, "-m") == 0 || strcmp(option, "--murx") == 0) { display.show_murx = 1; - } else if (strcmp(option, "--hostname") == 0) { + } else if (strcmp(option, "-n") == 0 || strcmp(option, "--hostname") == 0) { display.show_hostname = 1; - } else if (strcmp(option, "--titles") == 0) { + } else if (strcmp(option, "-t") == 0 || strcmp(option, "--titles") == 0) { display.show_pane_titles = 1; } else if (strcmp(option, "-p") == 0 || strcmp(option, "--prefix") == 0) { if (argi >= argc || !parse_prefix(argv[argi], &prefix)) {