On Thu, Mar 04, 2004 at 05:40:23AM -0800, Doan Ngoc San wrote:
Hi, Please, help me, how to detect when terminal window resizes ? My OS is REDHAT. Thanks
- if you use the CRT unit: ReadKeyWord will return a virtual "function key" kbScreenSizeChanged after a resize
- otherwise: the kernel will signal your application with SIGWINCH, which you can detect if you install a signal handler, like this:
program WinCh (Input, Output);
uses GPC;
procedure MyHandler (Sig: Integer); begin WriteLn ('Terminal was resized.') end;
var Dummy: Boolean;
begin Dummy := InstallSignalHandler (SIGWINCH, MyHandler, True, False, Null, Null); { this is just a dummy loop, as an example: } while not EOF do ReadLn end.
Emil Jerabek