zellij-org/zellij · error

could not find raw file descriptor

Error message

could not find raw file descriptor

What it means

Error "could not find raw file descriptor" thrown in zellij-org/zellij.

Solutions

  1. Check system resource limits (open files, processes) and the OS error attached to the failure.
  2. Retry the operation; if persistent, report the OS error with a zellij issue.

When it happens

Trigger: Occurs at zellij-server/src/os_input_output_unix.rs:397 when the operation fails: "could not find raw file descriptor". Currently there is no defensive handling preventing or contextualizing this failure before it surfaces.

Common situations: Typically resource exhaustion, invalid fd state, or platform-specific pty limitations.


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

Appendix: source

Thrown at zellij-server/src/os_input_output_unix.rs:397

                    .non_fatal();
            },
        }
        Ok(())
    }

    pub fn write_to_tty_stdin(&self, terminal_id: u32, buf: &[u8]) -> Result<usize> {
        let err_context = || format!("failed to write to stdin of TTY ID {}", terminal_id);

        let fd = match self
            .terminal_id_to_raw_fd
            .lock()
            .to_anyhow()
            .with_context(err_context)?
            .get(&terminal_id)
        {
            Some(Some(fd)) => *fd,
            _ => {
                return Err(anyhow!("could not find raw file descriptor")).with_context(err_context)
            },
        };

        try_write_to_fd(fd, buf).with_context(err_context)
    }

    pub fn tcdrain(&self, terminal_id: u32) -> Result<()> {
        let err_context = || format!("failed to tcdrain to TTY ID {}", terminal_id);

        match self
            .terminal_id_to_raw_fd
            .lock()
            .to_anyhow()
            .with_context(err_context)?
            .get(&terminal_id)
        {
            Some(Some(fd)) => {
                termios::tcdrain(unsafe { BorrowedFd::borrow_raw(*fd) }).with_context(err_context)

View on GitHub (pinned to 5cb5df5cce)