zellij-org / zellij

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

Panic with floating pane in another tab #3548

Open Zykino opened 1 month ago

Zykino commented 1 month ago

Issue description

Crash when there is not enough vertical space and a floating pane opened in another tab.

Minimal reproduction

1) zellij --layout compact 2) Create a floating pane (do not hide it) 3) Create a new tab 4) Create a tiled pane in this second tab (so you have 2 side by side) 5) Reduce the terminal height to some ridiculous value (around 8 lines?) 6) Alt left (or Alt right) to go back to the Tab 1 Panic when arriving on the first tab

Other relevant information

Error occurred in server: × Thread 'screen' panicked. ├─▶ Originating Thread(s) │ 1. stdin_handler_thread: AcceptInput │ 2. screen_thread: MoveFocusLeftOrPreviousTab │ ├─▶ At /home/fuser/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zellij-server-0.40.1/src/panes/floating_panes/mod.rs:542:69 ╰─▶ called Option::unwrap() on a None value help: If you are seeing this message, it means that something went wrong.

    -> To get additional information, check the log at: /tmp/zellij-1000/zellij-log/zellij.log
    -> To see a backtrace next time, reproduce the error with: RUST_BACKTRACE=1 zellij [...]
    -> To help us fix this, please open an issue: https://github.com/zellij-org/zellij/issues
Zykino commented 1 month ago

Note that I got this issue while trying to reproduce another one. I don’t know how to reproduce it yet (so I cannot open an issue), but I saw that the line in question have a TODO, so just a heads up that this condition can be reached too:

https://github.com/zellij-org/zellij/blob/cd0cc06cec039623a55273cdc089bdde613e88e7/zellij-server/src/panes/floating_panes/mod.rs#L252

Error occurred in server: × Thread 'screen' panicked. ├─▶ Originating Thread(s) │ 1. screen_thread: TerminalResize │ ├─▶ At /home/fuser/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zellij-server-0.40.1/src/panes/floating_panes/mod.rs:252:72 ╰─▶ called Option::unwrap() on a None value help: If you are seeing this message, it means that something went wrong.

    -> To get additional information, check the log at: /tmp/zellij-1000/zellij-log/zellij.log
    -> To see a backtrace next time, reproduce the error with: RUST_BACKTRACE=1 zellij [...]
    -> To help us fix this, please open an issue: https://github.com/zellij-org/zellij/issues