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

Fix for completion display bug with tmux/IntelliJ #191

Merged
merged 1 commit into from
Sep 22, 2022

Conversation

michaelorr
Copy link
Contributor

@michaelorr michaelorr commented Aug 23, 2022

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: #122

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.

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: jeffreytse#122
@michaelorr
Copy link
Contributor Author

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 michaelorr mentioned this pull request Aug 23, 2022
3 tasks
@jeffreytse jeffreytse self-assigned this Aug 24, 2022
@jeffreytse jeffreytse added the bug Something isn't working label Aug 24, 2022
@michaelorr
Copy link
Contributor Author

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

@jeffreytse
Copy link
Owner

Hi @michaelorr

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

Thanks & Regards

@jeffreytse jeffreytse merged commit 0b1381b into jeffreytse:master Sep 22, 2022
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

Successfully merging this pull request may close these issues.

2 participants