News for hackers. Stuff that matters.
Re:The history of Unix's ioctl and signal about window sizes by kevin_thibedeau on Monday November 04, 2024 @09:34AM (#42041857)
You don't have to use the ioctl. The xterm escape code to query window size is widely supported across terminal emulators. It has the distinct advantage of working remotely and from non-unix systems.
Re:The history of Unix's ioctl and signal about window sizes by rockorager on Monday November 04, 2024 @01:27PM (#42044549)
The single downside being you can get signals for SIGWINCH, while the (legacy) xterm escape sequence requires polling.

I wrote a proposal[0] to have terminals send these updates in-band, instead of requiring polling a-la xterm. So far, foot, ghostty, iterm2, and kitty have implemented this feature on the terminal side. Neovim, notably, also supports this on the client side.

[0]: https://gist.github.com/rockorager/e695fb2924d36b2bcf1fff4a3...

Re:The history of Unix's ioctl and signal about window sizes by clausecker on Monday November 04, 2024 @03:23PM (#42045650)
This stuff sucks because if the application forgets to turn it back off, the terminal pukes random control characters into your shell every time the window is resized.
Re:The history of Unix's ioctl and signal about window sizes by mrlonglong on Monday November 04, 2024 @03:43PM (#42045801)
That's what `reset` is so useful for.
Re:The history of Unix's ioctl and signal about window sizes by caf on Monday November 04, 2024 @07:30PM (#42047544)
The ioctl works remotely as well, because ssh sends window size messages across the channel.
Re:The history of Unix's ioctl and signal about window sizes by kevin_thibedeau on Monday November 04, 2024 @08:57PM (#42047973)
Terminals still run over raw serial ports.