zellij-org / zellij

A terminal workspace with batteries included
https://zellij.dev
MIT License
22.07k stars 674 forks source link

Floating Pane > Scroll Mode > Text Search lag on mistyped combination of characters #3699

Open koalazub opened 1 month ago

koalazub commented 1 month ago

Issues with the Zellij UI / behavior / crash

Issue description

When searching through large amounts of text, the search functionality severely breaks down after mistyping a character. Often times requiring me to close my terminal and relaunch the session. Zellij in its entirety becomes unusable. The characters are severely staggered well after I've typed the keys.

Minimal reproduction

generate_random_string() { local length=$1 local chars='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' local result="" for (( i=1; i<=length; i++ )); do result+="${chars:$((RANDOM % ${#chars})):1}" done echo $result }

for i in {1..20000}; do echo "Iteration $i:" echo "Title: $(generate_random_string $((RANDOM % 71 + 30)))" echo "Body: $(generate_random_string $((RANDOM % 401 + 100)))" echo "Author: $(generate_random_string $((RANDOM % 21 + 10)))" echo "Email: $(generate_random_string $((RANDOM % 16 + 5)))@$(generate_random_string $((RANDOM % 6 + 5))).com" echo "Views: $((RANDOM % 10001))" echo "Likes: $((RANDOM % 1001))" echo "----------------------------------------" done


https://github.com/user-attachments/assets/570c7ac3-ddd2-4d9d-aeb1-fe7f2d5568ec

> What you're seeing here is each letter taking a second or more to register from the keyboard. That's when it begins lagging

## nushell

```nushell
1..20000 | each { |i|
    print ($"Iteration ($i):"
    + $"\nTitle: (random chars --length (random int 30..100))"
    + $"\nBody: (random chars --length (random int 100..500))"
    + $"\nAuthor: (random chars --length (random int 10..30))"
    + $"\nEmail: (random chars --length (random int 5..20))@(random chars --length (random int 5..10)).com"
    + $"\nViews: (random int 0..10000)"
    + $"\nLikes: (random int 0..1000)"
    + "\n----------------------------------------")
}

https://github.com/user-attachments/assets/46ff129a-695e-4684-baad-642587b2a159

Other relevant information

Version: zellij 0.41.0 Terminal: alacritty 0.13.2 OS: macOS 15.1 (24B82)

imsnif commented 1 month ago

This is a painful issue for me as well. I agree the search functionality could use some touch-ups. Until we fix it, you can use your default $EDITOR to search (and even copy/paste) text in your scrollback. That's what I do: Ctrl s + e.