zellij-org/zellij · error

could not flush

Error message

could not flush

What it means

Error "could not flush" thrown in zellij-org/zellij.

Source

Thrown at zellij-client/src/lib.rs:722

            // Handle terminal messages
            terminal_msg = connections.terminal_ws.next() => {
                match terminal_msg {
                    Some(Ok(Message::Text(text))) => {
                        let mut stdout = os_input.get_stdout_writer();
                        if let Some(sync) = synchronised_output {
                            stdout
                                .write_all(sync.start_seq())
                                .expect("cannot write to stdout");
                        }
                        stdout
                            .write_all(text.as_bytes())
                            .expect("cannot write to stdout");
                        if let Some(sync) = synchronised_output {
                            stdout
                                .write_all(sync.end_seq())
                                .expect("cannot write to stdout");
                        }
                        stdout.flush().expect("could not flush");
                    }
                    Some(Ok(Message::Binary(data))) => {
                        let mut stdout = os_input.get_stdout_writer();
                        if let Some(sync) = synchronised_output {
                            stdout
                                .write_all(sync.start_seq())
                                .expect("cannot write to stdout");
                        }
                        stdout
                            .write_all(&data)
                            .expect("cannot write to stdout");
                        if let Some(sync) = synchronised_output {
                            stdout
                                .write_all(sync.end_seq())
                                .expect("cannot write to stdout");
                        }
                        stdout.flush().expect("could not flush");
                    }

View on GitHub (pinned to e839bfffa5)

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/lib.rs:705 when the operation fails: "could not flush". 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@e839bfffa5 (2026-08-19). Data as JSON: /api/errors/031d31ef5f6ebfbd. Report an issue: GitHub.