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

fzf breaks if window size changes and it is interrupted #50

Open
Syphdias opened this issue Aug 27, 2020 · 3 comments
Open

fzf breaks if window size changes and it is interrupted #50

Syphdias opened this issue Aug 27, 2020 · 3 comments

Comments

@Syphdias
Copy link
Contributor

Syphdias commented Aug 27, 2020

Hi Roman, got a funny bug with fzf and p10k involved. I only tested this on z4h v3. I don't know if it triggers on v2 as well.

If you resize the terminal while in fzf and interrupt it by pressing Ctrl-C or ESC the prompt breaks.

Steps to reproduce:

  1. Open a terminal
  2. Type vim tab OR Ctrl-R
  3. Resize the terminal emulator
  4. Press ESC or Ctrl-C or tab

image

Terminalemulator: Tilix, Xterm
Z4H version: v3
zsh version: zsh 5.8 (x86_64-pc-linux-gnu)
OS: Manjaro up-to-date
WM: i3wm

Edit: tab triggers the bug as well

@Syphdias Syphdias changed the title fzf breaks if fzf breaks if window size changes and it is interrupted Aug 27, 2020
@romkatv
Copy link
Owner

romkatv commented Aug 28, 2020

Reproduced. Fixing prompt should be easy but I'm not yet sure how to fix cursor position. Will take a closer look some time later.

@Syphdias
Copy link
Contributor Author

Syphdias commented Nov 7, 2020

For documentation: Can also confirm this for v4.

In v5 (in docker) it happens less often or in a smaller manner.
I broke the prompt once, but never again. The cursor position still breaks though.

Edit: Broke the prompt a second time now, but I can't find the pattern that breaks it..

@Syphdias
Copy link
Contributor Author

Syphdias commented Nov 7, 2020

Steps to reproduce in v5:

❯ sudo docker run -e TERM -e COLORTERM -w /root -it --rm alpine sh -uec '
  sh -c "$(wget -O- https://raw.githubusercontent.com/romkatv/zsh4humans/v5/install)"
'
# selected PC, Standard, 1, y, quit p10k setup
  1. fill history with 10 commands
  2. resize terminal to 10 lines
  3. reset
  4. Ctrl-R
  5. Double vertical window size to ~20 lines
  6. Esc
    image

In this example the cursor position is not broken. If you swap steps 2 and 5 cursor position gets messed up in addition.

Edit:
cd /etc/tabtab instead of filling the history and using Ctrl-R works as well.

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

No branches or pull requests

2 participants