Key Mapping
To customize key mappings, you need to configure input_mapping
yaml entry
Each element in the input_mapping
represents one key binding, whereas mods
represents an array of keyboard modifiers that must be pressed - as well as the key
or mouse
- in order to activate the corresponding action.
Additionally one can filter input mappings based on special terminal modes using the modes
option:
- Alt : The terminal is currently in alternate screen buffer, otherwise it is in primary screen buffer.
- AppCursor : The application key cursor mode is enabled (otherwise it's normal cursor mode).
- AppKeypad : The application keypad mode is enabled (otherwise it's the numeric keypad mode).
- Select : The terminal has currently an active grid cell selection (such as selected text).
- Insert : The Insert input mode is active, that is the default and one way to test that the input mode is not in normal mode or any of the visual select modes.
- Search : There is a search term currently being edited or already present.
- Trace : The terminal is currently in trace-mode, i.e., each VT sequence can be interactively single-step executed using custom actions. See TraceEnter/TraceStep/TraceLeave actions.
You can combine these modes by concatenating them via |
and negate a single one by prefixing with ~
. The modes
option defaults to not filter at all (the input mappings always match based on modifier and key press/mouse event).
key
represents keys on your keyboard, and mouse
represents buttons as well as the scroll wheel.
Modifiers:
- Alt
- Control
- Shift
- Meta (this is the Windows key on Windows OS, ans the Command key on macOS, and Meta on anything else)
Keys can be expressed case-insensitively symbolic.
Keys can be expressed case-insensitively symbolic:
APOSTROPHE, ADD, BACKSLASH, COMMA, DECIMAL, DIVIDE, EQUAL, LEFT_BRACKET,
MINUS, MULTIPLY, PERIOD, RIGHT_BRACKET, SEMICOLON, SLASH, SUBTRACT, SPACE
Enter, Backspace, Tab, Escape, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12,
DownArrow, LeftArrow, RightArrow, UpArrow, Insert, Delete, Home, End, PageUp, PageDown,
Numpad_Divide, Numpad_Multiply, Numpad_Subtract, Numpad_Add, Numpad_Decimal, Numpad_Enter, Numpad_Equal,
Numpad_0, Numpad_1, Numpad_2, Numpad_3, Numpad_4,
Numpad_5, Numpad_6, Numpad_7, Numpad_8, Numpad_9
or in case of standard characters, just the character.
Mouse buttons can be one of the following self-explanatory ones:
Left, Middle, Right, WheelUp, WheelDown
List of supported actions for key mappings.
Action | Description |
---|---|
CancelSelection |
Cancels currently active selection, if any. |
ChangeProfile |
Changes the profile to the given profile name . |
ClearHistoryAndReset |
Clears the history, performs a terminal hard reset and attempts to force a redraw of the currently running application. |
CopyPreviousMarkRange |
Copies the most recent range that is delimited by vertical line marks into clipboard. |
CopySelection |
Copies the current selection into the clipboard buffer. |
CreateDebugDump |
Create dump for debug purposes |
CreateSelection, delimiters: '' |
Creates selection with custom delimiters configured via delimiters member. |
DecreaseFontSize |
Decreases the font size by 1 pixel. |
DecreaseOpacity |
Decreases the default-background opacity by 5%. |
FocusNextSearchMatch |
Focuses the next search match (if any). |
FocusPreviousSearchMatch |
Focuses the next previous match (if any). |
FollowHyperlink |
Follows the hyperlink that is exposed via OSC 8 under the current cursor position. |
IncreaseFontSize |
Increases the font size by 1 pixel. |
IncreaseOpacity |
Increases the default-background opacity by 5%. |
NewTerminal |
Spawns a new terminal at the current terminals current working directory. |
NoSearchHighlight |
Disables current search highlighting, if anything is still highlighted due to a prior search. |
OpenConfiguration |
Opens the configuration file. |
OpenFileManager |
Opens the current working directory in a system file manager. |
OpenSelection |
Open the current terminal selection with the default system application (eg; xdg-open) |
PasteClipboard |
Pastes clipboard to standard input. Pass boolean parameter 'strip' to indicate whether or not to strip repetitive whitespaces down to one and newlines to whitespaces. |
PasteSelection |
Pastes current selection to standard input.Option evaluate_in_shell specify if pasted text must be appended with linefeed and used as an input for the running shell |
Quit |
Quits the application. |
ReloadConfig |
Forces a configuration reload. |
ResetConfig |
Overwrites current configuration with builtin default configuration and loads it. Attention, all your current configuration will be lost due to overwrite! |
ResetFontSize |
Resets font size to what is configured in the config file. |
ScreenshotVT |
Takes a screenshot in form of VT escape sequences. |
SaveScreenshot |
Takes a screenshot and saves it into a file. |
CopyScreenshot |
takes a screenshot and puts it into the system clipboard |
ScrollDown |
Scrolls down by the multiplier factor. |
ScrollMarkDown |
Scrolls one mark down (if none present, bottom of the screen) |
ScrollMarkUp |
Scrolls one mark up |
ScrollOneDown |
Scrolls down by exactly one line. |
ScrollOneUp |
Scrolls up by exactly one line. |
ScrollPageDown |
Scrolls a page down. |
ScrollPageUp |
Scrolls a page up. |
ScrollToBottom |
Scrolls to the bottom of the screen buffer. |
ScrollToTop |
Scrolls to the top of the screen buffer. |
ScrollUp |
Scrolls up by the multiplier factor. |
SearchReverse |
Initiates search mode (starting to search at current cursor position, moving upwards). |
SendChars |
Writes given characters in chars member to the applications input. |
ToggleAllKeyMaps |
Disables/enables responding to all keybinds (this keybind will be preserved when disabling all others). |
ToggleFullscreen |
Enables/disables full screen mode. |
ToggleInputProtection |
Enables/disables terminal input protection. |
ToggleStatusLine |
Shows/hides the VT320 compatible Indicator status line. |
ToggleTitleBar |
Shows/Hides titlebar |
TraceBreakAtEmptyQueue |
Executes any pending VT sequence from the VT sequence buffer in trace mode, then waits. |
TraceEnter |
Enables trace mode, suspending execution until explicitly requested to continue (See TraceLeave and TraceStep). |
TraceLeave |
Disables trace mode. Any pending VT sequence will be flushed out and normal execution will be resumed. |
TraceStep |
Executes a single VT sequence that is to be executed next. |
ViNormalMode |
Enters/Leaves Vi-like normal mode. The cursor can then be moved via h/j/k/l movements in normal mode and text can be selected via v , yanked via y , and clipboard pasted via p . |
WriteScreen, chars: '' |
Writes VT sequence in chars member to the screen (bypassing the application). |
CreateNewTab |
Creates a new tab in the terminal emulator. |
CloseTab |
Closes current tab. |
SwitchToTab, position: 0 |
Switch to absolute tab position (starting at number 1) |
SwitchToTabLeft |
Switch to tab to the left |
SwitchToTabRight |
Switch to tab to the right |
Example of entries inside config file
- { mods: [Control], key: Enter, action: CancelSelection }
- { mods: [Control], key: Enter, action: ChangeProfile }
- { mods: [Control], key: Enter, action: ClearHistoryAndReset }
- { mods: [Control], key: Enter, action: CopyPreviousMarkRange }
- { mods: [Control], key: Enter, action: CopySelection }
- { mods: [Control], key: Enter, action: CreateDebugDump }
- { mods: [Control], key: Enter, action: CreateSelection, delimiters: '' }
- { mods: [Control], key: Enter, action: DecreaseFontSize }
- { mods: [Control], key: Enter, action: DecreaseOpacity }
- { mods: [Control], key: Enter, action: FocusNextSearchMatch }
- { mods: [Control], key: Enter, action: FocusPreviousSearchMatch }
- { mods: [Control], key: Enter, action: FollowHyperlink }
- { mods: [Control], key: Enter, action: IncreaseFontSize }
- { mods: [Control], key: Enter, action: IncreaseOpacity }
- { mods: [Control], key: Enter, action: NewTerminal }
- { mods: [Control], key: Enter, action: NoSearchHighlight }
- { mods: [Control], key: Enter, action: OpenConfiguration }
- { mods: [Control], key: Enter, action: OpenFileManager }
- { mods: [Control], key: Enter, action: OpenSelection }
- { mods: [Control], key: Enter, action: PasteClipboard }
- { mods: [Control], key: Enter, action: PasteSelection }
- { mods: [Control], key: Enter, action: Quit }
- { mods: [Control], key: Enter, action: ReloadConfig }
- { mods: [Control], key: Enter, action: ResetConfig }
- { mods: [Control], key: Enter, action: ResetFontSize }
- { mods: [Control], key: Enter, action: ScreenshotVT }
- { mods: [Control], key: Enter, action: SaveScreenshot }
- { mods: [Control], key: Enter, action: CopyScreenshot }
- { mods: [Control], key: Enter, action: ScrollDown }
- { mods: [Control], key: Enter, action: ScrollMarkDown }
- { mods: [Control], key: Enter, action: ScrollMarkUp }
- { mods: [Control], key: Enter, action: ScrollOneDown }
- { mods: [Control], key: Enter, action: ScrollOneUp }
- { mods: [Control], key: Enter, action: ScrollPageDown }
- { mods: [Control], key: Enter, action: ScrollPageUp }
- { mods: [Control], key: Enter, action: ScrollToBottom }
- { mods: [Control], key: Enter, action: ScrollToTop }
- { mods: [Control], key: Enter, action: ScrollUp }
- { mods: [Control], key: Enter, action: SearchReverse }
- { mods: [Control], key: Enter, action: SendChars }
- { mods: [Control], key: Enter, action: ToggleAllKeyMaps }
- { mods: [Control], key: Enter, action: ToggleFullscreen }
- { mods: [Control], key: Enter, action: ToggleInputProtection }
- { mods: [Control], key: Enter, action: ToggleStatusLine }
- { mods: [Control], key: Enter, action: ToggleTitleBar }
- { mods: [Control], key: Enter, action: TraceBreakAtEmptyQueue }
- { mods: [Control], key: Enter, action: TraceEnter }
- { mods: [Control], key: Enter, action: TraceLeave }
- { mods: [Control], key: Enter, action: TraceStep }
- { mods: [Control], key: Enter, action: ViNormalMode }
- { mods: [Control], key: Enter, action: WriteScreen, chars: '' }
- { mods: [Control], key: Enter, action: CreateNewTab }
- { mods: [Control], key: Enter, action: CloseTab }
- { mods: [Control], key: Enter, action: SwitchToTab, position: 0 }
- { mods: [Control], key: Enter, action: SwitchToTabLeft }
- { mods: [Control], key: Enter, action: SwitchToTabRight }