zellij-org/zellij · error

could not enable raw mode

Error message

could not enable raw mode

What it means

Error "could not enable raw mode" thrown in zellij-org/zellij.

Solutions

  1. Ensure zellij runs attached to a real terminal with write access.
  2. Check the attached OS error for details (closed stdout, unsupported terminal).

When it happens

Trigger: Occurs at zellij-client/src/os_input_output.rs:172 when the operation fails: "could not enable raw mode". Currently there is no defensive handling preventing or contextualizing this failure before it surfaces.

Common situations: Running under a non-tty, redirected stdout, or a terminal that disappeared.


AI-assisted analysis of zellij-org/zellij@bf8d23a4f7 (2026-08-19). Data as JSON: /api/errors/d3fbf29130a2fc47. Report an issue: GitHub.

Appendix: source

Thrown at zellij-client/src/os_input_output.rs:180

    fn env_variable(&self, _name: &str) -> Option<String> {
        None
    }
    /// Returns an async stdin reader that can be polled in tokio::select
    fn get_async_stdin_reader(&self) -> Box<dyn AsyncStdin> {
        Box::new(AsyncStdinReader::new())
    }
    /// Returns an async signal listener that can be polled in tokio::select
    fn get_async_signal_listener(&self) -> io::Result<Box<dyn AsyncSignals>> {
        Ok(Box::new(AsyncSignalListener::new()?))
    }
}

impl ClientOsApi for ClientOsInputOutput {
    fn get_terminal_size(&self) -> Size {
        get_terminal_size()
    }
    fn set_raw_mode(&mut self) {
        crossterm::terminal::enable_raw_mode().expect("could not enable raw mode");
    }
    fn unset_raw_mode(&self) -> Result<(), std::io::Error> {
        crossterm::terminal::disable_raw_mode()
    }
    fn box_clone(&self) -> Box<dyn ClientOsApi> {
        Box::new((*self).clone())
    }
    fn update_session_name(&mut self, new_session_name: String) {
        *self.session_name.lock().unwrap() = Some(new_session_name);
    }
    fn read_from_stdin(&mut self) -> Result<Vec<u8>, &'static str> {
        let session_name_at_calltime = { self.session_name.lock().unwrap().clone() };
        // here we wait for a lock in case another thread is holding stdin
        // this can happen for example when switching sessions, the old thread will only be
        // released once it sees input over STDIN
        //
        // when this happens, we detect in the other thread that our session is ended (by comparing
        // the session name at the beginning of the call and the one after we read from STDIN), and

View on GitHub (pinned to bf8d23a4f7)