This tool is a smaller, less featured version of resize from the xterm port.
It's very useful when accessing systems via serial console that don't run X (e.g. dev boxes).
Differential D4438
Add small tool to query terminal for window size darius-dons.net.au on Dec 8 2015, 1:41 PM. Authored by Tags None Referenced Files
Details
This tool is a smaller, less featured version of resize from the xterm port. It's very useful when accessing systems via serial console that don't run X (e.g. dev boxes).
Diff Detail
Event Timeline
Comment Actions Pretty sure read gets EINTR and it exits. Certainly if I test it on a distant system (so I have time to press something before the terminal replies) pressing ^C results in it printing "Unable to parse response". Comment Actions Default action for SIGTERM/SIGINT is to terminate process, not to interrupt read. So, this will not do what you think it will. Comment Actions Hm, isn't this surprising? Isn't the default SIGINT handler "Exit immediately?" If we get a Terminate Program signal mid-run, do we leave the terminal in a usable state (echo, cursor in the right place, etc)? Comment Actions I just realised my previous statement about EINTR was wrong. The code disables ISIG which stops the terminal processing for signal key presses, i.e. ^C becomes just another character (specifically 0x03) so the process doesn't get a signal at all. Comment Actions I do like having something similar in our tree actually, thought this was committed already.
|