zsh-users/zsh-syntax-highlighting

Strikethrough in some characters and command arguments

shscs911 opened this issue · 6 comments

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

  • OS: Arch Linux
  • ZSH_HIGHLIGHT_VERSION: 0.8.0-alpha2-dev
  • ZSH_HIGHLIGHT_REVISION: HEAD
  • ZSH_VERSION: 5.9
  • ZSH_PATCHLEVEL: zsh-5.9-0-g73d3173
  • zsh-syntax-highlighting: master

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

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'
)

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?

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.

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

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.