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

Detect truecolor support with terminfo #5319

Closed
2 of 4 tasks
pascalkuthe opened this issue Dec 27, 2022 · 3 comments · Fixed by #9577
Closed
2 of 4 tasks

Detect truecolor support with terminfo #5319

pascalkuthe opened this issue Dec 27, 2022 · 3 comments · Fixed by #9577
Labels
A-helix-term Area: Helix term improvements C-enhancement Category: Improvements E-easy Call for participation: Experience needed to fix: Easy / not much E-good-first-issue Call for participation: Issues suitable for new contributors E-has-instructions Call for participation: Has instructions for fixing the issue and opening a PR

Comments

@pascalkuthe
Copy link
Member

pascalkuthe commented Dec 27, 2022

Followup to #5312 which was closed before I could comment.

Detecting truecololor support is a complete mess and sadly non standardized. There are multiple semo stanard methods and we probably want to support them all to be on.the save side:

  • COLORTERM based detection
  • using the nonstandard setrgbf/setrgbb terminfo capabilities (commonly used in practice like in nvim)
  • using the standard terminfo RGB capability (support since ncurses 6.1 whixh is sadly rarely used as its mutually exclusive with 256 color support. (See Update TERMINFO capabilities for 24-bit color support in emacs. kovidgoyal/kitty#1141 for some discussion)
  • a manual setting in case everything else fails (for example when using helix over ssh for some reason)

We handle undecurl support similarly (check both nonstandard capabilities and environment variables) and use termini for that. The same thing should be possible/easy to accomplish for this case (the setting could be implemented later)

@pascalkuthe pascalkuthe added C-enhancement Category: Improvements E-easy Call for participation: Experience needed to fix: Easy / not much A-helix-term Area: Helix term improvements labels Dec 27, 2022
@kirawi
Copy link
Member

kirawi commented Dec 30, 2022

By the way, a setting already exists as config.editor.true-color.

@pascalkuthe pascalkuthe added the E-has-instructions Call for participation: Has instructions for fixing the issue and opening a PR label Feb 7, 2023
@eliasp
Copy link

eliasp commented Jun 20, 2023

I'm using:

  • Windows Terminal (1.17.11461.0)
  • Win11 on the client
  • CentOS 9 on the server, where I use Helix
  • Helix 23.05

I launch ssh.exe directly within my Microsoft Terminal profile without going through cmd or pwsh first and connect straight to the target system running CentOS9.

By default, $TERM is xterm-256color.
My Helix config contains config.editor.true-color = true

Trying :theme monokai still claims theme requires true color support.
Explicitly setting $COLORTERM changes nothing.

Anything else I could try or any debug data I could provide?

@pascalkuthe pascalkuthe added the E-good-first-issue Call for participation: Issues suitable for new contributors label Jul 16, 2023
@nkitsaini
Copy link
Contributor

Hi @eliasp, if you have set config.editor.true-color = true, you should not see theme requires true color support error message.

I am guessing that your config might be on your windows machine instead of CentOS (where helix is being run).

Can you try running :get true-color in helix to see if the value is correctly set in config? If this is false you can use :set true-color true to override the value and check if that works.

Also you can try |env (<pipe> followed by env), to check what environment variables are visible to helix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements C-enhancement Category: Improvements E-easy Call for participation: Experience needed to fix: Easy / not much E-good-first-issue Call for participation: Issues suitable for new contributors E-has-instructions Call for participation: Has instructions for fixing the issue and opening a PR
Projects
None yet
4 participants