-
Notifications
You must be signed in to change notification settings - Fork 104
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
Exit 1 from wslbridge / terminal size not updated, if window is maximized before WSL starts #220
Comments
I assume it's a cygwin issue but not sure. wslbridge2 gets notified from cygwin when there is window resize event happens i.e.
|
With no config file, no system/user bashrc/profile, and maximized: After a restore/maximize:
Repro'd with 3.1.0 but not 3.0.6. I tried about 20 times on 3.0.6 with no success -- WSL is launching a lot faster now; at Windows startup it's a good few seconds where I could trigger it, so it's tricky to get in early enough. However, I can catch it about every other try with 3.1.0. Not entirely convinced though, given the size reporting issue has been seen before.
This one was a bit harder to get the timing right, as the debug window takes focus, but... No initial resize logged, just the default rows/cols. After a restore/maximize again: |
I've been seeing the exact same thing. Even just dragging a corner and resizing the Terminal before it has started the shell will make it close again right away. |
I've noticed this annoying bug too. Though now this finally forced me to change the shortcut to run maximized, which is what I want 99% of the time anyway. |
It's a bit hard to reproduce this if WSL starts too fast... One way is from a cygwin mintty: |
@Biswa96, it seems to help to add a 100ms delay at the beginning of function resize_window: |
I can reproduce the issue. There is a delay between sending the first window size and registering the windows resize signal. If one open the wslbridge2 between those the size gets mismatched. Working on it... |
I think there are two issues:
|
No change for me, I'm still getting exit 1 with that build. |
I didn't find any "actual working" solution yet. If anyone have a solid solution feel free to contribute. The workarounds are:
|
After some further experiments with my approach (pending SIGWINCH propagation), it does not seem to make a difference whether the pending/postponing is invoked (by respective timing) or not. |
Do you mean a escape sequence like thing? But then the backend has to parse every bit of input buffer, hasn't it? I was thinking of the actual rprichard's wslbridge logic but that would re-welcome static linking issue. |
It should not be a normal escape sequence. Rather a special escape (e.g. NUL) to initiate some "in-band" signalling. If you agree on the approach, I could work something out. |
Uploaded a fix. |
Released 3.1.8. Please check. |
The issue appears not to be happening anymore. |
Looks good so far, I'll report back if it does end up happening again. |
…/wsltty#220) (#25) Co-authored-by: Thomas Wolff <towo@towo.net>
…/wsltty#220) (#25) Co-authored-by: Thomas Wolff <towo@towo.net>
Released 3.6.1, which needed to drop the previous patch as a hotfix (#302). |
Initially, I would launch wsltty, and quickly maximize the window (e.g. with
Win-↑
) when it appeared but before my shell starts (currently just measuring from when my .bashrc starts executing), at which point it would promptly exit:Quickly dragging the corner to resize the window doesn't seem to cause it to exit. Once WSL has started up, I can maximize or restore the window going forward without issues.
As far as I can tell it's not a config issue, as starting with an empty config file also triggers it, though once I started faffing with the config it became trickier to reproduce consistently.
Now, when it does successfully open without exiting, the terminal size doesn't get updated, so launching e.g. tmux or vim only uses the first 120 cols / 40 rows, as defined in my config as the default window size. As before, maximizing after WSL initialises works fine, and subsequent resizes fix WSL's view of the terminal size going forward.
Could be another case of #73 -- I replaced my .bashrc with
stty size
on its own, and it also confirms my default window size40 120
when I trigger an early maximize. Adding mintty's-w max
option to the launch command does successfully maximize the window, andstty size
then reports the correct size of93 383
.Using v3.1.0.2 x64, though the wsltty build number disagrees, unless it's truncated?
Launching with the WSL Terminal shortcut:
Config file
The text was updated successfully, but these errors were encountered: