zsh-history-substring-search highlighting stops when used with zcolors
alitajelsir opened this issue · comments
Describe the bug
zsh-history-substring-search
highlighting for the searched characters stops when used withzcolors
- Highlighting is working fine without
zcolors
Steps To Reproduce
[ -f $XDG_DATA_HOME/znap/zsh-snap/znap.zsh ] ||
git clone https://github.com/marlonrichert/zsh-snap.git $XDG_DATA_HOME/znap/zsh-snap/
source $XDG_DATA_HOME/znap/zsh-snap/znap.zsh
znap source zsh-users/zsh-syntax-highlighting
znap source marlonrichert/zcolors
znap eval zcolors zcolors
znap source zsh-users/zsh-history-substring-search
bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down
Expected behavior
Observed behavior
Environment:
- OS:
Arch Linux
- Terminal:
Konsole
- Zsh version:
5.9-1
- Repo version:
main f999c62
I'm unable to reproduce this:
% cd $(mktemp -d)
% mkdir -p $PWD/znap
% > .zshrc <<EOF
PS1='%# ' PS2= RPS2='%^'; setopt transientrprompt interactivecomments
XDG_DATA_HOME=$PWD
[ -f \$XDG_DATA_HOME/znap/zsh-snap/znap.zsh ] ||
git clone https://github.com/marlonrichert/zsh-snap.git \$XDG_DATA_HOME/znap/zsh-snap/
source \$XDG_DATA_HOME/znap/zsh-snap/znap.zsh
znap source zsh-users/zsh-syntax-highlighting
znap source marlonrichert/zcolors
znap eval zcolors zcolors
znap source zsh-users/zsh-history-substring-search
bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down
EOF
% env -i HOME=$PWD PATH=$PATH TERM=$TERM ${TERMINFO:+TERMINFO=$TERMINFO} zsh -d
Cloning into '/private/var/folders/24/37_vm48s2tz9bhmj1rzffvl40000gn/T/tmp.TbNW2YiP/znap/zsh-snap'...
remote: Enumerating objects: 1667, done.
remote: Counting objects: 100% (83/83), done.
remote: Compressing objects: 100% (27/27), done.
remote: Total 1667 (delta 60), reused 63 (delta 56), pack-reused 1584
Receiving objects: 100% (1667/1667), 238.36 KiB | 2.43 MiB/s, done.
Resolving deltas: 100% (1195/1195), done.
Cloning into 'zsh-syntax-highlighting'...
remote: Enumerating objects: 368, done.
remote: Counting objects: 100% (368/368), done.
remote: Compressing objects: 100% (300/300), done.
remote: Total 368 (delta 299), reused 104 (delta 54), pack-reused 0
Receiving objects: 100% (368/368), 180.44 KiB | 2.37 MiB/s, done.
Resolving deltas: 100% (299/299), done.
Cloning into 'zcolors'...
remote: Enumerating objects: 11, done.
remote: Counting objects: 100% (11/11), done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 11 (delta 0), reused 5 (delta 0), pack-reused 0
Receiving objects: 100% (11/11), 592.10 KiB | 3.79 MiB/s, done.
znap eval: generating cache for zcolors
Cloning into 'zsh-history-substring-search'...
remote: Enumerating objects: 6, done.
remote: Counting objects: 100% (6/6), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 6 (delta 0), reused 3 (delta 0), pack-reused 0
Receiving objects: 100% (6/6), 9.60 KiB | 614.00 KiB/s, done.
% print foo
foo
% fo<UP ARROW>
% print foo
fo
gets highlighted correctly.
Thanks!.
Would it be possible to try pri
instead of fo
?.
Strangely enough for me fo
gets highlighted but not pri
.
% print foo
foo
% pri<UP ARROW>
% print foo
pri
is not highlighted.
-
I tried to reproduce it like how you did and also in another platform
termux
. Same thing happened again. -
Here is the output from Arch:
❯ cd $(mktemp -d)
❯ mkdir -p $PWD/znap
❯ > .zshrc <<EOF
PS1='%# ' PS2= RPS2='%^'; setopt transientrprompt interactivecomments
XDG_DATA_HOME=$PWD
[ -f \$XDG_DATA_HOME/znap/zsh-snap/znap.zsh ] ||
git clone https://github.com/marlonrichert/zsh-snap.git \$XDG_DATA_HOME/znap/zsh-snap/
source \$XDG_DATA_HOME/znap/zsh-snap/znap.zsh
znap source zsh-users/zsh-syntax-highlighting
znap source marlonrichert/zcolors
znap eval zcolors zcolors
znap source zsh-users/zsh-history-substring-search
bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down
EOF
❯ env -i HOME=$PWD PATH=$PATH TERM=$TERM ${TERMINFO:+TERMINFO=$TERMINFO} zsh -d
Cloning into '/tmp/tmp.6DIP2hFEgr/znap/zsh-snap'...
remote: Enumerating objects: 1667, done.
remote: Counting objects: 100% (83/83), done.
remote: Compressing objects: 100% (27/27), done.
remote: Total 1667 (delta 60), reused 63 (delta 56), pack-reused 1584
Receiving objects: 100% (1667/1667), 238.36 KiB | 542.00 KiB/s, done.
Resolving deltas: 100% (1195/1195), done.
Cloning into 'zsh-syntax-highlighting'...
remote: Enumerating objects: 368, done.
remote: Counting objects: 100% (368/368), done.
remote: Compressing objects: 100% (300/300), done.
remote: Total 368 (delta 299), reused 104 (delta 54), pack-reused 0
Receiving objects: 100% (368/368), 180.44 KiB | 298.00 KiB/s, done.
Resolving deltas: 100% (299/299), done.
Cloning into 'zcolors'...
remote: Enumerating objects: 11, done.
remote: Counting objects: 100% (11/11), done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 11 (delta 0), reused 5 (delta 0), pack-reused 0
Receiving objects: 100% (11/11), 592.10 KiB | 998.00 KiB/s, done.
znap eval: generating cache for zcolors
Cloning into 'zsh-history-substring-search'...
remote: Enumerating objects: 6, done.
remote: Counting objects: 100% (6/6), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 6 (delta 0), reused 3 (delta 0), pack-reused 0
Receiving objects: 100% (6/6), 9.61 KiB | 9.61 MiB/s, done.
% print foo
foo
% pri<UP ARROW>
% print foo
pri
doesn't get highlighted- Thanks in advance!.
@marlonrichert, sorry if I'm nagging. I just want to know if the issue is still open to be reproduced or is it closed for good?.
Thanks for your hard work!
- I think the behavior of
zsh-history-substring-search
has changed so that the searched characters are not highlighted if they are being colored by another plugin. This also happens even withzsh-syntax-highlighting
. That's why I thinkfo
was highlighted but notpri
. - As I don't think this is related to
zcolors
I'll consider this issue to be closed for good. - Sorry for the inconvenience, and thanks for always humoring my ignorance!.
No problem! 🙂 Oh, and no bug is ever closed for good. If you can provide a reproducible test case for an issue, then I will of course reopen it.