zellij-org / zellij

A terminal workspace with batteries included
https://zellij.dev
MIT License
22.08k stars 674 forks source link

Zellij does not resize after startup #2799

Open matejc opened 1 year ago

matejc commented 1 year ago

Basic information

zellij --version: 0.38.1 stty size: 32 49 uname -av or ver(Windows): Linux matej70 6.5.2 #1-NixOS SMP PREEMPT_DYNAMIC Wed Sep 6 20:22:26 UTC 2023 x86_64 GNU/Linux

List of programs: alacritty 0.12.2 hyprland 0.29.1 (d8d0cd75c2db16a14086e1d5119ed937a60c701e)

Further information Zellij config is nothing specdial:

copy_command "/bin/wl-copy"
default_layout "compact"
default_shell "/bin/zsh"
pane_frames false
simplified_ui true

This when I have Alacritty set like so:

window:
  startup_mode: Windowed
shell:
  program: zellij

Result after opening Alacritty: image

It repaints and looks like it should, if I resize the window (by opening some other window side by side - I have a tiling window manager)

I am guessing that Alacritty opens at some default size and Zellij repaints to match that size, but then in next moment Hyprland resizes window to match available space on screen, at that moment Zellij should resize but it does not.

One more thing, if I open just Zsh/Bash in new Alacritty window the size is as it should be.

matejc commented 1 year ago

Workaround seem to be to set config of Alacritty:

shell:
  program: /bin/zsh
  args:
  - --login
  - -c
  - /bin/zellij
MrZLeo commented 1 year ago

I met the same thing:

image
desdic commented 1 year ago

sleeping also fixes the issue with foot

/sbin/foot -a mysession zsh --login -c 'sleep 1;zellij attach --create mysession'

so it looks like timing

todor-a commented 1 week ago

Any progress here? I am reproducing this consistently in every terminal, except iTerm2.

lucaspar commented 1 week ago

I have this happening on sessions running over an SSH proxy for some reason.

This terminal-agnostic workaround does it for me, but I need to manually re-attach to the session whenever the terminal size changes.

# detach from remote Zellij session
eval "$(/usr/bin/resize)"
# re-attach to it, terminal size is correct