Storing the password in traidor.conf is insecure. An alternative is needed. Perhaps the password could be read from the TTY if the user doesn't provide it in traidor.conf.
Also, the program should check the $LINES and $COLUMNS environment variables every time it updates the screen, instead of having to set it manually with the d menu option.
Hmm, I tried reading $LINES from os.environ, it's not in there. while "echo $LINES" in bash works, "env | grep LINES" doesn't show it either.
Any hint for me?
It turns out that $LINES and $COLUMNS are internal to BASH. The way you
really get the size of the terminal is by sending the string "\x1b[18t" (hex: 1b, 5b, 31, 38, 74) to stdout. You'll get a response in the form of "\x1b[8;
L;
Ct" on stdin, where
L and
C are the lines and columns, respectively.
To allow you to avoid having to send this sequence before every screen update, xterm will send your program the
SIGWINCH signal every time the size of the window changes.