In M-x term, try: $ seq 100 $ htop Press 'q' to exit htop. (Instead of 'htop', you could also try with 'emacs -q', 'vi' or any other full-screen TUI program.) Current behaviour: htop overwrites a portion of output from the 'seq' command and htop's contents remain visible on the screen after pressing 'q'. Proposed behaviour (patch attached): avoid overwriting output from the 'seq' command and erase htop's contents after exiting. This is the default behaviour of xterm, st and most other terminal emulators. Best regards.