aleclearmind / nested-tmux

A simple tmux configuration for nested tmux sessions
MIT License
111 stars 10 forks source link

fix(bindings): Avoid clobbering readline #10

Open rpatterson opened 1 year ago

rpatterson commented 1 year ago

Readline provides a pretty powerful set of command-line searching and editing features that can greatly increase CLI efficiency. The readline library is also supported by many interactive prompts, including language interactive REPLs. Finally, many other tools emulate readline bindings for similar tasks. Given how frequently it can be used and that it's used in the inner loop of command-line usage, its usage should be very fast and as such every effort should be made to avoid adding any delay to it's bindings, such as repeating the tmux prefix. Ctrl-a is a particularly common and useful readline binding, for example:

  1. Ctrl-r ... to find a long command in shell history
  2. Ctrl-a to jump to the beginning of the command
  3. M-f to jump one word forward past the root command
  4. Add a CLI option to the command
  5. RET to run the command

Throughout my years with screen, tmux, various editors and rich readline usage, I've tried a number of prefixes and I agree with many others that Ctrl-z is the best prefix. Suspending a process is an uncommon task relative to readline usage and the double-prefix is fine for that task in my experience.