Skip to content

Manual A2 Terminal Settings

Koichi Murase edited this page Nov 21, 2023 · 13 revisions

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

A2. Terminal Settings

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

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

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.

iTerm2

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

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.


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

Clone this wiki locally