junegunn / fzf

:cherry_blossom: A command-line fuzzy finder
https://junegunn.github.io/fzf/
MIT License
61.91k stars 2.34k forks source link

Slow startup over SSH with `--height` #976

Open pdf opened 6 years ago

pdf commented 6 years ago

When starting fzf with --height > 0 on a remote host connected via SSH startup is very slow, resulting in dropped keystroke input. Locally, or inside a remote tmux session on the same connection, startup time is fast as expected. I tested in both zsh and bash, both exhibit the same behaviour.

I'd guess it's something to do with how the terminal size is computed, let me know if there's anything I can do to help debug.

junegunn commented 6 years ago

I just tested the option on 6 different remote servers over ssh, but I was unable to reproduce the issue. Do you have the same issue when you connect to localhost via ssh?

pdf commented 6 years ago

Do you have the same issue when you connect to localhost via ssh?

Hrm, not noticably, so the delay appears to be largely exacerbated by latency. I use hosts at long distance regularly, the delay might be some multiple of the RTT.

Interestingly, I can get lines/cols from the shell immediately on the same systems that produce the problem with fzf (and fzf starts at normal speed inside tmux):

time tput lines
58
tput lines  0.00s user 0.00s system 0% cpu 0.001 total
alok commented 6 years ago

I have a related issue with --height where fzf is has a lag when starting with it set but is instant if I remove it. I have no idea why, but it sounds somewhat related to this.

danudey commented 4 years ago

I've been encountering this issue since my team started working from home, and I couldn't figure it out. Thanks to @pdf and this ticket, and @alok for his comment, I've managed to figure out the following:

At this point, the only thing I could think of that could be the singular link is the specific Windows SSH client/version/build/etc. Perhaps it's passing wrong, slow, or broken values to the remote end?

Perhaps this will make it possible to reproduce. If you need more data, please let me know, as I'm incredibly eager to see this resolved.