fast-syntax-highlighting
fast-syntax-highlighting copied to clipboard
[bug]: Input mangling when using command substitution
Describe the bug
In certain scenarios, command substitution with $()
is mangled when f-s-h is active. The opening bracket is duplicated, and attempting to delete the additional bracket or input additional characters results in duplicate character deletion or addition, respectively.
Steps to reproduce
- Enable f-s-h
- Attempt to type the following in the terminal:
git diff @ $(echo "test")
; this should trigger the behavior following$(
.
Expected behavior
The entered command string should be input as typed.
Screenshots and recordings
Behavior with f-s-h enabled:
Behavior after disabling f-s-h:
Operating System & Version
linux-gnu | debian | x86_64 | x86_64 | x86_64 unknown
Zsh version
zsh 5.9 (x86_64-debian-linux-gnu)
Terminal emulator
various (see add. context table); xterm-256color, screen-256color
If using WSL on Windows, which version of WSL
WSL 2
Additional context
Reproduced in several environments:
OS | Terminal Emulator | Plugin Framework | $TERM |
---|---|---|---|
OSX | iTerm2 | oh-my-zsh | xterm-256color, screen-256color |
Win10/WSL2 (Ubuntu 20.04) | mintty/wsltty, Windows Terminal | oh-my-zsh, none | xterm-256color, screen-256color |
Debian 11 "Buster" | xterm, gnome-terminal | none | xterm-256color |
I'm experiencing the same issue, specifically on opening a parenthesis or square bracket after a hyphen on the git
command:
git -((ddoouubbllee cchhaarraacctteerrss
git -[[ddoouubblleedd
git -beforeparens((aafftteerr
git -no (problem) if there's a space after the hyphen
git -{no problem with braces}
Cannot reproduce OP's example, though.