GNU bug report logs -
#45034
[PATCH] * lisp/simple.el (async-shell-command): use comint-term-environment
Previous Next
Reported by: Alyssa Ross <hi <at> alyssa.is>
Date: Fri, 4 Dec 2020 00:59:02 UTC
Severity: normal
Tags: fixed, patch
Fixed in version 28.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 45034 in the body.
You can then email your comments to 45034 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#45034
; Package
emacs
.
(Fri, 04 Dec 2020 00:59:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Alyssa Ross <hi <at> alyssa.is>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Fri, 04 Dec 2020 00:59:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Even though async-shell-command will open a shell-mode buffer, and
shell-mode inherits from comint-mode, because it doesn't use
comint-exec, comint-term-environment isn't respected. It would make
sense for it to, because since async-shell-command uses comint, any
fancy stuff comint-term-environment enables should work in
async-shell-command too.
With this change, a simple (setq comint-terminfo-terminal "dumb-emacs-ansi")
is all that's required to get colored output from many programs on a
GNU/Linux system with a recent version of ncurses when run through
async-shell-command.
---
lisp/simple.el | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/lisp/simple.el b/lisp/simple.el
index b5ba05426f..dcd619b0ab 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -3783,10 +3783,11 @@ shell-command
(shell-command-save-pos-or-erase)
(setq default-directory directory)
(let ((process-environment
- (if (natnump async-shell-command-width)
- (cons (format "COLUMNS=%d" async-shell-command-width)
- process-environment)
- process-environment)))
+ (append
+ (comint-term-environment)
+ (when (natnump async-shell-command-width)
+ (format "COLUMNS=%d" async-shell-command-width))
+ process-environment)))
(setq proc
(start-process-shell-command "Shell" buffer command)))
(setq mode-line-process '(":%s"))
--
2.27.0
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#45034
; Package
emacs
.
(Fri, 04 Dec 2020 10:08:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 45034 <at> debbugs.gnu.org (full text, mbox):
Alyssa Ross <hi <at> alyssa.is> writes:
> With this change, a simple (setq comint-terminfo-terminal "dumb-emacs-ansi")
> is all that's required to get colored output from many programs on a
> GNU/Linux system with a recent version of ncurses when run through
> async-shell-command.
Thanks; makes sense to me, so I've applied it to Emacs 28 (with some
small changes).
This change was small enough to apply without assigning copyright to the
FSF, but for future patches you want to submit, it might make sense to
get the paperwork started now, so that subsequent patches can be applied
speedily. Would you be willing to sign such paperwork?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Added tag(s) fixed.
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Fri, 04 Dec 2020 10:09:01 GMT)
Full text and
rfc822 format available.
bug marked as fixed in version 28.1, send any further explanations to
45034 <at> debbugs.gnu.org and Alyssa Ross <hi <at> alyssa.is>
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Fri, 04 Dec 2020 10:09:01 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#45034
; Package
emacs
.
(Sat, 05 Dec 2020 11:27:01 GMT)
Full text and
rfc822 format available.
Message #15 received at 45034 <at> debbugs.gnu.org (full text, mbox):
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> Alyssa Ross <hi <at> alyssa.is> writes:
>
>> With this change, a simple (setq comint-terminfo-terminal "dumb-emacs-ansi")
>> is all that's required to get colored output from many programs on a
>> GNU/Linux system with a recent version of ncurses when run through
>> async-shell-command.
>
> Thanks; makes sense to me, so I've applied it to Emacs 28 (with some
> small changes).
This caused an error with:
0. emacs -Q
1. (async-shell-command "true") C-x C-e
I pushed the following fixes to master; let me know if there's anything
wrong with them.
Fix last change to shell-command
e5a18efd3d 2020-12-05 10:45:17 +0000
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=e5a18efd3d96a942c6d6bdc04d0d431165f3138a
Thanks,
--
Basil
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#45034
; Package
emacs
.
(Sun, 06 Dec 2020 13:22:02 GMT)
Full text and
rfc822 format available.
Message #18 received at 45034 <at> debbugs.gnu.org (full text, mbox):
"Basil L. Contovounesios" <contovob <at> tcd.ie> writes:
> This caused an error with:
>
> 0. emacs -Q
> 1. (async-shell-command "true") C-x C-e
>
> I pushed the following fixes to master; let me know if there's anything
> wrong with them.
Thanks; looks good to me. I really thought I'd tested this, but I
tested with `M-x async-shell-command'...
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Mon, 04 Jan 2021 12:24:08 GMT)
Full text and
rfc822 format available.
This bug report was last modified 4 years and 223 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.