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

support undercurls for TERM=kitty (and TERM=xterm-kitty) #11973

Closed
gerion0 opened this issue Mar 2, 2020 · 6 comments
Closed

support undercurls for TERM=kitty (and TERM=xterm-kitty) #11973

gerion0 opened this issue Mar 2, 2020 · 6 comments
Labels
bug issues reporting wrong behavior

Comments

@gerion0
Copy link

gerion0 commented Mar 2, 2020

  • nvim --version: 0.4.3
  • vim -u DEFAULTS (version: ) behaves differently? unknown, not relevant
  • Operating system/version: Gentoo Linux
  • Terminal name/version: Kitty 0.16.0
  • $TERM: This is the source of the problem: "kitty" or "xterm-kitty"

Actual behaviour

When using Kitty as terminal, it has the extra feature of curly underlines. This is supported in neovim (#7479, #9052).

For terminal, it is benefitial that their terminfo files are in the ncurses database. This is the case for kitty, too. Ncurses includes kitty since quite a time but not as "xterm-kitty" but only as "kitty" (kitty bug, ncurses file). I have ncurses 6.1 from 2019.06.09 (gentoo package), that includes this file.

When I now switch from "xterm-kitty" the "kitty" as TERM variable the undercurls are gone, but replaced by underlines.

Expected behaviour

The undercurls are shown, regardless whether TERM is "kitty" or "xterm-kitty".

Addtional info

I tried to patch neovim:

diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c
index 22f4501be..5440d743a 100644
--- a/src/nvim/tui/tui.c
+++ b/src/nvim/tui/tui.c
@@ -1523,7 +1523,8 @@ static void patch_terminfo_bugs(TUIData *data, const char *term,
   bool xterm = terminfo_is_term_family(term, "xterm")
     // Treat Terminal.app as generic xterm-like, for now.
     || nsterm;
-  bool kitty = terminfo_is_term_family(term, "xterm-kitty");
+  bool kitty = terminfo_is_term_family(term, "xterm-kitty")
+     || terminfo_is_term_family(term, "kitty");
   bool linuxvt = terminfo_is_term_family(term, "linux");
   bool bsdvt = terminfo_is_bsd_console(term);
   bool rxvt = terminfo_is_term_family(term, "rxvt");

However, this does not seem to affect the undercurl problem.

@gerion0 gerion0 added the bug issues reporting wrong behavior label Mar 2, 2020
@teto
Copy link
Member

teto commented Mar 2, 2020

I can confirm it's package under the kitty name with ncurses 6.1-20190112 too. Feel free to open up a PR, I will try locally.

@gerion0
Copy link
Author

gerion0 commented Mar 2, 2020

package? Do you mean fail?

I don't have a patch. The above mentioned patch does not work (this was also a wild guess, I grepped the source for "kitty", I don't know anything about the code base).

@blueyed
Copy link
Contributor

blueyed commented Mar 5, 2020

Haven't investigated, but JFI: kitty itself $TERMINFO when installing it manually, and Arch Linux ships xterm-kitty in the kitty-terminfo package.

@blueyed
Copy link
Contributor

blueyed commented Mar 5, 2020

@gerion0 check

int ext_bool_Su = unibi_find_ext_bool(ut, "Su"); // used by kitty

I.e. see if TERM=kitty infocmp -x contains Su - IIRC this is something that ncurses would not add, since it is a custom kitty extension.

@blueyed
Copy link
Contributor

blueyed commented Mar 5, 2020

..it likely boils down to "kitty" in ncurses being different from "xterm-kitty" from Kitty itself?
(you can use infocmp to compare them, and/or diff the output from infocmp -x)

@gerion0
Copy link
Author

gerion0 commented Mar 5, 2020

..it likely boils down to "kitty" in ncurses being different from "xterm-kitty" from Kitty itself?

Yes, exactly that. The Su extension is not reported with TERM=kitty. Ok, so this is not a neovim but a ncurses problem.

Haven't investigated, but JFI: kitty itself $TERMINFO when installing it manually, and Arch Linux ships xterm-kitty in the kitty-terminfo package.

Yes, that is also mentioned in the kitty bug (see first post). In short: Kitty provides its own terminfo package and recommends it. However, on machines that you ssh into from a kitty terminal that don't have this extra terminfo package installed your terminal is broken. Therefore a (correct) entry in the ncurses database would be better.

@gerion0 gerion0 closed this as completed Mar 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug issues reporting wrong behavior
Projects
None yet
Development

No branches or pull requests

3 participants