mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-04-22 08:48:29 +02:00
fix: TERM and TERMINFO
This commit is contained in:
@@ -5,3 +5,41 @@
|
|||||||
3. alacritty: Standby terminal.
|
3. alacritty: Standby terminal.
|
||||||
|
|
||||||
|
|
||||||
|
## 'xterm-kitty': unknown terminal type when `ssh` into a remote host
|
||||||
|
|
||||||
|
> https://sw.kovidgoyal.net/kitty/faq/#i-get-errors-about-the-terminal-being-unknown-or-opening-the-terminal-failing-or-functional-keys-like-arrow-keys-don-t-work
|
||||||
|
|
||||||
|
> https://wezfurlong.org/wezterm/config/lua/config/term.html
|
||||||
|
|
||||||
|
kitty set `TERM` to `xterm-kitty` by default, and TUI apps like `viu`, `yazi`, `curses` will try to search in the host's [terminfo(terminal capability data base)](https://linux.die.net/man/5/terminfo) for value of `TERM` to determine the capabilities of the terminal.
|
||||||
|
|
||||||
|
But when you `ssh` into a remote host, the remote host is very likely to not have `xterm-kitty` in its terminfo, so you will get this error:
|
||||||
|
|
||||||
|
```
|
||||||
|
'xterm-kitty': unknown terminal type
|
||||||
|
```
|
||||||
|
|
||||||
|
### Solutions
|
||||||
|
|
||||||
|
Simplest solution, it will automatically copy over the terminfo files and also magically enable shell integration on the remote machine:
|
||||||
|
|
||||||
|
```
|
||||||
|
kitten ssh user@host
|
||||||
|
```
|
||||||
|
|
||||||
|
Or if you do not care about kitty's features(such as true color & graphics protocol), you can simply set `TERM` to `xterm-256color`, which is built-in in most linux distributions:
|
||||||
|
|
||||||
|
```
|
||||||
|
export TERM=xterm-256color
|
||||||
|
```
|
||||||
|
|
||||||
|
If you need kitty's features, but do not like the magic of `kitten`, you can manually install kitty's terminfo on the remote host:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# install on ubuntu / debian
|
||||||
|
sudo apt-get install kitty-terminfo
|
||||||
|
|
||||||
|
# or copy from local machine
|
||||||
|
infocmp -a xterm-kitty | ssh myserver tic -x -o \~/.terminfo /dev/stdin
|
||||||
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -17,12 +17,17 @@ in {
|
|||||||
# tmux-sensible overwrites default tmux shortcuts, makes them more sane.
|
# tmux-sensible overwrites default tmux shortcuts, makes them more sane.
|
||||||
sensibleOnTop = true;
|
sensibleOnTop = true;
|
||||||
|
|
||||||
# extraConfig = builtins.readFile ./tmux.conf;
|
# https://github.com/sxyazi/yazi/wiki/Image-preview-within-tmux
|
||||||
|
extraConfig = builtins.readFile ''
|
||||||
|
set -g allow-passthrough on
|
||||||
|
|
||||||
|
set -ga update-environment TERM
|
||||||
|
set -ga update-environment TERM_PROGRAM
|
||||||
|
'';
|
||||||
# keyMode = "vi"; # default is emacs
|
# keyMode = "vi"; # default is emacs
|
||||||
|
|
||||||
baseIndex = 1; # start index from 1
|
baseIndex = 1; # start index from 1
|
||||||
escapeTime = 0; # do not wait for escape key
|
escapeTime = 0; # do not wait for escape key
|
||||||
terminal = "xterm-256color";
|
|
||||||
|
|
||||||
plugins = with plugins; [
|
plugins = with plugins; [
|
||||||
draculaTheme # theme
|
draculaTheme # theme
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ in rec {
|
|||||||
|
|
||||||
# set default applications
|
# set default applications
|
||||||
BROWSER = "firefox";
|
BROWSER = "firefox";
|
||||||
TERM = "xterm-256color";
|
|
||||||
|
|
||||||
# enable scrolling in git diff
|
# enable scrolling in git diff
|
||||||
DELTA_PAGER = "less -R";
|
DELTA_PAGER = "less -R";
|
||||||
|
|||||||
Reference in New Issue
Block a user