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

Inserting completions erases prompt #237

Open
3 tasks done
musjj opened this issue Aug 2, 2023 · 6 comments
Open
3 tasks done

Inserting completions erases prompt #237

musjj opened this issue Aug 2, 2023 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@musjj
Copy link

musjj commented Aug 2, 2023

General information

Please report the following information as possible as you can:

  • Terminal program: kitty 0.29.2
  • Operating system: NixOS 23.05
  • ZSH framework: zgenom
  • ZSH version: 5.9

Basic examination

  • I have read through the README page
  • I have the latest version of zsh-vi-mode
  • I have tested with another terminal program

Problem description

When trying to perform a completion, the prompt is sometimes erased. If the candidate is long enough, the completion result itself is truncated (only visually).

I think there has been a regression somewhere, because I remember that it was working just fine a few weeks ago.

rec

Reproduction steps

  1. Activate a prompt e.g. starship-rs
  2. Try to complete something long

Expected behavior

Prompt doesn't disappear

@jeffreytse jeffreytse self-assigned this Aug 3, 2023
@jeffreytse jeffreytse added bug Something isn't working verified This issue was already verified and removed verified This issue was already verified labels Aug 3, 2023
@musjj
Copy link
Author

musjj commented Aug 12, 2023

I bisected, and found the commit where this issue starts happening: 6f14b2f

@b-m-f
Copy link

b-m-f commented Aug 17, 2023

I am experiencing the same issue when using fzf for history search

@luong-komorebi
Copy link

Seeing the same issue when using fzf for history search and control T completion. Autocompletion is not affected

@b-m-f a quick fix would be: you press escape (or literally take zsh-vi-mode to visual) and then escape again (bring it back to insert), the error would be gone and you would use fzf as normal (no prompt is cleared)

@jhthorsen
Copy link

jhthorsen commented Sep 3, 2023

I had the same experience with fzf, but I managed to find a workaround:

function dotfiles_fzf_history_widget() {
  fzf-history-widget "$@";
  zle .reset-prompt; # This is the workaround
}

zvm_define_widget dotfiles_fzf_history_widget;
zvm_bindkey viins '^R' dotfiles_fzf_history_widget;

So the fix is that I call .reset-prompt, which is the default reset-prompt, instead of zsh-vi-mode's zvm_reset_prompt. I've tried to add "echo" to that widget to see what happens, and for some reason it seems like $ZVM_POSTPONE_RESET_PROMPT is set to "1". I haven't looked into it further, since I'm ok with the current workaround.

@Anvesh9652
Copy link

Anvesh9652 commented Mar 13, 2024

@jhthorsen, thank you for the workaround. It got fixed for CTRL + R, And this issue exists for CTRL + T and for ** Tab (complete) too. If you have any solutions for these, can you please post them here?

@jhthorsen
Copy link

Unfortunately not. I changed back to bash after having too many old servers that didn't have recent enough zsh for me to work efficiently.

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

6 participants