4.1 Visual Commands

If you try to run programs from within Eshell that are not line-oriented, such as programs that use ncurses, you will just get garbage output, since the Eshell buffer is not a terminal emulator. Eshell solves this problem by running such programs in Emacs’s terminal emulator.

Programs that need a terminal to display output properly are referred to in this manual as “visual commands”, because they are not simply line-oriented. You must tell Eshell which commands are visual, by adding them to eshell-visual-commands; for commands that are visual for only certain sub-commands – e.g., ‘git log’ but not ‘git status’ – use eshell-visual-subcommands; and for commands that are visual only when passed certain options, use eshell-visual-options.

Caution: Some tools such as Git use the pager ‘less’ by default to paginate their output but call it with its ‘-F’ option. This option causes ‘less’ to echo the output instead of paginating it if the output is less than one page long. This causes undesirable behavior if, e.g., ‘git diff’, is defined as a visual subcommand. It’ll work if the output is big enough and fail if it is less than one page long. If that occurs to you, search for configuration options for calling ‘less’ without the ‘-F’ option. For Git, you can do that using ‘git config --global core.pager 'less -+F'’.

If you want the buffers created by visual programs killed when the program exits, customize the variable eshell-destroy-buffer-when-process-dies to a non-nil value; the default is nil.