Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thread 'screen' panicked when attempting to rename a floating panel #1323

Closed
Tracked by #1100
DannyBen opened this issue Apr 13, 2022 · 3 comments
Closed
Tracked by #1100

Thread 'screen' panicked when attempting to rename a floating panel #1323

DannyBen opened this issue Apr 13, 2022 · 3 comments

Comments

@DannyBen
Copy link

Basic information

zellij --version: 0.28.1
tput lines: 34
tput cols: 137
uname -av or ver(Windows): Linux ubuntu-focal 5.4.0-107-generic #121-Ubuntu SMP Thu Mar 24 16:04:27 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Further information

I have seen many panic issues, so I hope this is not a duplicate. If it is, feel free to close it.

Error

  × Thread 'screen' panicked.
  ├─▶ Originating Thread(s)
  │     1. stdin_handler_thread: AcceptInput
  │     2. screen_thread: UpdatePaneName
  │
  ├─▶ At zellij-server/src/tab/mod.rs:1740:18
  ╰─▶ called `Option::unwrap()` on a `None` value
  help: If you are seeing this message, it means that something went wrong.
        Please report this error to the github issue.
        (https://github.com/zellij-org/zellij/issues)

        Also, if you want to see the backtrace, you can set the `RUST_BACKTRACE` environment variable to `1`.

then I rerun with backtrace on, hoping it would help the debugging effort, but it seems to not add any new infomration:

Error occurred in server:

  × Thread 'screen' panicked.
  ├─▶ Originating Thread(s)
  │     1. stdin_handler_thread: AcceptInput
  │     2. screen_thread: UpdatePaneName
  │
  ├─▶ At zellij-server/src/tab/mod.rs:1740:18
  ╰─▶ called `Option::unwrap()` on a `None` value
         0: <unknown>
        ..: <...trimmed - all unknown>
        13: <unknown>

Reproduction steps

  1. Start zellij after a fresh install (no config)
  2. Create a new floating pane Ctrl+P W
  3. Rename the floating pane Ctrl+P C
  4. Observe the panic
@raphCode
Copy link
Contributor

raphCode commented Apr 18, 2022

Thanks for reporting this, server stability aka not-crashing-sessions a big concern for us! :)

I can reproduce this on Arch.

Link to crashing function, the get_pane_mut() seems to be the problem?

pub fn update_active_pane_name(&mut self, buf: Vec<u8>, client_id: ClientId) {
if let Some(active_terminal_id) = self.get_active_terminal_id(client_id) {
let active_terminal = self
.tiled_panes
.get_pane_mut(PaneId::Terminal(active_terminal_id))
.unwrap();
// It only allows printable unicode, delete and backspace keys.
let is_updatable = buf.iter().all(|u| matches!(u, 0x20..=0x7E | 0x08 | 0x7F));
if is_updatable {
let s = str::from_utf8(&buf).unwrap();
active_terminal.update_name(s);
}
}
}

@imsnif
Copy link
Member

imsnif commented Apr 19, 2022

Yeah, I'd say that's the issue too. We need to also be looking in self.floating_panes if they are visible. There are examples in a few other places (eg. when resizing the active pane). Would you like to take a look at this, @raphCode ?

raphCode added a commit to raphCode/zellij that referenced this issue Apr 28, 2022
raphCode added a commit to raphCode/zellij that referenced this issue Apr 28, 2022
raphCode added a commit that referenced this issue Apr 29, 2022
* Fix crash on renaming a floating pane (#1323)

* Add rename tests for embedded and floating panes

* docs(changelog): fix floating pane rename
@raphCode
Copy link
Contributor

fixed in #1357

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants