zsh-vi-mode icon indicating copy to clipboard operation
zsh-vi-mode copied to clipboard

Fix for completion display bug with tmux/IntelliJ

Open michaelorr opened this issue 2 years ago • 2 comments

IntelliJ terminal requires zle redisplay to be called but this breaks completion menus in non IntelliJ terminals.

This uses an environment variable to detect whether we are in an IntelliJ terminal and only calls zle redisplay for those environments. See also: https://youtrack.jetbrains.com/issue/IDEA-191464/Add-environment-variable-to-terminal-detect-if-running-in-IntelliJ-IDES

Previously the code tried to guard against this bug by looking at $LASTWIDGET but unfortunately we cannot reliably assume that the completion widget has complet in the name (on my personal setup, I saw autosuggest-suggest and self-insert as the $LASTWIDGET during completions depending on context and other zsh plugins enabled).

See also: https://github.com/jeffreytse/zsh-vi-mode/issues/122

michaelorr avatar Aug 23 '22 17:08 michaelorr

I do not use IntelliJ and I would love if someone could validate behavior inside the IntelliJ terminal. I have seen reliably that IntelliJ should be setting this environment variable and I can validate that setting this environment variable reintroduces the bug for non-IntelliJ terminals and removing the environment variable fixes the bug for non-IntelliJ terminals

michaelorr avatar Aug 23 '22 17:08 michaelorr

Hey @jeffreytse , no real urgency but I'm just curious what would be necessary to help move this forward?

michaelorr avatar Aug 30 '22 17:08 michaelorr

Hi @michaelorr

Thanks for your contribution to this project, I will try to do a quick review as soon as possible. : )

Thanks & Regards

jeffreytse avatar Sep 22 '22 03:09 jeffreytse