unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lin Sun <sunlin7.mail@gmail.com>
To: 70691@debbugs.gnu.org
Subject: bug#70691: 30.0.50; [PATCH] Eshell's TERM env varible use eshell-term-name as default
Date: Wed, 1 May 2024 06:40:25 +0000	[thread overview]
Message-ID: <CABCREdq_VzV=MdmzU7Pta+5aoDqK_Z7gxrkYARa8vm9V3Mmh9A@mail.gmail.com> (raw)

[-- 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


             reply	other threads:[~2024-05-01  6:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-01  6:40 Lin Sun [this message]
2024-05-01 12:15 ` bug#70691: 30.0.50; [PATCH] Eshell's TERM env varible use eshell-term-name as default 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CABCREdq_VzV=MdmzU7Pta+5aoDqK_Z7gxrkYARa8vm9V3Mmh9A@mail.gmail.com' \
    --to=sunlin7.mail@gmail.com \
    --cc=70691@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).