]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve discoverability of using dumb-emacs-ansi terminal type
authorSean Whitton <spwhitton@spwhitton.name>
Wed, 25 Jun 2025 15:21:49 +0000 (16:21 +0100)
committerEshel Yaron <me@eshelyaron.com>
Wed, 23 Jul 2025 19:18:20 +0000 (21:18 +0200)
* doc/emacs/misc.texi (Interactive Shell, Shell Options):
* lisp/comint.el (comint-terminfo-terminal): Mention setting
comint-terminfo-terminal to "dumb-emacs-ansi" when the system's
terminfo database contains a definition for that terminal type.

(cherry picked from commit d05b59c8be5f350497ca142bc94ade23c568ad15)

doc/emacs/misc.texi
lisp/comint.el

index 910df0ce696d982cc2accd994d31333863a3e8f9..ad47dfa49f44bcf483b422f6d24ddfb1c154331f 100644 (file)
@@ -985,6 +985,10 @@ from.  For example, if you use bash, the file sent to it is
 @file{~/.emacs_bash}.  If this file is not found, Emacs tries with
 @file{~/.emacs.d/init_@var{shellname}.sh}.
 
+  You can enable colorized output for many commands by customizing the
+variable @code{comint-terminfo-terminal} to the value
+@samp{"dumb-emacs-ansi"} (@pxref{Shell Options}).
+
   To specify a coding system for the shell, you can use the command
 @kbd{C-x @key{RET} c} immediately before @kbd{M-x shell}.  You can
 also change the coding system for a running subshell by typing
@@ -1568,13 +1572,15 @@ underlying shell, of course.
 @vindex system-uses-terminfo
 @vindex TERM@r{, environment variable, in sub-shell}
 Comint mode sets the @env{TERM} environment variable to a safe default
-value, but this value disables some useful features.  For example,
-color is disabled in applications that use @env{TERM} to determine if
-color is supported.  Therefore, Emacs provides an option
-@code{comint-terminfo-terminal} to let you choose a terminal with more
-advanced features, as defined in your system's terminfo database.
-Emacs will use this option as the value for @env{TERM} so long as
-@code{system-uses-terminfo} is non-@code{nil}.
+value, but this disables some useful features.  For example, colorized
+output is disabled in applications that use @env{TERM} to determine
+whether color is supported.  If the terminfo database on your system
+contains a definition for the @samp{"dumb-emacs-ansi"} terminal type (as
+all recent versions of terminfo do), you can enable advanced terminal
+features, including color, by customizing the option
+@code{comint-terminfo-terminal} to @samp{"dumb-emacs-ansi"}.  Emacs will
+use @code{comint-terminfo-terminal} as the value for @env{TERM} so long
+as @code{system-uses-terminfo} is non-@code{nil}.
 
 Both @code{comint-terminfo-terminal} and @code{system-uses-terminfo}
 can be declared as connection-local variables to adjust these options
index 7bb90d76f0800ee05729cf804a51f5dfa10492f3..d343f1d57861a8626125b163b32e935cb1971190 100644 (file)
@@ -523,8 +523,14 @@ executed once, when the buffer is created."
   :group 'comint)
 
 (defcustom comint-terminfo-terminal "dumb"
-  "Value to use for TERM when the system uses terminfo."
-  :type 'string
+  "Value to use for TERM when the system uses terminfo.
+If the system's terminfo database contains a definition for the
+\"dumb-emacs-ansi\" terminal (as all recent versions of terminfo do),
+set this to \"dumb-emacs-ansi\" and then some terminfo-aware programs
+will send colorized output when run under Comint."
+  :type '(choice (const "dumb")
+                 (const "dumb-emacs-ansi")
+                 string)
   :group 'comint
   :version "26.1")