Use ANSI CSI 18 to query console size#39833
Conversation
In my tests, the sequence works on Ptyxis 49.0, gnome-terminal-3.56.3, xterm-401, rxvt-unicode-9.31, under tmux-3.5a, over ssh and serial console connected to ptyxis. It did not work on a text console in a VM (TERM=linux) or under kmscon-9.1.0 (TERM=vt102).
| return r; | ||
| } | ||
|
|
||
| /* |
There was a problem hiding this comment.
kmscon seems quite active upstream, have you asked them to add this?
There was a problem hiding this comment.
I've a draft implementation for CSI 18 in kmscon at kmscon/libtsm#4
One thing I didn't figured out is what's the difference between "window size" and "screen size" ?
For kmscon, as it has only one full-screen window, CSI 18 and CSI 19 should report the same?
There was a problem hiding this comment.
I don't know for sure, but in my impression when you split the screen e.g. in Vim (text-mode) session, and open embedded terminal in one of it's split window (with :term command) - it should report correct window size then. Not sure who is responsible for that in this case - the outer terminal or Vim itself.
BTW, if Vim is responsible, we should file an issue there, too (if it doesn't work there).
There was a problem hiding this comment.
@kdj0c thanks!
I think the distinction isn't terribly relevant for our use case here. I doubt people are running systemd as PID1 in a split window in an editor ;)
There was a problem hiding this comment.
I doubt people are running systemd as PID1 in a split window in an editor ;)
If this happens when running in VM, this is exactly how I run it.
796870e to
3f59a9a
Compare
This allows us to query the window size without moving the cursor. We have various reports about the cursor being in an unexpected position and/or state. Closes systemd#37526.
3f59a9a to
d91a184
Compare
No description provided.