unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#70691: 30.0.50; [PATCH] Eshell's TERM env varible use eshell-term-name as default
@ 2024-05-01  6:40 Lin Sun
  2024-05-01 12:15 ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Lin Sun @ 2024-05-01  6:40 UTC (permalink / raw)
  To: 70691

[-- Attachment #1: Type: text/plain, Size: 479 bytes --]

Hi,

Since emacs-29 the Eshell has been enhanced for the ansi-color a lot.
And the function `eshell-exec-visual` can support the executables with
colors, eg VIM, tmux...
I have tested the "/bin/ls --color=tty", "/bin/grep --color=tty" ...
and other executables in Eshell with "export TERM=eshell-color", they
all work great.

So we can safely export eshell's "TERM" with `eshell-term-name` to
support executables with colors.
I attached the patch, please help review it. Thanks.

[-- Attachment #2: 0001-Eshell-s-TERM-env-varible-use-eshell-term-name-as-de.patch --]
[-- Type: text/x-patch, Size: 2228 bytes --]

From 5a43430e88e414a798923d882eff7c3b7cb86c1c Mon Sep 17 00:00:00 2001
From: Lin Sun <sunlin7@hotmail.com>
Date: Wed, 1 May 2024 06:55:23 +0000
Subject: [PATCH] Eshell's TERM env varible use eshell-term-name as default

* lisp/eshell/esh-var.el (eshell-variable-aliases-list):
  Initialize the TERM environment variable with eshell-term-name.
* doc/misc/eshell.texi: Document for TERM environment variable.
* etc/NEWS: Add entry in NEWS file.
---
 doc/misc/eshell.texi   | 5 +++++
 etc/NEWS               | 4 ++++
 lisp/eshell/esh-var.el | 1 +
 3 files changed, 10 insertions(+)

diff --git a/doc/misc/eshell.texi b/doc/misc/eshell.texi
index 30c85da795..07611c49ef 100644
--- a/doc/misc/eshell.texi
+++ b/doc/misc/eshell.texi
@@ -1456,6 +1456,11 @@ Variables
 @code{comint-pager} if non-@code{nil}; otherwise, it uses the value of
 @code{$PAGER} from the @code{process-environment}.
 
+@vindex $TERM
+@item $TERM
+This variable indicates the terminal type of the eshell.  Its default
+value is @code{eshell-term-name}.
+
 @end table
 
 @xref{Aliases}, for the built-in variables @samp{$*}, @samp{$1},
diff --git a/etc/NEWS b/etc/NEWS
index 4b0106fcb0..5ebc5172f6 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -864,6 +864,10 @@ command passed as arguments to 'env'.  If you pass any initial
 arguments of the form 'VAR=VALUE', 'env' will first set 'VAR' to
 'VALUE' before running the command.
 
++++
+*** Eshell's 'TERM' env var uses 'eshell-term-name' as default.
+The eshell's 'TERM' environment variable uses 'eshell-term-name' as default.
+
 ---
 *** Eshell's 'umask' command now supports setting the mask symbolically.
 Now, you can pass an argument like "u+w,o-r" to Eshell's 'umask'
diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el
index 02b5c78562..8dd8a84da8 100644
--- a/lisp/eshell/esh-var.el
+++ b/lisp/eshell/esh-var.el
@@ -161,6 +161,7 @@ eshell-variable-aliases-list
   `(;; for eshell.el
     ("COLUMNS" ,(lambda () (window-body-width nil 'remap)) t t)
     ("LINES" ,(lambda () (window-body-height nil 'remap)) t t)
+    ("TERM" eshell-term-name t)
     ("INSIDE_EMACS" eshell-inside-emacs t)
     ("PAGER" (,(lambda () (or comint-pager (getenv "PAGER")))
               . ,(lambda (_ value)
-- 
2.20.5


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-05-02  6:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-01  6:40 bug#70691: 30.0.50; [PATCH] Eshell's TERM env varible use eshell-term-name as default Lin Sun
2024-05-01 12:15 ` Eli Zaretskii
2024-05-01 15:51   ` Lin Sun
2024-05-01 18:19   ` Jim Porter
2024-05-01 19:37     ` Lin Sun
2024-05-01 19:49       ` Lin Sun
2024-05-02  6:07       ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).