-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
fix(terminal): report terminal window size in pixels #28621
base: master
Are you sure you want to change the base?
Conversation
Window size in pixels is required by some programs, reporting it can help those programs work inside NeoVim terminals. See also: neovim#8259, neovim#12991
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks. If no one else has comments, ping me if this isn't merged in a couple days
I wonder if this fixes any of the log messages that were showing in Windows CI Line 95 in cf9f002
|
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
b6f384c
to
83a63c2
Compare
Currently the test is failed. When stdout is redirected, int res = ioctl(1, TIOCGWINSZ, &ptyproc->winsize);
ptyproc->winsize = (struct winsize){
ptyproc->height,
ptyproc->width,
res ? 0 : (ptyproc->winsize.ws_xpixel / ptyproc->winsize.ws_col) * ptyproc->width,
res ? 0 : (ptyproc->winsize.ws_ypixel / ptyproc->winsize.ws_row) * ptyproc->height,
}; |
It seems this doesn't actually solve anything, and may be incorrect. For example, when running Nvim with |
Window sizes in pixels now have a fallback value 0 when NeoVim is not running in a TTY. This prevents NeoVim from crashing if it's running in an IDE's integrated terminal, a terminal multiplexer, or a testing, etc.
995be4d
to
419b465
Compare
Thanks. I didn't think about remote. I'll try to solve it. |
Window size in pixels is required by some programs, reporting it can help those programs work inside NeoVim terminals.
Closes #8259.
However, this patch doesn't make
icat
work. Instead, it just makes the program show another error, because the problem is not only related to window sizes in pixels but how escape sequences (specifically, APC) are handled. See #4349, #20176.