Hi all, The attached patch removes the exporting of the LINES and COLUMNS environment variables in term-mode. Exporting these variables causes issues for ncurses applications. For example, when running: emacs -Q M-x term (to select /bin/bash) htop (to run htop) and resizing the window (especially making it smaller) can make the program impossible to read. The ncurses code uses an ioctl() initially to get the current size[1] which returns a correct result. However, since we exported the above environment variables these values are discarded in favour of the (now stale) values of LINES and COLUMNS. Emacs makes no attempt to update these variables when the window is resized. Therefore, ncurses assumes the window size is the same when it has actually changed. Note that executing: $ echo $LINES from a bash shell actually doesn't get the LINES environment variable as can be seen with: $ printenv | grep LINES Whenever $LINES is accessed, bash translates this into an ioctl() and returns the result. Therefore, removing these variables shouldn't prevent any shell scripts from accessing these variables. [1]: ncurses/ncurses/tinfo/lib_setup.c (_nc_get_screensize)