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

[bug]: Conflicts with up-line-or-beginning-search from zsh-users #73

Open
ittayd opened this issue Sep 24, 2024 · 1 comment
Open

[bug]: Conflicts with up-line-or-beginning-search from zsh-users #73

ittayd opened this issue Sep 24, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@ittayd
Copy link

ittayd commented Sep 24, 2024

Describe the bug

up-line-or-beginning-search positions the cursor at the end of the line. To allow searching from the prefix of where the cursor was when starting the search, it saves the cursor the first time it is called and then checks if the last widget was up-line-or-beginning-search and if so, restores the cursor.

when the command starts with 'man', then for some reason fast-syntax-highlighting runs the widget -fast-whatis-chroma-callback. This ruins the above check. Now, the cursor is not set to where the search started from, but instead it is at the end of the line, meaning that now the search seems to be stuck (as no other line in history starts with the line of some man page).

Steps to reproduce

I'm not sure how to reproduce in a vanilla environment as I don't know how to recreate the call to -fast-whatis-chroma-callback it seems like it is sometimes called when a line beginning with 'man' is encountered and sometimes not (if I press ctrl-c when the line is stuck on 'man foo', then the next it cycles past 'man foo' and is stuck in the following occurence of man in the history)

Expected behavior

I don't want up-line-or-beginning-search to get "stuck". It seems like invoking zle widgets from some function is not right.

Screenshots and recordings

No response

Operating System & Version

linux-gnu | ubuntu | x86_64 | x86_64 | x86_64 x86_64

Zsh version

zsh 5.8.1 (x86_64-ubuntu-linux-gnu)

Terminal emulator

xterm-256color

If using WSL on Windows, which version of WSL

None

Additional context

No response

@ittayd ittayd added the bug Something isn't working label Sep 24, 2024
@5A6F65
Copy link

5A6F65 commented Dec 30, 2024

This behavior also occurs on my device.
I don't currently have the energy to investigate the mechanism behind this issue, so I opted for an ugly workaround to temporarily mitigate it.
If you're also troubled by the same issue, consider executing the following after f-sy-h has finished loading:

FAST_HIGHLIGHT[chroma-man]=''

This will break the highlighting behavior for man, but up-line-or-beginning-search will no longer freeze.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants