Skip to content

Manual A2 Terminal Settings

Koichi Murase edited this page Jan 16, 2025 · 13 revisions

[ 日本語 | English ] ≫ Manual [§1 Intro | §2 Color | §3 Bind | §4 Edit | §5 Emacs | §6 Vim | §7 Comp | §8 Misc | Index]

A2. Terminal Settings

eterm

Bugs

eterm has a bug that IL inserts a newline character at the current cursor position instead of inserting an empty line in the current line. eterm has a bug that DL performs C-k instead of removing the current line, i.e., DL removes the characters in the line following the current position and connect to the next line.

eterm had a bug in RI. When the current position is at the last line, RI scrolls down the terminal content by one line. When the current position is at the first line in the terminal display, RI does nothing. This seems to have been fixed as of GNU Emacs 28.2.

eterm (GNU Emacs 28.2) has a bug in the bracketed-paste mode. Emacs seems to enable the bracketed-paste mode of the outer terminal by default, but the terminal application inside eterm receives the starting marker \e[200~ but does not receive the ending marker \e[201~ regardless of the bracketed-paste mode of eterm. This causes a problem in the terminal application where the bracketed-paste mode fails to end and the application appears to block. To avoid this situation, the terminal application needs to ignore the starting marker \e[200~ inside eterm.

ghostty

1. Initialization

Ghostty uses the same approach as kitty to inject its shell-integration settings, and ble.sh has a workaround for it. You may check kitty's corresponding section.

iTerm2

Information related to the key-sequence configuration is found in #33 (comment).

kitty

kitty's shell integration interferes with other shell settings.

1. Cursor shape and shell integration

kitty's shell integration tries to fix the cursor style to the blinking vertical bar. When you configure the cursor style using ble-bind -m keymap --cursor=NUM, you will need to turn off kitty's cursor-style manipulation by setting the following line in your ~/.config/kitty/kitty.conf.

shell_integration = no-cursor

If you have already existing configurations for shell_integration, you can append no-cursor separated by a space. Or another option is to turn off kitty's shell integration completely:

shell_integration = disabled

For details, you can reference Configuration - Shell integration - kitty.

2. Initialization and ble-attach

When kitty's shell integration is enabled, kitty changes the Bash startup file from ~/.bashrc to a shell-integration file kitty provides. The user's ~/.bashrc is sourced from the shell-integration file. This means that, even if you put ble-attach at the bottom of your ~/.bashrc, it would not be run at the end of the Bash startup file. To avoid various issues caused by this setup, when ble.sh detects the kitty's shell integration, it cancels ble-attach and switches to the attaching strategy based on PROMPT_ATTACH. The users usually do not need to care about this, but it is good to be aware of this behavior in case there arises a problem with attaching to ble.sh on the startup.

konsole

The way to configure key sequences for modifyOtherKeys is described in #187 (comment).

The list of key sequences is available in §3.6.4.

screen

The timeout of ESC is affected by the timeout of tmux, which can be configured by the option maptimeout. The unit is millisecond.

# ~/.screenrc

maptimeout 1

Terminal.app

1. macOS security check

The file-system security check introduced in macOS 10.15 (Sequoia) may cause a serious delay. This could be worked around by turning off the security check inside the terminal. See the article Performance.

tmux

To enable 256 colors, you need to set the default TERM to tmux-256color or xterm-256color.

# ~/.tmux.conf

# Option 1: set default TERM as tmux-256color
set-option -g default-terminal tmux-256color

# Option 2: set default TERM as xterm-256color
set-option -g default-terminal xterm-256color

The timeout of ESC is affected by the timeout of tmux, which can be configured by the option escape-time. The unit is millisecond.

# ~/.tmux.conf

set -sg escape-time 1

For the correct terminal identification of outer terminals, one needs to set the option allow-passthrough in tmux >= 3.3.

# ~/.tmux.conf (requires tmux >= 3.3)

set -g allow-passthrough on

To use the default cursor shape DECSCUSR(0) for the keymap cursor shape (set by ble-bind -m KEYMAP --cursor 0), the default cursor shape needs to be consistent with that of the outer terminal. One needs set the default cursor shape to the option cursor-style.

# ~/.tmux.conf (requires tmux >= 3.4)

set -g cursor-style blinking-block     # when 1 is the default of the outer terminal
set -g cursor-style block              # when 2 is the default of the outer terminal
set -g cursor-style blinking-underline # when 3 is the default of the outer terminal
set -g cursor-style underline          # when 4 is the default of the outer terminal
set -g cursor-style blinking-bar       # when 5 is the default of the outer terminal
set -g cursor-style bar                # when 6 is the default of the outer terminal

To enable modifyOtherKeys in tmux, the option extended-keys needs to be enabled.

# ~/.tmux.conf (requires tmux >= 3.2)

set -g extended-keys on

Visual Studio Code Terminal

1. Keyboard configurations

There is a nice summary of the configuration for the integrated Terminal of VSCode on the following page:

More keys can be sent to the terminal applications by enabling terminal.integrated.sendKeybindingsToShell. To disable VS Code's bindings for VSCode Terminal one by one, one can add items to terminal.integrated.commandsToSkipShell.

To configure the special key combinations

  1. Open [Keyboard Shortcuts] editor by pressing C-k C-s or by opening the menu for [File]-[Preferences]-[Keyboard Shortcuts].
  2. Open keybindings.js by pressing a button on the right side of the bar showing the "Keyboard Shortcuts" tab.
  3. Add the following entry e.g. for C-k:
{
    "key": "ctrl+k",
    "command": "workbench.action.terminal.sendSequence",
    "args": { "text": "\u000b" },
    "when": "terminalFocus"
}

Key combinations and sequences can be configured as follows. In VSCode Terminal, the key combinations with alt needs to be configured separately.

1.1 Turning off terminal.integrated.sendKeybindingsToShell

To use modified BS, TAB, RET, SPC, and ESC, first, the config terminal.integrated.sendKeybindingsToShell needs to be turned off, and more keys need to be manually configured.

To turn off the config, you can press C-, in VSCode or select menu item [File]-[Preferences]-[Settings] to show the Settings tab. In the text box, you can input terminal.integrated.sendKeybindingsToShell to find the item. In the check box of the config item, you can remove the check if there is a check mark.

The following settings can be put in your keybindings.json (see above description) if you would like to send them to the terminal application without terminal.integrated.sendKeybindingsToShell. If you would like to keep some of the key combinations for VSCode, you can drop the corresponding lines and put the remaining ones to``keybindings.json`.

{ "key": "ctrl+e",     "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u0005"       }, "when": "terminalFocus" },
{ "key": "ctrl+f",     "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u0006"       }, "when": "terminalFocus" },
{ "key": "ctrl+g",     "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u0007"       }, "when": "terminalFocus" },
{ "key": "ctrl+j",     "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u000a"       }, "when": "terminalFocus" },
{ "key": "ctrl+k",     "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u000b"       }, "when": "terminalFocus" },
{ "key": "ctrl+m",     "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u000d"       }, "when": "terminalFocus" },
{ "key": "ctrl+p",     "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u0010"       }, "when": "terminalFocus" },
{ "key": "ctrl+q",     "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u0011"       }, "when": "terminalFocus" },
{ "key": "ctrl+alt+a", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b\u0001" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+b", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b\u0002" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+c", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b\u0003" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+d", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b\u0004" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+e", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b\u0005" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+f", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b\u0006" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+g", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b\u0007" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+h", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b\u0008" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+i", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b\u0009" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+j", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b\u000a" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+k", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b\u000b" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+l", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b\u000c" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+m", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b\u000d" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+n", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b\u000e" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+o", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b\u000f" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+p", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b\u0010" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+q", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b\u0011" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+r", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b\u0012" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+s", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b\u0013" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+t", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b\u0014" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+u", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b\u0015" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+v", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b\u0016" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+w", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b\u0017" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+x", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b\u0018" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+y", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b\u0019" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+z", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b\u001a" }, "when": "terminalFocus" },

1.2 Modified control keys (C-<control>, C-S-<control>, C-M-<control>, and C-M-S-<control>)

As mentioned in the previous section, terminal.integrated.sendKeybindingsToShell needs to be turned off to bind these keys. After turning it off, the modified special keys can be configured as in the following table:

kspec key text kspec key text
C-BS "ctrl+backspace" "\u0008"Note 1 C-S-BS "ctrl+shift+backspace" "\u001b[8;6u"
C-TAB "ctrl+tab" "\u001b[9;5u" C-S-TAB "ctrl+shift+tab" "\u001b[9;6u"
C-RET "ctrl+enter" "\u001b[13;5u" C-S-RET "ctrl+shift+enter" "\u001b[13;6u"
C-ESC "ctrl+escape" "\u001b[27;5u"Note 2 C-S-ESC "ctrl+shift+escape" "\u001b[27;6u"Note 2
C-SP "ctrl+space" Note 3 C-S-SP "ctrl+shift+space" "\u001b[32;6u"
C-M-BS "ctrl+alt+backspace" Note 3 C-M-S-BS "ctrl+alt+shift+backspace" "\u001b[8;8u"
C-M-TAB "ctrl+alt+tab" "\u001b[9;7u" C-M-S-TAB "ctrl+alt+shift+tab" "\u001b[9;8u"
C-M-RET "ctrl+alt+enter" "\u001b[13;7u" C-M-S-RET "ctrl+alt+shift+enter" "\u001b[13;8u"
C-M-ESC "ctrl+alt+escape" "\u001b[27;5u"Note 2 C-M-S-ESC "ctrl+alt+shift+escape" "\u001b[27;8u"Note 2
C-M-SP "ctrl+alt+space" Note 3 C-M-S-SP "ctrl+alt+shift+space" "\u001b[32;8u"
  • Note 1: VSCode Terminal sends C-w by default when C-BS is pressed, which is not usual. You can override it to send C-h ("\u0008"), C-_ ("\u001F"), or C-BS ("\u001b[8;5u").
  • Note 2: In Windows, these keys are processed by the operating system by default, so they cannot be used anyway.
  • Note 3: VSCode Terminal already sends desired sequences with these key combinations, so we don't have to change them.

An example for the actual setting in keybindings.json would become as follows:

{ "key": "ctrl+backspace",           "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u0008"       }, "when": "terminalFocus" },
{ "key": "ctrl+tab",                 "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[9;5u"  }, "when": "terminalFocus" },
{ "key": "ctrl+enter",               "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[13;5u" }, "when": "terminalFocus" },
{ "key": "ctrl+escape",              "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[27;5u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+backspace",       "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b\u0008" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+tab",             "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[9;5u"  }, "when": "terminalFocus" },
{ "key": "ctrl+alt+enter",           "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[13;5u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+escape",          "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[27;5u" }, "when": "terminalFocus" },
{ "key": "ctrl+shift+backspace",     "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[8;6u"  }, "when": "terminalFocus" },
{ "key": "ctrl+shift+tab",           "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[9;6u"  }, "when": "terminalFocus" },
{ "key": "ctrl+shift+enter",         "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[13;6u" }, "when": "terminalFocus" },
{ "key": "ctrl+shift+escape",        "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[27;6u" }, "when": "terminalFocus" },
{ "key": "ctrl+shift+space",         "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[32;6u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+backspace", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[8;8u"  }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+tab",       "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[9;8u"  }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+enter",     "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[13;8u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+escape",    "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[27;8u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+space",     "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[32;8u" }, "when": "terminalFocus" },

1.3 Modified numbers (C-<digit>, C-S-<digit>, C-M-<digit>, and C-M-S-<digit>)

kspec key text kspec key text
C-0 "ctrl+0" "\u001b[48;5u" C-S-0 "ctrl+shift+0" "\u001b[48;6u"
C-1 "ctrl+1" "\u001b[49;5u" C-S-1 "ctrl+shift+1" "\u001b[49;6u"
C-2 "ctrl+2" "\u001b[50;5u" C-S-2 "ctrl+shift+2" "\u001b[50;6u"
C-3 "ctrl+3" "\u001b[51;5u" C-S-3 "ctrl+shift+3" "\u001b[51;6u"
C-4 "ctrl+4" "\u001b[52;5u" C-S-4 "ctrl+shift+4" "\u001b[52;6u"
C-5 "ctrl+5" "\u001b[53;5u" C-S-5 "ctrl+shift+5" "\u001b[53;6u"
C-6 "ctrl+6" "\u001b[54;5u" C-S-6 "ctrl+shift+6" "\u001b[54;6u"
C-7 "ctrl+7" "\u001b[55;5u" C-S-7 "ctrl+shift+7" "\u001b[55;6u"
C-8 "ctrl+8" "\u001b[56;5u" C-S-8 "ctrl+shift+8" "\u001b[56;6u"
C-9 "ctrl+9" "\u001b[57;5u" C-S-9 "ctrl+shift+9" "\u001b[57;6u"
C-M-0 "ctrl+alt+0" "\u001b[48;7u" C-M-S-0 "ctrl+alt+shift+0" "\u001b[48;8u"
C-M-1 "ctrl+alt+1" "\u001b[49;7u" C-M-S-1 "ctrl+alt+shift+1" "\u001b[49;8u"
C-M-2 "ctrl+alt+2" "\u001b[50;7u" C-M-S-2 "ctrl+alt+shift+2" "\u001b[50;8u"
C-M-3 "ctrl+alt+3" "\u001b[51;7u" C-M-S-3 "ctrl+alt+shift+3" "\u001b[51;8u"
C-M-4 "ctrl+alt+4" "\u001b[52;7u" C-M-S-4 "ctrl+alt+shift+4" "\u001b[52;8u"
C-M-5 "ctrl+alt+5" "\u001b[53;7u" C-M-S-5 "ctrl+alt+shift+5" "\u001b[53;8u"
C-M-6 "ctrl+alt+6" "\u001b[54;7u" C-M-S-6 "ctrl+alt+shift+6" "\u001b[54;8u"
C-M-7 "ctrl+alt+7" "\u001b[55;7u" C-M-S-7 "ctrl+alt+shift+7" "\u001b[55;8u"
C-M-8 "ctrl+alt+8" "\u001b[56;7u" C-M-S-8 "ctrl+alt+shift+8" "\u001b[56;8u"
C-M-9 "ctrl+alt+9" "\u001b[57;7u" C-M-S-9 "ctrl+alt+shift+9" "\u001b[57;8u"
{ "key": "ctrl+0",           "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[48;5u" }, "when": "terminalFocus" },
{ "key": "ctrl+1",           "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[49;5u" }, "when": "terminalFocus" },
{ "key": "ctrl+2",           "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[50;5u" }, "when": "terminalFocus" },
{ "key": "ctrl+3",           "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[51;5u" }, "when": "terminalFocus" },
{ "key": "ctrl+4",           "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[52;5u" }, "when": "terminalFocus" },
{ "key": "ctrl+5",           "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[53;5u" }, "when": "terminalFocus" },
{ "key": "ctrl+6",           "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[54;5u" }, "when": "terminalFocus" },
{ "key": "ctrl+7",           "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[55;5u" }, "when": "terminalFocus" },
{ "key": "ctrl+8",           "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[56;5u" }, "when": "terminalFocus" },
{ "key": "ctrl+9",           "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[57;5u" }, "when": "terminalFocus" },
{ "key": "ctrl+shift+0",     "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[48;6u" }, "when": "terminalFocus" },
{ "key": "ctrl+shift+1",     "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[49;6u" }, "when": "terminalFocus" },
{ "key": "ctrl+shift+2",     "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[50;6u" }, "when": "terminalFocus" },
{ "key": "ctrl+shift+3",     "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[51;6u" }, "when": "terminalFocus" },
{ "key": "ctrl+shift+4",     "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[52;6u" }, "when": "terminalFocus" },
{ "key": "ctrl+shift+5",     "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[53;6u" }, "when": "terminalFocus" },
{ "key": "ctrl+shift+6",     "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[54;6u" }, "when": "terminalFocus" },
{ "key": "ctrl+shift+7",     "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[55;6u" }, "when": "terminalFocus" },
{ "key": "ctrl+shift+8",     "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[56;6u" }, "when": "terminalFocus" },
{ "key": "ctrl+shift+9",     "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[57;6u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+0",       "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[48;7u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+1",       "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[49;7u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+2",       "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[50;7u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+3",       "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[51;7u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+4",       "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[52;7u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+5",       "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[53;7u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+6",       "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[54;7u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+7",       "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[55;7u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+8",       "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[56;7u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+9",       "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[57;7u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+0", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[48;8u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+1", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[49;8u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+2", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[50;8u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+3", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[51;8u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+4", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[52;8u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+5", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[53;8u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+6", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[54;8u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+7", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[55;8u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+8", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[56;8u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+9", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[57;8u" }, "when": "terminalFocus" },

1.4 Modified letters (C-S-<letter> and C-M-S-<Digits>)

kspec key text kspec key text
C-S-a "ctrl+shift+a" "\u001b[97;6u" C-M-S-a "ctrl+alt+shift+a" "\u001b[97;8u"
C-S-b "ctrl+shift+b" "\u001b[98;6u" C-M-S-b "ctrl+alt+shift+b" "\u001b[98;8u"
C-S-c "ctrl+shift+c" "\u001b[99;6u" C-M-S-c "ctrl+alt+shift+c" "\u001b[99;8u"
C-S-d "ctrl+shift+d" "\u001b[100;6u" C-M-S-d "ctrl+alt+shift+d" "\u001b[100;8u"
C-S-e "ctrl+shift+e" "\u001b[101;6u" C-M-S-e "ctrl+alt+shift+e" "\u001b[101;8u"
C-S-f "ctrl+shift+f" "\u001b[102;6u" C-M-S-f "ctrl+alt+shift+f" "\u001b[102;8u"
C-S-g "ctrl+shift+g" "\u001b[103;6u" C-M-S-g "ctrl+alt+shift+g" "\u001b[103;8u"
C-S-h "ctrl+shift+h" "\u001b[104;6u" C-M-S-h "ctrl+alt+shift+h" "\u001b[104;8u"
C-S-i "ctrl+shift+i" "\u001b[105;6u" C-M-S-i "ctrl+alt+shift+i" "\u001b[105;8u"
C-S-j "ctrl+shift+j" "\u001b[106;6u" C-M-S-j "ctrl+alt+shift+j" "\u001b[106;8u"
C-S-k "ctrl+shift+k" "\u001b[107;6u" C-M-S-k "ctrl+alt+shift+k" "\u001b[107;8u"
C-S-l "ctrl+shift+l" "\u001b[108;6u" C-M-S-l "ctrl+alt+shift+l" "\u001b[108;8u"
C-S-m "ctrl+shift+m" "\u001b[109;6u" C-M-S-m "ctrl+alt+shift+m" "\u001b[109;8u"
C-S-n "ctrl+shift+n" "\u001b[110;6u" C-M-S-n "ctrl+alt+shift+n" "\u001b[110;8u"
C-S-o "ctrl+shift+o" "\u001b[111;6u" C-M-S-o "ctrl+alt+shift+o" "\u001b[111;8u"
C-S-p "ctrl+shift+p" "\u001b[112;6u" C-M-S-p "ctrl+alt+shift+p" "\u001b[112;8u"
C-S-q "ctrl+shift+q" "\u001b[113;6u" C-M-S-q "ctrl+alt+shift+q" "\u001b[113;8u"
C-S-r "ctrl+shift+r" "\u001b[114;6u" C-M-S-r "ctrl+alt+shift+r" "\u001b[114;8u"
C-S-s "ctrl+shift+s" "\u001b[115;6u" C-M-S-s "ctrl+alt+shift+s" "\u001b[115;8u"
C-S-t "ctrl+shift+t" "\u001b[116;6u" C-M-S-t "ctrl+alt+shift+t" "\u001b[116;8u"
C-S-u "ctrl+shift+u" "\u001b[117;6u" C-M-S-u "ctrl+alt+shift+u" "\u001b[117;8u"
C-S-v "ctrl+shift+v" "\u001b[118;6u" C-M-S-v "ctrl+alt+shift+v" "\u001b[118;8u"
C-S-w "ctrl+shift+w" "\u001b[119;6u" C-M-S-w "ctrl+alt+shift+w" "\u001b[119;8u"
C-S-x "ctrl+shift+x" "\u001b[120;6u" C-M-S-x "ctrl+alt+shift+x" "\u001b[120;8u"
C-S-y "ctrl+shift+y" "\u001b[121;6u" C-M-S-y "ctrl+alt+shift+y" "\u001b[121;8u"
C-S-z "ctrl+shift+z" "\u001b[122;6u" C-M-S-z "ctrl+alt+shift+z" "\u001b[122;8u"
{ "key": "ctrl+shift+a",     "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[97;6u"  }, "when": "terminalFocus" },
{ "key": "ctrl+shift+b",     "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[98;6u"  }, "when": "terminalFocus" },
{ "key": "ctrl+shift+c",     "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[99;6u"  }, "when": "terminalFocus" },
{ "key": "ctrl+shift+d",     "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[100;6u" }, "when": "terminalFocus" },
{ "key": "ctrl+shift+e",     "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[101;6u" }, "when": "terminalFocus" },
{ "key": "ctrl+shift+f",     "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[102;6u" }, "when": "terminalFocus" },
{ "key": "ctrl+shift+g",     "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[103;6u" }, "when": "terminalFocus" },
{ "key": "ctrl+shift+h",     "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[104;6u" }, "when": "terminalFocus" },
{ "key": "ctrl+shift+i",     "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[105;6u" }, "when": "terminalFocus" },
{ "key": "ctrl+shift+j",     "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[106;6u" }, "when": "terminalFocus" },
{ "key": "ctrl+shift+k",     "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[107;6u" }, "when": "terminalFocus" },
{ "key": "ctrl+shift+l",     "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[108;6u" }, "when": "terminalFocus" },
{ "key": "ctrl+shift+m",     "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[109;6u" }, "when": "terminalFocus" },
{ "key": "ctrl+shift+n",     "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[110;6u" }, "when": "terminalFocus" },
{ "key": "ctrl+shift+o",     "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[111;6u" }, "when": "terminalFocus" },
{ "key": "ctrl+shift+p",     "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[112;6u" }, "when": "terminalFocus" },
{ "key": "ctrl+shift+q",     "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[113;6u" }, "when": "terminalFocus" },
{ "key": "ctrl+shift+r",     "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[114;6u" }, "when": "terminalFocus" },
{ "key": "ctrl+shift+s",     "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[115;6u" }, "when": "terminalFocus" },
{ "key": "ctrl+shift+t",     "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[116;6u" }, "when": "terminalFocus" },
{ "key": "ctrl+shift+u",     "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[117;6u" }, "when": "terminalFocus" },
{ "key": "ctrl+shift+v",     "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[118;6u" }, "when": "terminalFocus" },
{ "key": "ctrl+shift+w",     "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[119;6u" }, "when": "terminalFocus" },
{ "key": "ctrl+shift+x",     "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[120;6u" }, "when": "terminalFocus" },
{ "key": "ctrl+shift+y",     "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[121;6u" }, "when": "terminalFocus" },
{ "key": "ctrl+shift+z",     "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[122;6u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+a", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[97;8u"  }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+b", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[98;8u"  }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+c", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[99;8u"  }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+d", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[100;8u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+e", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[101;8u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+f", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[102;8u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+g", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[103;8u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+h", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[104;8u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+i", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[105;8u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+j", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[106;8u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+k", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[107;8u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+l", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[108;8u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+m", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[109;8u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+n", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[110;8u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+o", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[111;8u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+p", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[112;8u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+q", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[113;8u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+r", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[114;8u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+s", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[115;8u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+t", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[116;8u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+u", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[117;8u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+v", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[118;8u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+w", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[119;8u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+x", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[120;8u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+y", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[121;8u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+z", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[122;8u" }, "when": "terminalFocus" },

1.5 Modified symbols (C-<symbol>, C-S-<symbol>, C-M-<symbol>, and C-M-S-<symbol>) (Japanese/Windows)

The symbol keys may largely depend on the system and the keyboard. The following is an example for Japanese keyboard on Windows.

kspec key text kspec key text
C-, "ctrl+," "\u001b[44;5u" C-S-, "ctrl+shift+," "\u001b[44;6u"
C-- "ctrl+-" "\u001b[45;5u" C-S-- "ctrl+shift+-" "\u001b[45;6u"
C-. "ctrl+." "\u001b[46;5u" C-S-. "ctrl+shift+." "\u001b[46;6u"
C-/ "ctrl+/" "\u001b[47;5u" C-S-/ "ctrl+shift+/" "\u001b[47;6u"
C-: "ctrl+oem_1" "\u001b[58;5u" C-S-: "ctrl+shift+oem_1" "\u001b[58;6u"
C-; "ctrl+oem_plus" "\u001b[59;5u" C-S-: "ctrl+shift+oem_plus" "\u001b[59;6u"
C-S-[ "ctrl+shift+oem_4" "\u001b[123;6u"
C-S-\ "ctrl+shift+\\" "\u001b[124;6u"
C-S-] "ctrl+shift+oem_6" "\u001b[123;6u"
C-S-^ "ctrl+shift+oem_7" "\u001b[126;6u"
C-M-, "ctrl+alt+," "\u001b[44;7u" C-M-S-, "ctrl+alt+shift+," "\u001b[44;8u"
C-M-- "ctrl+alt+-" "\u001b[45;7u" C-M-S-- "ctrl+alt+shift+-" "\u001b[45;8u"
C-M-. "ctrl+alt+." "\u001b[46;7u" C-M-S-. "ctrl+alt+shift+." "\u001b[46;8u"
C-M-/ "ctrl+alt+/" "\u001b[47;7u" C-M-S-/ "ctrl+alt+shift+/" "\u001b[47;8u"
C-M-: "ctrl+alt+oem_1" "\u001b[58;7u" C-M-S-: "ctrl+alt+shift+oem_1" "\u001b[58;8u"
C-M-; "ctrl+alt+oem_plus" "\u001b[59;7u" C-M-S-: "ctrl+alt+shift+oem_plus" "\u001b[59;8u"
C-M-S-[ "ctrl+alt+shift+oem_4" "\u001b[123;8u"
C-M-S-\ "ctrl+alt+shift+\\" "\u001b[124;8u"
C-M-S-] "ctrl+alt+shift+oem_6" "\u001b[123;8u"
C-M-S-^ "ctrl+alt+shift+oem_7" "\u001b[126;8u"
{ "key": "ctrl+,",                  "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[44;5u"  }, "when": "terminalFocus" },
{ "key": "ctrl+-",                  "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[45;5u"  }, "when": "terminalFocus" },
{ "key": "ctrl+.",                  "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[46;5u"  }, "when": "terminalFocus" },
{ "key": "ctrl+/",                  "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[47;5u"  }, "when": "terminalFocus" },
{ "key": "ctrl+oem_1",              "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[58;5u"  }, "when": "terminalFocus" },
{ "key": "ctrl+oem_plus",           "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[59;5u"  }, "when": "terminalFocus" },
{ "key": "ctrl+shift+,",            "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[44;6u"  }, "when": "terminalFocus" },
{ "key": "ctrl+shift+-",            "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[45;6u"  }, "when": "terminalFocus" },
{ "key": "ctrl+shift+.",            "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[46;6u"  }, "when": "terminalFocus" },
{ "key": "ctrl+shift+/",            "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[47;6u"  }, "when": "terminalFocus" },
{ "key": "ctrl+shift+oem_1",        "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[58;6u"  }, "when": "terminalFocus" },
{ "key": "ctrl+shift+oem_plus",     "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[59;6u"  }, "when": "terminalFocus" },
{ "key": "ctrl+shift+oem_4",        "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[123;6u" }, "when": "terminalFocus" },
{ "key": "ctrl+shift+\\",           "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[124;6u" }, "when": "terminalFocus" },
{ "key": "ctrl+shift+oem_6",        "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[123;6u" }, "when": "terminalFocus" },
{ "key": "ctrl+shift+oem_7",        "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[126;6u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+,",              "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[44;7u"  }, "when": "terminalFocus" },
{ "key": "ctrl+alt+-",              "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[45;7u"  }, "when": "terminalFocus" },
{ "key": "ctrl+alt+.",              "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[46;7u"  }, "when": "terminalFocus" },
{ "key": "ctrl+alt+/",              "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[47;7u"  }, "when": "terminalFocus" },
{ "key": "ctrl+alt+oem_1",          "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[58;7u"  }, "when": "terminalFocus" },
{ "key": "ctrl+alt+oem_plus",       "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[59;7u"  }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+,",        "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[44;8u"  }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+-",        "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[45;8u"  }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+.",        "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[46;8u"  }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+/",        "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[47;8u"  }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+oem_1",    "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[58;8u"  }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+oem_plus", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[59;8u"  }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+oem_4",    "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[123;8u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+\\",       "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[124;8u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+oem_6",    "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[123;8u" }, "when": "terminalFocus" },
{ "key": "ctrl+alt+shift+oem_7",    "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u001b[126;8u" }, "when": "terminalFocus" },

2. Initialization

VSCode Terminal uses a similar approach as kitty to inject its shell-integration settings if enabled, and ble.sh has a workaround for it. You may check [kitty's corresponding section](#Initialization and ble-attach).


[ 日本語 | English ] ≫ Manual [§1 Intro | §2 Color | §3 Bind | §4 Edit | §5 Emacs | §6 Vim | §7 Comp | §8 Misc | Index]

Clone this wiki locally