Terminal Hotkeys
Terminal Hotkeys
A list of all the terminal hotkeys and their uses
Command Prompt
Autocomplete
Pressing tab
provides autocompletion suggestions. Suggestions can come in one of two formats:
- a gridded view where the hint text (the, typically blue, text under the prompt) provides the description
- a list view where the description is printed alongside the completion suggestion.
While the autocompletion suggestions are open, the following keys are assigned roles:
arrow keys (
left
,right
,up
,down
): highlight different suggestionstab
: highlight the next suggestionshift
+tab
: highlight the previous suggestionenter
/return
: this selects the highlighted autocompletionesc
: closes the suggestions without selecting onectrl
+f
: fuzzy find in the suggestionsf1
: enable / disable preview box. This will hide your terminal output while enabled. The preview box supports additional key bindings (see below)
Fuzzy Find Autocomplete
Pressing ctrl
+f
either from the prompt, or while the autocomplete suggestions are open, will open up the fuzzy find dialog to search through available suggestions. This can also be used to quickly jump to specific sub-directories.
Your typed search terms will appear in the hint text.
By default the fuzzy finder will look for any item that includes all of the search words. However the search behavior can be changed if the first search term is any of the following:
or
: show results that match any of the search terms. egor .md .txt
will match both markdown and txt files (when finding files in completion suggestions).!
: only show suggestions that do not match any of the search terms. eg! .md .txt
will match all files except markdown and txt files (when finding files in completion suggestions).g
: show only results that match a shell glob. eg*.txt
. This mode is automatically assumed if you include an abstricts in your search term.rx
: use a regexp pattern matcher instead of any fuzzy search. Expressions will be case insensitive and non-greedy by default.
Aside from globbing matches, searching in fuzzy finder is not case sensitive.
While the fuzzy finder is open, the following keys are assigned roles:
arrow keys (
left
,right
,up
,down
): highlight different suggestionstab
: highlight the next suggestionshift
+tab
: highlight the previous suggestionenter
/return
: this selects the highlighted autocompletionesc
: cancel searchf1
: enable / disable preview box. This will hide your terminal output while enabled. The preview box supports additional key bindings (see below)
Preview Box
The preview box is a way of quickly examining the contents of a function, man page, text file or even image, based on what autocomplete suggestion is highlighted.
While the preview box is open, the rest of your terminal output will be hidden. However once you close it, that output will reappear.
While the preview box is open, the following keys are assigned roles:
f1
: closes the preview boxpage up
scroll up the contents of the preview box, one page at a timectrl
+arrow up
scroll up the contents of the preview box, one page at a time (IBM keyboard layouts)option
+arrow up
scroll up the contents of the preview box, one page at a time (Apple keyboard layouts)page down
scroll down the contents of the preview box, one page at a timectrl
+arrow down
scroll down the contents of the preview box, one page at a time (IBM keyboard layouts)option
+arrow down
scroll down the contents of the preview box, one page at a time (Apple keyboard layouts)
Search Shell History
This displays up your timestamped shell history as an autocomplete list with fuzzy find activated. Using ctrl
+r
you can rapidly rerun previous command lines.
From here, the usual autocomplete / fuzzy find hotkeys apply. Such as pressing esc
to cancel history completion.
If the prompt line is not empty, then the current line is included in the history search.
Line Editing
These are the various hotkeys and editing modes available in Murex's interactive command prompt.
Navigation
Arrow keys,
left
andright
: move the cursor forwards or backwards in lineArrow keys,
up
anddown
: If the command line spans multiple lines on the screen then this will jump up or down to the next/previous line. When at the top or bottom line, theup
ordown
keys will search through your history of past command linesalt
+b
: jump backwards a word at a time (Emacs compatibility)ctrl
+left
: jump backwards a word at a time (IBM keyboard layouts)option
+left
: jump backwards a word at a time (Apple keyboard layouts)alt
+f
: jump forwards a word at a time (Emacs compatibility)ctrl
+right
: jump forwards a word at a time (IBM keyboard layouts)option
+right
: jump forwards a word at a time (Apple keyboard layouts)ctrl
+a
: jump to beginning of linehome
: jump to beginning of linectrl
+e
: jump to end of lineend
: jump to end of line
General Hotkeys
ctrl
+k
: clears line after cursorctrl
+u
: clears the whole line
Vim Keys
Pressing esc
while no autocomplete suggestions are shown will switch the line editor into vim keys mode.
Press i
to return to normal editing mode.
Supported Keys
a
: insert after current characterA
: insert at end of lineb
: jump to beginning of wordB
: jump to previous whitespaced
: delete modeD
: delete characterse
: jump to end of wordE
: jump to next whitespaceh
: previous character (likeleft
)i
: insert modeI
: insert at beginning of linel
: next character (likeright
)p
: paste afterP
: paste beforer
: replace character (replace once)R
: replace many charactersu
: undov
: visual editor (opens line in$EDITOR
)w
: jump to end of wordW
: jump to next whitespacex
: delete charactery
: yank (copy line)Y
: same asy
[
: jump to previous brace]
: jump to next brace$
: jump to end of line%
: jump to either end of matching bracket0
to9
: repeat action n times. eg5x
would delete (x
) five (5
) characters
$EDITOR
Full Screen Editing via When in "vim keys" mode, press v
to bring up the visual editor. The editor will be whichever command is stored in the $EDITOR
environmental variable.
Recalling Previous Words
shift
+f1
recalls the first wordshift
+f2
recalls the second word- ...
shift
+f12
recalls the twelfth word
In the following example, code inside square brackets represent key presses rather than text:
» echo two three four five six seven eight nine
two three four five six seven eight nine
» [shift+f1]echo [shift+f5]five
Job Control
While processes are running, the following keys are assigned roles:
ctrl
+c
: kill foreground process. Pressing this will send a kill (SIGINT) request to the foreground processctrl
+\
: kill all running processes in current shell session, including any background processes too. This hotkey is a effectively an emergency kill switch to bring you back to the command prompt shouldctrl
+c
prove ineffective. Use this sparingly because it doesn't allow processes to end gracefullyctrl
+z
: suspend foreground process. This will take you back to the prompt and from there you can then use job control to resume execution in either the foreground or background. (read more)
Miscellaneous
Cancel Prompt
Pressing ctrl
+c
while on the prompt will clear the prompt. This is similar to ctrl
+u
.
End Of File
Pressing ctrl
+d
on an empty prompt will send EOF (end of file). This will exit that running shell session.
Alternative Cancel Key
ctrl
+g
performs the same action as esc
at all states of the interactive shell.
Clear Screen
Pressing ctrl
+l
will clear the screen.
See Also
- Murex's Interactive Shell: What's different about Murex's interactive shell?
- Rosetta Stone: A tabulated list of Bashism's and their equivalent Murex syntax
- Spellcheck: How to enable inline spellchecking