-
-
Notifications
You must be signed in to change notification settings - Fork 988
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
Terminal size reporting appears wrong on hyprland #6530
Comments
You cannot rely on the ioctl alone, you need to also handle SIGWINCH. |
Is that really relevant for a 1ms runtime? |
Do you believe signals take longer than a millisecond to be delivered? |
I think the point is that a program that just prints a message and quits runs too fast to be expected to see any signals. Should it wait for a signal? That would be pretty unusual. |
Btw, if hyprland is creating the window and immediately resizing it, then this should probably be considered a bug in hyprland. Or is it not possible to create a window at a specific size on wayland perhaps? (I doubt that) |
It should install a signal handler when it starts, and handle any |
I have no idea, I can tell you that, you will receive SIGWINCH from kitty after a resize. There is no guarantee you will receive it in any fixed time under the value of resize_debounce_time however. This is very easy to test. Just let your program sleep/busy loop for a few seconds and install a SIGWINCH handler. |
Describe the bug
The terminal size appears to be more related to what the previous window was than the current one when a program is launched immediatly.
To Reproduce
albafetch
(more on this under additional context) in config.fish (same happens with .bashrc)Screenshots
2023-08-06.21-27-00.mp4
Environment details
debug info
Additional context
I am testing this in the video using albafetch, a tool I wrote; neofetch works fine (probably because it is much slower and gets the information later). In it, I am using
ioctl(STDOUT_FILENO, TIOCGWINSZ, (struct winsize*)w)
to get the terminal width (man 2 ioctl
), Which is getting executed after probably ~1ms since the program is launched. Getting the terminal width insrc/main.c
, line 384Just to confirm that the issue was not related to albafetch itself, I tried running this script on startup:
Which does indeed fall into the same issue
I do not know if this issue is related to kitty or to hyprland (or maybe, who knows, ioctl itself, but probably not), any advice would be appreciated :)
The text was updated successfully, but these errors were encountered: