zsh4humans icon indicating copy to clipboard operation
zsh4humans copied to clipboard

fzf breaks if window size changes and it is interrupted

Open Syphdias opened this issue 3 years ago • 3 comments

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 avatar Aug 27 '20 22:08 Syphdias

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.

romkatv avatar Aug 28 '20 08:08 romkatv

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 avatar Nov 07 '20 13:11 Syphdias

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.

Syphdias avatar Nov 07 '20 13:11 Syphdias