trygveaa / kitty-kitten-search

Kitten for searching in kitty
GNU General Public License v3.0
208 stars 7 forks source link

Significant typing lag when large scrollback buffer #2

Open AdamWagner opened 4 years ago

AdamWagner commented 4 years ago

To reproduce:

# navigate to home directory 
# and print a large amount of content to the screen. E.g.,
cd ~
tree

# invoke the search kitten and type a query

When I follow the steps above, there is a significant (700ms?) delay between pressing a key a the character appearing on the screen. Such a delay makes it difficult to type without making an error.

I do not have this issue on a fresh tab with a small amount (e.g., ls) of content in the scrollback buffer.

If you're able to reproduce this, perhaps search should be executed asynchronously so that user input isn't blocked.

trygveaa commented 4 years ago

It's not just the kitten that hangs, it's all of kitty, so it won't help to execute the search asynchronously unfortunately.

So apart from solving the issue in kitty, I think the search kitten itself has these two potential solutions:

  1. Disable incremental search when the scrollback is large.
  2. Implement a debounce, so it doesn't search until after you've stopped typing for a short while.