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

Underline ignores its color #7065

Closed
st0rmbtw opened this issue May 18, 2023 · 14 comments · Fixed by #9897
Closed

Underline ignores its color #7065

st0rmbtw opened this issue May 18, 2023 · 14 comments · Fixed by #9897
Labels
C-bug Category: This is a bug O-windows Operating system: Windows upstream

Comments

@st0rmbtw
Copy link

st0rmbtw commented May 18, 2023

Summary

Underline ignores its color and uses the color of a word.

Reproduction Steps

I tried this:

In mytheme.toml:

"diagnostic.error" = { fg = "blue", underline = { color = "red", style = "curl"} }

I expected this to happen:
The color of the underline is red, the color of the word is blue

Instead, this happened:
The color of the underline is blue and the color of the word is also blue
image

Helix log

No response

Platform

Windows

Terminal Emulator

Windows Terminal, Alacritty

Helix Version

helix 23.05 (7f5940b)

@st0rmbtw st0rmbtw added the C-bug Category: This is a bug label May 18, 2023
@gabydd
Copy link
Member

gabydd commented May 18, 2023

Can you try setting

[editor]
undercurl = true

To force undercurl it seems that the curly underline isn't showing up at all

@st0rmbtw
Copy link
Author

@gabydd Nope, it didn't help

@gabydd
Copy link
Member

gabydd commented May 18, 2023

In config.toml:

theme changes need to be done in a theme file, see making a theme https://docs.helix-editor.com/themes.html#creating-a-theme

you can use inherits = "<theme you want to change>" in that file to override the underline of a specific theme

@st0rmbtw
Copy link
Author

@gabydd Oh, I meant to write mytheme.toml not config.toml. I'm going to edit the description.

@A-Walrus
Copy link
Contributor

I was unable to reproduce, tried on Alacritty but I got the expected results.

@CptPotato
Copy link
Contributor

If I remember correctly this is a Windows thing. The underline colors and styles get ignored (and filtered out) by conpty, so there's nothing that helix or even the terminal emulator can do.

@gabydd
Copy link
Member

gabydd commented May 19, 2023

That makes sense that it is a terminal issue, if it is not you should be able see the curly underline on most themes, cause almost all of them use it

@kirawi kirawi added O-windows Operating system: Windows upstream labels May 19, 2023
@kirawi
Copy link
Member

kirawi commented May 19, 2023

microsoft/terminal#7228

@gabydd
Copy link
Member

gabydd commented May 19, 2023

This also affects alacritty on windows, so it can probably be marked as upstream and closed

@st0rmbtw
Copy link
Author

image
Yep, it's a Windows's fault, works on Linux as expected. Should I close this issue?

@A-Walrus
Copy link
Contributor

Leave it open, in case someone else runs into it

@andradei
Copy link

Leave it open, in case someone else runs into it

Like me. I can also confirm it's broken on Windows but not on Linux.

@nkitsaini
Copy link
Contributor

nkitsaini commented Sep 27, 2023

Interestingly I have the issue on Linux with Alacrity using tmux i.e. the undercurl color is derived from syntax highlighting instead of the predefined red. The color is accurate (red) if I am not inside tmux. I did verify that this is not due to some environment variable by syncing the env variables in both non-tmux and tmux session.

Also I have tried setting undercurl in config to no help.

@nkitsaini
Copy link
Contributor

Update: I was able to get undercurl color working correctly on tmux by following suggestion at: https://old.reddit.com/r/neovim/comments/vqbu8m/undercurl_support_on_different_terminals/ieoxghg/

Specifically enabling coloring by adding following to ~/.tmux.conf

set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm'  # undercurl support
set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m'  # underscore colors - needs tmux-3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug O-windows Operating system: Windows upstream
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants