fix(bindings): Avoid clobbering readline#10
Open
rpatterson wants to merge 4 commits into
Open
Conversation
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.
The `C-t` binding in readline is to transpose 2 characters and is possibly the least useful readline CLI editing feature. Thus it is often used as a tmux/screen prefix. In particular it's useful as a prefix for nested remote sessions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-ais a particularly common and usefulreadline binding, for example:
Ctrl-r ...to find a long command in shell historyCtrl-ato jump to the beginning of the commandM-fto jump one word forward past the root commandRETto run the commandThroughout 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-zis the bestprefix. Suspending a process is an uncommon task relative to readline usage and the
double-prefix is fine for that task in my experience.