Repository navigation
+ssh: terminfo install fails on macOS when $TMPDIR is longer than 51 characters (ControlPath too long) #15150
Unanswered
adamklein
asked this question in
Issue Triage
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Issue Description
On macOS,
+sshcan't install terminfo when$TMPDIRis longer than 51 characters. Nix dev shells, here direnv'suse flake, setTMPDIR=$TMPDIR/nix-shell.XXXXXX(65 characters). From those shells, everysshfails the install, and the host is never cached.installRemoteTerminfopasses-o ControlPath=$TMPDIR/ghostty-ssh-<22 random chars>. ssh binds a temporary socket at that path plus.<16 random chars>, which comes tolen($TMPDIR) + 52bytes. macOSsun_pathholds 103 bytes plus the NUL. The default$TMPDIRis 48 characters, which leaves 3 bytes spare.Related: #14875 changes this
ControlPathonly when the user already has one configured, so this bug would remain for everyone else.Workaround: shorten
TMPDIRfor the call (TMPDIR=/tmp ssh host), or removessh-terminfofromshell-integration-features.AI disclosure: Claude Code traced the cause in the 1.4.0 source, ran the repro on my machine, and drafted this report. I reviewed and edited it.
Expected Behavior
Terminfo installs regardless of the length of
$TMPDIR.Actual Behavior
ssh can't create the control socket, so the install fails, and the session falls back to
TERM=xterm-256color. Every later connection tries again and fails the same way.Reproduction Steps
Any reachable host works. Run in bash or zsh:
Ghostty Logs
Ghostty Version
OS Version Information
macOS 15.7.3 (24G419)
(Linux only) Display Server
None
(Linux only) Desktop Environment/Window Manager
No response
Minimal Ghostty Configuration
Additional Relevant Configuration
No response
I acknowledge that:
```) on separate lines.All reactions