Files
nix-config/home/base/gui/terminal
ryan4yin | 二花 d8b298019a refactor(shells): use native Home Manager Nushell and Nushell login on non-desktop hosts (#513)
* refactor(shells): use native Home Manager Nushell environment

Replace the Bash login-shell wrapper and hand-maintained Nushell PATH with programs.nushell.loadSessionVariables and home.sessionPath. Launch Nushell directly from Kitty, Ghostty, and Zed, with the macOS config-home override and Ghostty's vendor autoload directory.

Upstream feature: https://github.com/nix-community/home-manager/pull/9666

Assisted-by: DeepSeek Harness (deepseek-flash)

* feat(hosts): use Nushell as login shell on Ruby and Kana

Set the per-user shell explicitly and add Nushell to the system shell list. The system default shell and root remain unchanged.

Assisted-by: DeepSeek Harness (deepseek-flash)

* fix(ssh): preserve tuios session marker across SSH

Forward TUIOS_SESSION and accept it on NixOS sshd, so an SSH session opened from inside tuios does not auto-attach a nested remote tuios.

Assisted-by: DeepSeek Harness (deepseek-flash)

* feat(nixos): use Nushell login shell on non-desktop hosts

Enable the Nushell login shell through a shared module imported by the server and agent profiles. Desktop profiles continue to use Bash.

Assisted-by: DeepSeek Harness (deepseek-flash)

* fix(tuios): skip auto-attach in SSH sessions

Remote interactive shells now stay plain Nushell instead of starting a nested TUIOS when the SSH client is already inside a local TUIOS session. Local TUIOS auto-start is unchanged.

Assisted-by: DeepSeek Harness (deepseek-flash)
2026-11-03 22:31:24 +08:00
..

Terminal Emulators

I used to spend a lot of time tweaking terminal emulators to match my taste. Now tuios gives me a consistent experience across all of them.

Currently, I only use the most basic features of terminal emulators, such as true color, graphics protocol, etc. Other features such as tabs, scrollback buffer, select/search/copy, etc, are all provided by tuios!

My current terminal emulators are:

  1. ghostty: My default terminal emulator, configured in ghostty.nix. Cross-platform, GPU-accelerated, and supports the Kitty graphics protocol.
  2. kitty: My secondary terminal emulator, configured in kitty.nix. Also supports the Kitty graphics protocol.

'xterm-kitty': unknown terminal type when ssh into a remote host or sudo xxx

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) 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

Or when you sudo xxx, sudo won't preserve the TERM variable, it will be reset to root's default TERM value, which is xterm or xterm-256color in most linux distributions, so you will get this error:

'xterm-256color': unknown terminal type

or

Error opening terminal: xterm-kitty.

NixOS preserve the TERMINFO and TERMINFO_DIRS environment variables, for root and the wheel group: nixpkgs/nixos/modules/config/terminfo.nix

For nix-darwin, take a look at https://github.com/LnL7/nix-darwin/wiki/Terminfo-issues

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:

# 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