You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you want to detect visual mode reliably, use the zle-line-pre-redraw hook and test for [[ $KEYMAP = vicmd ]] && (( REGION_ACTIVE )). That maps to how zsh defined visual mode internally. Wrapping widgets should be a last resort because it tends to lose the effect of widget flags. That #11586 "fix" misses the visual-line-mode widget. And a user might use an emacs region widget or a custom widget. And it only detects entering visual-mode, not leaving it.
The cursor is a bit of a tricky issue with visual mode. If the cursor is done in reverse video and reverse is used for the selection they cancel each other out. Otherwise, a block cursor works best for vi-command mode including visual mode. But this user has configured a vertical bar for visual mode.
If you really want to wrap the visual-mode widget, consider making it conditional depending on whether the cursor is even configured to be different.
It's worse in emacs mode where the cursor position is part of the region at the beginning but not at the end. But I think there are fewer users of the emacs region and they don't configure their cursor so it tends not to come up.
I faced the exact same issue, and I managed to resolve it by removing the code that was added in #11586. Would you @mcornella be able to offer any assistance about this?
Describe the bug
When switching out of visual mode, the cursor does not change back to a block.
Steps to reproduce
Minimal config:
# .zshrc ... plugins+=(vi-mode) VI_MODE_SET_CURSOR=true ...
vi-mode
plugin:plugins+=(vi-mode)
VI_MODE_SET_CURSOR=true
in.zshrc
Expected behavior
I would expect the cursor to remain a block when entering visual mode (or exiting visual mode) instead of switching into a vertical line.
Screenshots and recordings
OS / Linux distribution
macOS 13.3
Zsh version
5.9
Oh My Zsh version
master (b06663d)
Terminal emulator
kitty
If using WSL on Windows, which version of WSL
None
Additional context
This seems to have been introduced by the fix for #11586 as removing the following lines resolves the issue:
The text was updated successfully, but these errors were encountered: