mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-14 03:25:50 +00:00
With zsh, when installing the ghostty terminfo on a server via the ssh-terminfo shell integration, parts of the terminfo get mangled. In particular, the newline escape sequence in ``` > infocmp -0 -x xterm-ghostty | grep ind= ...,ind=\n,indn=... ``` gets interpreted by `print` as a literal newline, which then just gets ignored / does not have the intended effect. Documentation for the `-r` flag of `print` used in the fix is [here](https://zsh.sourceforge.io/Doc/Release/Shell-Builtin-Commands.html#:~:text=Ignore%20the%20escape%20conventions%20of%20echo.). ### Testing locally You can directly demonstrate this locally. This outputs a host of warning messages: ``` ssh_terminfo=$(infocmp -0 -x xterm-ghostty 2>/dev/null) print "$ssh_terminfo" | tic -x - ``` Whereas ```print -r "$ssh_terminfo" | tic -x -``` or ```infocmp -0 -x xterm-ghostty | tic -x -``` work without issue. ### Testing remotely The most visible way is to observe the output of `htop` before and after the change. More directly, the output of `infocmp -x xterm-ghostty | grep " ind="` should be ```ich=\E[%p1%d@, ich1=\E[@, il=\E[%p1%dL, il1=\E[L, ind=\n,``` instead of ```ich=\E[%p1%d@, ich1=\E[@, il=\E[%p1%dL, il1=\E[L, ind=,``` --- Discussed in #11031. --- AI disclosure: I used Claude for parts of figuring out what was going on. The fix itself and the rest was written and tested by myself.