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

Mux doesn't recognize window size in tiling environments #2351

Closed
seqizz opened this issue Aug 3, 2022 · 11 comments
Closed

Mux doesn't recognize window size in tiling environments #2351

seqizz opened this issue Aug 3, 2022 · 11 comments
Labels
bug Something isn't working multiplexer

Comments

@seqizz
Copy link

seqizz commented Aug 3, 2022

What Operating System(s) are you seeing this problem on?

Linux X11

Which Wayland compositor or X11 Window manager(s) are you using?

awesomewm 4.3

WezTerm version

Compiled from commit 119c2f1

Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?

No, and I'll explain why below

Describe the bug

Tried to switch to mux, but apparently it's not correctly evaluating window size on startup.

This is not the case if I start a normal terminal with wezterm start --class mainqterm command. It happens when I run wezterm connect default --class mainqterm command.

I tried to do some hacks but couldn't change the main behavior: It starts like this and only corrects itself once I resize the window, or reload the configuration.

image

To Reproduce

I guess you'd need an environment with window rules defined & enforce maximizing of the Wezterm windows on start

Configuration

  -- multiplexing stuff
  unix_domains = {
    {
      name = "default",
      socket_path = "/home/gurkan/.wezterm.sock",
      connect_automatically = false,
    }
  },
  mux_env_remove = {
    "SSH_CLIENT",
    "SSH_CONNECTION",
  },

Expected Behavior

Similar behavior for the non-mux window, initial row/col count matching the initial window size.

Logs

~> wezterm connect default --class mainqterm
12:25:43.902  ERROR  wezterm_gui::termwindow > new_window has no tabs... yet?
12:25:44.353  WARN   wezterm_client::client  > While connecting to Socket("/home/gurkan/.wezterm.sock"): connecting to /home/gurkan/.wezterm.sock.  Will try spawning the server.
12:25:44.353  WARN   wezterm_client::client  > Running: "/nix/store/qvnjmpm28fbj31648j7c4dd5aj5jpngc-wezterm/bin/wezterm-mux-server" "--daemonize"

Anything else?

Relevant discussion item: #2311 (comment)

@seqizz seqizz added the bug Something isn't working label Aug 3, 2022
@wez
Copy link
Owner

wez commented Aug 4, 2022

@wez wez added the multiplexer label Aug 4, 2022
wez added a commit that referenced this issue Aug 5, 2022
Since the initial attach is async, we'd create the window at the
default/initial size and then never reconcile the size of the remote
tabs once they'd attached.

This commit introduces an event that allows the gui window to do that.

The action that it takes is to take the max width and height between
its current size and the size of a newly added tab and resizes to
that new size, if it changed.

refs: #2133
refs: #2351
@wez
Copy link
Owner

wez commented Aug 5, 2022

The behavior has been improved in main; give it a try and let me know how well it works for you?

@seqizz
Copy link
Author

seqizz commented Aug 5, 2022

Now compiled from ef532fc, but couldn't see anything different.

Checking the change, it feels like adding a new tab should do it, but sadly it didn't. Here is an example split inside new tab:

image

Tried getting debug log but couldn't see anything shiny in it, I could provide some trace if it could help.

@cpence
Copy link

cpence commented Dec 24, 2022

Hate to just give a plain +1, but if there's any kind of log or data collection I could offer, I have exactly the same bug. Wezterm 20221119-145034-49b9839f.

Resize behavior is perfect if I use wezterm connect local and stuck at 80x24 (until I do a floating/tiled or fullscreen/non-fullscreen toggle) if I use wezterm connect unix.

wez added a commit that referenced this issue Mar 25, 2023
This helps to notify when eg: splits are changed, or the tab
is resized by another client.

refs: #2133
refs: #2351
refs: #783
@wez
Copy link
Owner

wez commented Mar 25, 2023

Would you mind trying the latest nightly build and let me know whether this is resolved?

@seqizz
Copy link
Author

seqizz commented Mar 25, 2023

Sadly it is same.

(from alacritty): running wezterm-mux-server with following in the wezterm config:

  unix_domains = {
    {
      name = "default",
      socket_path = "/home/gurkan/.wezterm.sock",
      connect_automatically = false,
    }
  },

After it starts, running wezterm connect default --class mainqterm says:

14:30:13.563  ERROR  wezterm_gui::termwindow > new_window has no tabs... yet?
14:30:13.828  WARN   window::os::x11::connection > Unable to resolve appearance using xdg-desktop-portal: Reading xdg-portal org.freedesktop.appearance color-scheme: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.portal.Desktop was not provided by any .service files

Then opens a window like this, unless I resize it confines terminal in lesser area:

image

@wez
Copy link
Owner

wez commented Mar 26, 2023

It's possible that 8dd365d may help here

@seqizz
Copy link
Author

seqizz commented Mar 26, 2023

Thanks. It looks like it helped 🚀
But I reproduced same issue on 2nd try by chance. E.g.:

  • Run wezterm-mux-server on one terminal
  • Run wezterm connect default --class mainqterm on another terminal:
  • Wezterm starts, with normal size, no issues. Even closing the window and re-running same command lands you into same environment as expected.
  • Logout from the open terminal (e.g. Ctrl-D)
  • Re-run the connect command (to get a new session from mux server)
  • New terminal is half-sized again

wez added a commit that referenced this issue Jan 24, 2024
Without this, we don't invalidate the shape hash eg: when zooming a
pane.  This is potentially also the root cause of some other weirdness
with the multiplexer.

refs: #4828
refs: #3694
refs: #2351
@wez
Copy link
Owner

wez commented Jan 24, 2024

8f74e1c fixes some cache invalidation issues around resizing, not sure that it will help here, but I thought it was worth a mention.

wez added a commit that referenced this issue Jan 24, 2024
@seqizz
Copy link
Author

seqizz commented Jan 24, 2024

Thanks for the reminder. I wasn't using the nightly for a while, and already testing the flake from #4843 (which doesn't even cover the commit you mentioned, forked over 12a6b8d).
But I can't reproduce this issue anymore, connected client is always covering the all available area even after multiple runs. So feel free to close 🚀

@wez wez closed this as completed Jan 24, 2024
Copy link
Contributor

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working multiplexer
Projects
None yet
Development

No branches or pull requests

3 participants