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

terminfo details missing on macOS #2131

Closed
JeanMertz opened this issue Feb 26, 2019 · 9 comments · Fixed by #2134
Closed

terminfo details missing on macOS #2131

JeanMertz opened this issue Feb 26, 2019 · 9 comments · Fixed by #2134

Comments

@JeanMertz
Copy link
Contributor

JeanMertz commented Feb 26, 2019

The installation instructions mention running:

sudo tic -e alacritty,alacritty-direct alacritty.info

to install the Alacritty specific terminfo definitions.

However, this does not (always) seem to be enough to get cursor style support to work, specifically in tmux.

The solution for me was to add the -x flag to tic:

  -x         treat unknown capabilities as user-defined

However, it appears this is not the final solution, as it apparently changes the behavior of Alacritty.

This is happening with the following software versions:

  • Alacritty (8d5e122)
  • Tmux (2.8)
  • macOS (10.14)
@chrisduerr
Copy link
Member

Some prior discussion was made in #1630.

Checking quickly through everything, it almost looks to me like the capabilities that are not included without the -x flag are just ignored completely, but it has been a while since I've taken a look at terminfo.

If this would be the case, chances are that applications like htop might break because of the additional escape sequences, not because one might be missing. In that case the escape which causes these issues should probably be narrowed down and fixed or removed.

Taking a look at the build files for Termite in the Archlinux repository, you can see that this does indeed use the -x flag (https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/termite#n65). The Alacritty package here does not use them, likely because they were following our install instructions. Taking this into account, I'm pretty certain at this point that I was wrong in the past and the -x flag is something we should strive to get working.

@JeanMertz
Copy link
Contributor Author

If this would be the case, chances are that applications like htop might break because of the additional escape sequences

FYI: on my machine, I don't see any (obvious) breakage of the htop output. Anything specific that looks off on your end?

@chrisduerr
Copy link
Member

This has been a long time ago, but I believe the issues were likely related to clicking of the columns to sort them and clicking on different rows to select them.

With the current terminfo this should work great (it does on my machine), but iirc it broke with the -x option. If this works for you, please let me know and I'll look into it again.

@JeanMertz
Copy link
Contributor Author

JeanMertz commented Feb 26, 2019

Ah, yes, you are correct, it does break (in interesting ways, I might add 😄).

FYI, in tmux, both htop and cursor shape support works as expected if I install using -x and use this tmux config (specifically tmux-256color instead of alacritty):

set -g default-terminal "tmux-256color"
# set -g default-terminal "alacritty"
set -ga terminal-overrides ",alacritty:Tc"

@chrisduerr
Copy link
Member

Well, using the tmux-256color terminfo likely doesn't have this problem because it's unrelated to the Alacritty terminfo.

@JeanMertz
Copy link
Contributor Author

@chrisduerr true, but what I found interesting about that is that the cursor style changing still works as expected.

So: using -x was required, but $TERM can still remain on tmux-256color, and things are now working as expected (regarding my original issue of the cursor style not changing when doing echo -e "\e[6 q")

@chrisduerr
Copy link
Member

The problem with Neovim's cursor style is not Alacritty's support for it. If any program ever sends the right escapes, Alacritty will parse them properly and apply them. The problem is that these escapes are never sent if the terminfo is incorrect.

So keeping the TERM on something other than alacritty is kinda pointless, because you're just completely circumventing the issue.

chrisduerr added a commit to chrisduerr/alacritty that referenced this issue Feb 26, 2019
To make sure all extended capabilities can be queried correctly, it is
necessary to compile the terminfo file using the `-x` flag.

Since Alacritty specified support for the XTerm mouse mode (XM/xm),
using the `-x` flag was not possible until now without breaking programs
like `htop`. By removing this flag, these issues should be resolved.

This fixes alacritty#2131.
@chrisduerr
Copy link
Member

@JeanMertz Would you mind testing if you can find any issues with the new terminfo file provided in #2134?

@chrisduerr chrisduerr removed this from the Version 0.3.0 milestone Mar 3, 2019
chrisduerr added a commit to chrisduerr/alacritty that referenced this issue Mar 3, 2019
To make sure all extended capabilities can be queried correctly, it is
necessary to compile the terminfo file using the `-x` flag.

Since Alacritty specified support for the XTerm mouse mode (XM/xm),
using the `-x` flag was not possible until now without breaking programs
like `htop`. By removing this flag, these issues should be resolved.

This fixes alacritty#2131.
chrisduerr added a commit that referenced this issue Mar 3, 2019
To make sure all extended capabilities can be queried correctly, it is
necessary to compile the terminfo file using the `-x` flag.

Since Alacritty specified support for the XTerm mouse mode (XM/xm),
using the `-x` flag was not possible until now without breaking programs
like `htop`. By removing this flag, these issues should be resolved.

This fixes #2131.
@kernel-panic96
Copy link

I can confirm that it does work on MacOS, my version is Mojave 10.14.4, just a heads up if someone follow these instructions and it still does not work.

Make sure your .tmux.conf does not have extra terminal-overrides without the '-a' (append, don't overwrite) option.
I had one set -g terminal-overrides 'xterm*:smcup@:rmcup@' deep inside the conf file and spend 3 hours wondering why it's not working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

3 participants