On Aug 07, 08 12:18:53 -0400, Mark Eichin wrote: > "Thomas Adam" <[EMAIL PROTECTED]> writes: > > > 2008/8/7 Micah Cowan <[EMAIL PROTECTED]>: > >> However, if you use bash, it will set _shell_ variables, COLUMNS and > >> LINES, automatically. This isn't something that screen does, but bash. > >> Bash does _not_ export these by default, however; you'll need to do > >> > >> $ export COLUMNS LINES
This may work, if the screen does not get resized while it is running. I have my screen session inside an xterm, and resize frequently. environment variables would still reflect the old value after a resize. > > > > Rather unportably between Unixes: > > > > eval $(resize) > > resize requires having a terminal type that actually does xterm-style > answerback, which as at best a "maybe". When run from within screen, we guarantee you that xterm-style answerback is honored. Screen is an xterm-compatible device. > What you *really* want is the output of stty: > $ stty -a |grep rows > speed 38400 baud; rows 56; columns 144; line = 0; > > because it's a property of the tty, and changed there - putting the > values in the environment is an old and not-really-workable hack. The best thing to do, is to keep them all in sync: - Measure the real dimension like resize does, - Then check what the PTY thinks, and run stty to set cols and rows, in case a SIGWINCH got lost. - Then check shell variables COLUMNS and LINES, and fire SIGWINCH to the shell, if they do not match. The shell will fetch them from the PTY then. -- o \ Juergen Weigert unix-software __/ _=======.=======_ <V> | [EMAIL PROTECTED] creator __/ _---|____________\/ \ | 0179/2069677 __/ (____/ /\ (/) | ____________________________/ _/ \_ vim:set sw=2 wm=8 _______________________________________________ screen-users mailing list screen-users@gnu.org http://lists.gnu.org/mailman/listinfo/screen-users