Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

open terminal failed: missing or unsuitable terminal: xterm-kitty #1433

Closed
zeorin opened this issue Aug 11, 2018 · 9 comments
Closed

open terminal failed: missing or unsuitable terminal: xterm-kitty #1433

zeorin opened this issue Aug 11, 2018 · 9 comments

Comments

@zeorin
Copy link

zeorin commented Aug 11, 2018

If I try to attach to a tmux session in a tmux server that was not started from my usual terminal (Kitty), I get the following error message:

open terminal failed: missing or unsuitable terminal: xterm-kitty

(Attaching to sessions in tmux servers that were started using Kitty works just fine.)

That terminfo definition is indeed installed on my system:

% infocmp xterm-kitty
#       Reconstructed via infocmp from file: /usr/local/lib/kitty/terminfo/x/xterm-kitty
xterm-kitty|KovIdTTY,
        am, ccc, hs, km, mc5i, mir, msgr, npc, xenl,
        colors#0x100, cols#80, it#8, lines#24, pairs#0x7fff,
        acsc=++\,\,--..00``aaffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
        bel=^G, bold=\E[1m, cbt=\E[Z, civis=\E[?25l,
        clear=\E[H\E[2J, cnorm=\E[?12l\E[?25h, cr=\r,
        csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
        cud=\E[%p1%dB, cud1=\n, cuf=\E[%p1%dC, cuf1=\E[C,
        cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
        cvvis=\E[?12;25h, dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m,
        dl=\E[%p1%dM, dl1=\E[M, dsl=\E]2;\007, ech=\E[%p1%dX,
        ed=\E[J, el=\E[K, el1=\E[1K, flash=\E[?5h$<100/>\E[?5l,
        fsl=^G, home=\E[H, hpa=\E[%i%p1%dG, ht=^I, hts=\EH,
        ich=\E[%p1%d@, il=\E[%p1%dL, il1=\E[L, ind=\n,
        indn=\E[%p1%dS,
        initc=\E]4;%p1%d;rgb\:%p2%{255}%*%{1000}%/%2.2X/%p3%{255}%*%{1000}%/%2.2X/%p4%{255}%*%{1000}%/%2.2X\E\\,
        kEND=\E[1;2F, kHOM=\E[1;2H, kLFT=\E[1;2D, kRIT=\E[1;2C,
        ka1=, ka3=, kbs=^?, kc1=, kc3=, kcbt=\E[Z, kcub1=\EOD,
        kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, kdch1=\E[3~, kend=\EOF,
        kf1=\EOP, kf10=\E[21~, kf11=\E[23~, kf12=\E[24~,
        kf13=\E[1;2P, kf14=\E[1;2Q, kf15=\E[1;2R, kf16=\E[1;2S,
        kf17=\E[15;2~, kf18=\E[17;2~, kf19=\E[18;2~, kf2=\EOQ,
        kf20=\E[19;2~, kf21=\E[20;2~, kf22=\E[21;2~,
        kf23=\E[23;2~, kf24=\E[24;2~, kf25=\E[1;5P, kf3=\EOR,
        kf4=\EOS, kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~,
        kf9=\E[20~, khlp=, khome=\EOH, kich1=\E[2~, kind=\E[1;2B,
        kmous=\E[M, knp=\E[6~, kpp=\E[5~, kri=\E[1;2A, kund=,
        oc=\E]104\007, op=\E[39;49m, rc=\E8, rev=\E[7m, ri=\EM,
        rin=\E[%p1%dT, ritm=\E[23m, rmacs=\E(B, rmam=\E[?7l,
        rmcup=\E[?1049l, rmir=\E[4l, rmkx=\E[?1l, rmso=\E[27m,
        rmul=\E[24m, rs1=\Ec, sc=\E7,
        setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m,
        setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m,
        sgr=%?%p9%t\E(0%e\E(B%;\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m,
        sgr0=\E(B\E[m, sitm=\E[3m, smacs=\E(0, smam=\E[?7h,
        smcup=\E[?1049h, smir=\E[4h, smkx=\E[?1h, smso=\E[7m,
        smul=\E[4m, tbc=\E[3g, tsl=\E]2;, vpa=\E[%i%p1%dd,

I noticed that the terminfo file is not in a traditional location. It is a location that terminfo knows about:

% infocmp -D
/usr/local/lib/kitty/terminfo
/etc/terminfo
/lib/terminfo
/usr/share/terminfo

When I symlink the file to a more traditional location:

sudo ln -s /usr/local/lib/kitty/terminfo/x/xterm-kitty /usr/share/terminfo/x/xterm-kitty

I can attach without any problem.

Possibly related issues:
#743
kovidgoyal/kitty#370

% uname -sp && tmux -V && echo $TERM
Linux x86_64
tmux 2.6
xterm-kitty
@nicm
Copy link
Member

nicm commented Aug 11, 2018 via email

@zeorin
Copy link
Author

zeorin commented Aug 11, 2018

100% certain. I ran the commands tmux attach, sudo ln -s /usr/local/lib/kitty/terminfo/x/xterm-kitty /usr/share/terminfo/x/xterm-kitty and tmux attach (again) in sequence without any other commands in between (or running any programs other than my terminal emulator).

I've recenly started using tmux-continuum with the option to start tmux at boot using systemd. Hence the tmux server is started with external $TERM set to something other than xterm-kitty.

(I actually initially discovered this issue whilst I was switching from another terminal emulator to Kitty, but this was only a problem during a brief transitional period.)

Ncurses on my system is 6.1-1ubuntu1.18.04.

@nicm
Copy link
Member

nicm commented Aug 11, 2018 via email

@nicm
Copy link
Member

nicm commented Aug 11, 2018 via email

@zeorin
Copy link
Author

zeorin commented Aug 11, 2018

Just realized I didn't actually address your question:

  • I confirmed the errant behaviour reliably in a series of reboots
  • My workaround fixes the issue reliably across reboots
  • Removing the workaround re-introduces the issue

I'd be happy to submit a bug report to the Ubuntu/Debian package maintainers, but would you mind sharing a little bit of technical information about how tmux uses ncurses (even if it's just a pointer to some lines in the source code)?

@nicm
Copy link
Member

nicm commented Aug 11, 2018 via email

@zeorin
Copy link
Author

zeorin commented Aug 11, 2018

@toonn
Copy link

toonn commented Dec 3, 2018

I'm running into a very similar issue when ssh'ing from a mac to an arch linux box from a kitty terminal. Kitty's installed on the arch box and the terminfo is in /usr/share/terminfo/x/xterm-kitty but tmux won't open with the same error message.

Is this the wrong path? Should I report this to the arch package maintainer or is this an issue with my setup?

@lock
Copy link

lock bot commented Feb 14, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Feb 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants