* Can we support apt's funky ANSI escapes?
@ 2016-07-20 14:52 Clément Pit--Claudel
2016-07-20 16:33 ` Stefan Monnier
2016-07-20 17:05 ` Robert Weiner
0 siblings, 2 replies; 6+ messages in thread
From: Clément Pit--Claudel @ 2016-07-20 14:52 UTC (permalink / raw)
To: Emacs developers
[-- Attachment #1.1: Type: text/plain, Size: 2098 bytes --]
Hi emacs-devel,
Ubuntu has a new wrapper around apt-get and apt-search called apt. As it runs it displays a progress bar, whose ANSI escapes confuse ‘M-x shell’; here's an example:
Removing libacl1-dev (2.2.52-3) ...
^[7Progress: [ 0%] [................................................................................................] ^[8^[7Progress: [ 25%] [########################........................................................................] ^[8^[7Progress: [ 50%] [################################################................................................] ^[8^[7Progress: [ 75%] [########################################################################........................] ^[8Processing triggers for man-db (2.7.5-1) ...
^[7^[[0;62r^[8^[[1A^[[J
And here's another one:
^[7^[[0;61r^[8^[[1ASelecting previously unselected package libacl1-dev.
(Reading database ... 359142 files and directories currently installed.)
Preparing to unpack .../libacl1-dev_2.2.52-3_amd64.deb ...
^[7Progress: [ 0%] [................................................................................................] ^[8^[7Progress: [ 16%] [#################...............................................................................] ^[8Unpacking libacl1-dev (2.2.52-3) ...
^[7Progress: [ 33%] [#################################...............................................................] ^[8^[7Progress: [ 50%] [################################################................................................] ^[8Processing triggers for man-db (2.7.5-1) ...
Setting up libacl1-dev (2.2.52-3) ...
^[7Progress: [ 66%] [#################################################################...............................] ^[8^[7Progress: [ 83%] [################################################################################................] ^[8
^[7^[[0;62r^[8^[[1A^[[J
Is this a bug that should be fixed on the ‘apt’ side (it shouldn't show the progress bar?), or can we support these escapes?
Clément.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Can we support apt's funky ANSI escapes?
2016-07-20 14:52 Can we support apt's funky ANSI escapes? Clément Pit--Claudel
@ 2016-07-20 16:33 ` Stefan Monnier
2016-07-20 17:05 ` Robert Weiner
1 sibling, 0 replies; 6+ messages in thread
From: Stefan Monnier @ 2016-07-20 16:33 UTC (permalink / raw)
To: emacs-devel
> Is this a bug that should be fixed on the ‘apt’ side (it shouldn't show the
> progress bar?), or can we support these escapes?
Maybe (not sure) we could argue that apt should be more careful before
using such codes, but we can support these escapes, I think, and doing
so would be better for the user.
Stefan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Can we support apt's funky ANSI escapes?
2016-07-20 14:52 Can we support apt's funky ANSI escapes? Clément Pit--Claudel
2016-07-20 16:33 ` Stefan Monnier
@ 2016-07-20 17:05 ` Robert Weiner
2016-07-20 19:38 ` Clément Pit--Claudel
1 sibling, 1 reply; 6+ messages in thread
From: Robert Weiner @ 2016-07-20 17:05 UTC (permalink / raw)
To: Clément Pit--Claudel; +Cc: Emacs developers
[-- Attachment #1: Type: text/plain, Size: 50 bytes --]
What happens if you use {M-x ansi-term RET}?
Bob
[-- Attachment #2: Type: text/html, Size: 370 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Can we support apt's funky ANSI escapes?
2016-07-20 17:05 ` Robert Weiner
@ 2016-07-20 19:38 ` Clément Pit--Claudel
2016-07-22 20:54 ` Matthew Carter
0 siblings, 1 reply; 6+ messages in thread
From: Clément Pit--Claudel @ 2016-07-20 19:38 UTC (permalink / raw)
To: emacs-devel
[-- Attachment #1.1: Type: text/plain, Size: 171 bytes --]
On 2016-07-20 13:05, Robert Weiner wrote:
> What happens if you use {M-x ansi-term RET}?
I guess it would work fine, but I'd rather not use ansi-term, if possible.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Can we support apt's funky ANSI escapes?
2016-07-20 19:38 ` Clément Pit--Claudel
@ 2016-07-22 20:54 ` Matthew Carter
2016-07-22 21:59 ` Clément Pit--Claudel
0 siblings, 1 reply; 6+ messages in thread
From: Matthew Carter @ 2016-07-22 20:54 UTC (permalink / raw)
To: Clément Pit--Claudel; +Cc: emacs-devel
Clément Pit--Claudel <clement.pit@gmail.com> writes:
> On 2016-07-20 13:05, Robert Weiner wrote:
>> What happens if you use {M-x ansi-term RET}?
>
> I guess it would work fine, but I'd rather not use ansi-term, if possible.
>
The ansi-color package has a function, #'ansi-color-apply-on-region
which works well for translating these to colorized font faces (I use it
on some shell output from my own custom functions that include these
escape codes).
--
Matthew Carter (m@ahungry.com)
http://ahungry.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Can we support apt's funky ANSI escapes?
2016-07-22 20:54 ` Matthew Carter
@ 2016-07-22 21:59 ` Clément Pit--Claudel
0 siblings, 0 replies; 6+ messages in thread
From: Clément Pit--Claudel @ 2016-07-22 21:59 UTC (permalink / raw)
To: Matthew Carter; +Cc: emacs-devel
[-- Attachment #1.1: Type: text/plain, Size: 909 bytes --]
On 2016-07-22 16:54, Matthew Carter wrote:
> Clément Pit--Claudel <clement.pit@gmail.com> writes:
>
>> On 2016-07-20 13:05, Robert Weiner wrote:
>>> What happens if you use {M-x ansi-term RET}?
>>
>> I guess it would work fine, but I'd rather not use ansi-term, if possible.
>>
>
> The ansi-color package has a function, #'ansi-color-apply-on-region
> which works well for translating these to colorized font faces (I use it
> on some shell output from my own custom functions that include these
> escape codes).
Hmm, I'm not sure I understand. shell-mode already translates most ANSI escapes to colorized faces, doesn't it?
For example, in emacs -Q, running M-x shell and typing `env TERM=xterm ls --color' gives me properly colored output.
AFAICT, the only thing that's missing is support for the two specific codes (61 and 62) that `apt' is using. Isn't that right?
Clément.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-07-22 21:59 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-20 14:52 Can we support apt's funky ANSI escapes? Clément Pit--Claudel
2016-07-20 16:33 ` Stefan Monnier
2016-07-20 17:05 ` Robert Weiner
2016-07-20 19:38 ` Clément Pit--Claudel
2016-07-22 20:54 ` Matthew Carter
2016-07-22 21:59 ` Clément Pit--Claudel
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.