cli: always install embedded SSH terminfo

Remove the remote infocmp short-circuit from +ssh setup. The command
already sends Ghostty's embedded terminfo source to tic, so accepting
any existing entry leaves the payload unused and can preserve stale
data.
This commit is contained in:
Jon Parise
2026-08-15 10:48:08 -04:00
parent b5aa8e7a07
commit fff9f62f38
2 changed files with 7 additions and 11 deletions

View File

@@ -128,9 +128,9 @@ pub const Options = struct {
/// forwarding to succeed.
///
/// 2. **Terminfo install** (`--terminfo`). On the first connection to a
/// given destination, installs Ghostty's terminfo entry on the remote
/// host using `infocmp -x xterm-ghostty | ssh tic -x -` over a
/// shared `ControlMaster` connection. Successful installs are cached
/// given destination, installs Ghostty's embedded terminfo entry on the
/// remote host using `ssh tic -x -` over a shared `ControlMaster`
/// connection. Successful installs are cached
/// (see `ghostty +ssh-cache`) so subsequent connections skip this
/// step. When terminfo is successfully installed or already cached,
/// `TERM` is set to `xterm-ghostty` instead of `xterm-256color`.
@@ -491,20 +491,17 @@ fn installRemoteTerminfo(
// the most common failure source) and inherit ssh's stderr so it
// reaches the user's terminal. Other steps stay quiet either way.
const remote_script = if (opts.verbose)
\\infocmp xterm-ghostty >/dev/null 2>&1 && exit 0
\\command -v tic >/dev/null 2>&1 || exit 1
\\mkdir -p ~/.terminfo 2>/dev/null && tic -x - && exit 0
\\exit 1
else
\\infocmp xterm-ghostty >/dev/null 2>&1 && exit 0
\\command -v tic >/dev/null 2>&1 || exit 1
\\mkdir -p ~/.terminfo 2>/dev/null && tic -x - 2>/dev/null && exit 0
\\exit 1
;
// Set up an SSH ControlMaster scoped to this single install:
// - ControlMaster=yes makes our client also act as the master,
// so `infocmp | ssh tic` runs over a single connection.
// - ControlMaster=yes makes our client also act as the master.
// - ControlPersist=no tears the master down when our client
// exits; no socket lingers on the remote side.
const argv = try std.mem.concat(alloc, []const u8, &.{

View File

@@ -2931,10 +2931,9 @@ keybind: Keybinds = .{},
/// (Available since: 1.2.0)
///
/// * `ssh-terminfo` - Enable automatic terminfo installation on remote hosts.
/// Attempts to install Ghostty's terminfo entry using `infocmp` and `tic` when
/// connecting to hosts that lack it. Requires `infocmp` to be available locally
/// and `tic` to be available on remote hosts. Once terminfo is installed on a
/// remote host, it will be automatically "cached" to avoid repeat installations.
/// Attempts to install Ghostty's embedded terminfo entry using `tic` on local
/// cache misses. Requires `tic` to be available on remote hosts. Successful
/// installations are cached locally to avoid repeat installations.
/// If desired, the `+ssh-cache` CLI action can be used to manage the installation
/// cache manually using various arguments.
/// (Available since: 1.2.0)