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

Re-run in zellij run does not preserve terminal size (stty size returns 0 0) #4034

Open
yo-goto opened this issue Mar 2, 2025 · 0 comments

Comments

@yo-goto
Copy link

yo-goto commented Mar 2, 2025

2. Issues with the Zellij UI / behavior / crash

Issue description

When using zellij run, the first execution correctly detects the terminal size, but when re-run, stty size and equivalent commands return 0 0. This suggests that Zellij is not correctly passing the terminal size to the newly spawned shell in re-run mode.

Minimal reproduction

  1. Open a Zellij session.
  2. Run the following command:
    zellij run -- nu -l -c 'stty size'
    or
    zellij run -- bash -ic 'stty size'
    or simply
    zellij run -- stty size
  3. Observe that the command correctly outputs the terminal size (e.g., 47 91).
  4. Use the re-run feature (Enter).
  5. Observe that the output is now 0 0, indicating that the terminal size is not being correctly passed.

Expected Behavior

Re-running a command using zellij run should preserve and correctly pass the terminal size to the spawned shell, just like the initial execution.

Actual Behavior

On re-run, the terminal size is not passed correctly, causing commands like stty size to return 0 0.

Environment

  • Zellij version: 0.41.2
  • Shell: nushell
  • OS: macOS Sonoma 14.7
  • Terminal Emulator: Alacritty

Additional information

  • This issue occurs consistently with different shells (Bash, Nushell, etc.).
  • The initial execution works fine, but only re-run fails.
  • In particular, Nushell's many built-in commands (like ls) format their table output based on the terminal size. When the terminal size is incorrectly reported as 0, re-running the commands result in an error:
    Couldn't fit table into 0 columns!
    
    This makes it impossible to retrieve the expected output upon re-run.
    So, this is the only way to re-run ls correctly.
    zellij run -- nu -l -c 'stty rows 47 cols 91; ls'
    

Could you confirm whether this is an expected limitation or a bug? If this behavior is unintended, would it be possible to ensure that terminal size information is passed correctly during re-run?

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

No branches or pull requests

1 participant