Skip to content

Pasting, when ZSH_AUTOSUGGEST_STRATEGY includes completion, will break cursor. #823

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

Open
magnusriga opened this issue Mar 6, 2025 · 0 comments
Labels

Comments

@magnusriga
Copy link

magnusriga commented Mar 6, 2025

Describe the bug

I am experiencing an issue with the cursor, when adding completion as a strategy to the ZSH_AUTOSUGGEST_STRATEGY array.

The cursor is changed from a bar to a line, when pasting in Normal mode (I am using ZSH with built-in Vim mode), despite ZSH still being in Normal mode after the past.

To get the correct Normal mode bar-style cursor back, I have to go into Insert mode, and Escape back again to Normal mode.

Removing the completion strategy will fix the issue. Meaning, without completion, the cursor stays as a bar after pasting in Normal mode (which is what it should do, since ZSH is still in Normal mode after the paste).

Here are my complete findings (the issue is not related to Ghostty, it is also present in e.g. WezTerm): ghostty-org/ghostty#6091 (reply in thread)

Any one else seeing the same?

To Reproduce

  • Activate ZSH built-in vim-mode.
  • Set: ZSH_AUTOSUGGEST_STRATEGY=(history completion)
  • Hit ctrl-c to get a new zsh line, with Insert mode activated.
  • Escape out of Insert mode, and see the cursor is a bar (as it should).
  • Paste text and see that the cursor changes to a line, even though ZSH is still in Normal mode, not in Insert mode.

Expected behavior

The cursor should remain a bar, after pasting in Normal mode, because ZSH is still in Normal mode after pasting.

Desktop

  • OS + distribution: Arch Linux 6.12.13
  • Zsh version: 5.9
  • Plugin version: Latest, as of Jan 2025.

Additional context

n/a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant