zsh-users / zsh-syntax-highlighting

Fish shell like syntax highlighting for Zsh.
github.com/zsh-users/zsh-syntax-highlighting
BSD 3-Clause "New" or "Revised" License
19.5k stars 1.32k forks source link

Strikethrough in some characters and command arguments #911

Closed shscs911 closed 1 year ago

shscs911 commented 1 year ago

Describe the bug Strikethrough in some characters and command arguments

To Reproduce Steps to reproduce the behavior:

Strikethrough characters:
  1. Type any of the following characters:
  2. g, k, /
Strikethrough command arguments:
  1. Type any of the following commands:
  2. . ~/.zshrc, cd ~/.config/mpv/scripts/

Screenshots zsh-syntax-highlighting-strikethrough

System info

phy1729 commented 1 year ago

One of your path styles seems to be set to use strikethrough. What's the output of typeset -p ZSH_HIGHLIGHT_STYLES?

shscs911 commented 1 year ago
typeset -A ZSH_HIGHLIGHT_STYLES=(
[arg0]='fg=green'
[assign]=none
[autodirectory]='fg=green,underline'
[back-dollar-quoted-argument]='fg=cyan'
[back-double-quoted-argument]='fg=cyan'
[back-quoted-argument]=none
[back-quoted-argument-delimiter]='fg=magenta'
[bracket-error]='fg=red,bold'
[bracket-level-1]='fg=blue,bold'
[bracket-level-2]='fg=green,bold'
[bracket-level-3]='fg=magenta,bold'
[bracket-level-4]='fg=yellow,bold'
[bracket-level-5]='fg=cyan,bold'
[command-substitution]=none
[command-substitution-delimiter]='fg=magenta'
[commandseparator]=none
[comment]='fg=black,bold'
[cursor]=standout
[cursor-matchingbracket]=standout
[default]=none
[dollar-double-quoted-argument]='fg=cyan'
[dollar-quoted-argument]='fg=yellow'
[double-hyphen-option]=none
[double-quoted-argument]='fg=yellow'
[global-alias]='fg=cyan'
[globbing]='fg=blue'
[history-expansion]='fg=blue'
[line]=''
[named-fd]=none
[numeric-fd]=none
[path]=underline
[path_pathseparator]=''
[path_prefix_pathseparator]=''
[precommand]='fg=green,underline'
[process-substitution]=none
[process-substitution-delimiter]='fg=magenta'
[rc-quote]='fg=cyan'
[redirection]='fg=yellow'
[reserved-word]='fg=yellow'
[root]=standout
[single-hyphen-option]=none
[single-quoted-argument]='fg=yellow'
[suffix-alias]='fg=green,underline'
[unknown-token]='fg=red,bold'
)
shscs911 commented 1 year ago

I think underline is somehow being replaced by strikethrough. This is happening only in KDE Konsole, and not in other terminal emulators I've tested (terminator, gnome-terminal, alacritty, kitty, xterm).

Screenshot_20221222_154311

Any idea what could be causing this issue in Konsole?

danielshahaf commented 1 year ago

Is $TERM set to the correct value?

Can you reproduce the issue when a program other than zsh tries to use underline? For instance, look at the underlines in the third paragraph of man zshzle | less.

shscs911 commented 1 year ago

Is $TERM set to the correct value?

Can you reproduce the issue when a program other than zsh tries to use underline? For instance, look at the underlines in the third paragraph of man zshzle | less.

Seeing the same issue in man pages, when viewed from Konsole. It appears properly underlined when opened in other terminal emulators. $TERM = xterm-256color

It appears to be related to the Font size. Strikethrough appears when the font size is < 26.

Font size = 10.50

Screenshot_20221224_200422

Font size = 26.0

Screenshot_20221224_201209

danielshahaf commented 1 year ago

Seeing the same issue in man pages, when viewed from Konsole. It appears properly underlined when opened in other terminal emulators.

So it's not a zsh-syntax-highlighting issue. Closing.

It appears to be related to the Font size. Strikethrough appears when the font size is < 26.

Thanks for the extra details.