all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#35129: Unsupported escape sequences for progress in shell
@ 2019-04-03 20:27 Juri Linkov
  2019-04-04 20:36 ` Juri Linkov
  0 siblings, 1 reply; 7+ messages in thread
From: Juri Linkov @ 2019-04-03 20:27 UTC (permalink / raw)
  To: 35129

Some escape sequences are unhandled in shell mode.
Most often they appear when running `apt install'
that shows its progress bar that is supposed to stay
on the same line, but spreads over several lines,
so the output looks like a mess (where ^[7 and ^[8
are escape sequences currently still unhandled):

  debconf: unable to initialize frontend: Dialog
  debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)
  debconf: falling back to frontend: Readline
  ^[7Progress: [  0%] [................................................................................................] ^[8
  ^[7Progress: [  6%] [######..........................................................................................] ^[8
  ^[7Progress: [ 13%] [############....................................................................................] ^[8
  ^[7Progress: [ 19%] [##################..............................................................................] ^[8
  ^[7Progress: [ 25%] [########################........................................................................] ^[8
  ^[7Progress: [ 31%] [##############################..................................................................] ^[8
  ^[7Progress: [ 38%] [####################################............................................................] ^[8
  ^[7Progress: [ 44%] [##########################################......................................................] ^[8
  ^[7Progress: [ 50%] [################################################................................................] ^[8
  ^[7Progress: [ 56%] [######################################################..........................................] ^[8
  ^[7Progress: [ 63%] [############################################################....................................] ^[8
  ^[7Progress: [ 69%] [##################################################################..............................] ^[8
  ^[7Progress: [ 75%] [########################################################################........................] ^[8
  ^[7Progress: [ 81%] [##############################################################################..................] ^[8
  ^[7Progress: [ 88%] [####################################################################################............] ^[8
  ^[7Progress: [ 94%] [##########################################################################################......] ^[8

I'm making this report because escape sequences for colors are handled fine,
and visually these indicators have the green background.





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

* bug#35129: Unsupported escape sequences for progress in shell
  2019-04-03 20:27 bug#35129: Unsupported escape sequences for progress in shell Juri Linkov
@ 2019-04-04 20:36 ` Juri Linkov
  2019-04-05  7:08   ` Michael Albinus
  0 siblings, 1 reply; 7+ messages in thread
From: Juri Linkov @ 2019-04-04 20:36 UTC (permalink / raw)
  To: 35129

> Some escape sequences are unhandled in shell mode.
> Most often they appear when running `apt install'
> that shows its progress bar that is supposed to stay
> on the same line, but spreads over several lines,
> so the output looks like a mess (where ^[7 and ^[8
> are escape sequences currently still unhandled):

After more research, I found an interesting post
https://oremacs.com/2019/03/24/shell-apt/
that proposes a promising way to handle
these escape sequences.

So maybe this should be customizable?





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

* bug#35129: Unsupported escape sequences for progress in shell
  2019-04-04 20:36 ` Juri Linkov
@ 2019-04-05  7:08   ` Michael Albinus
  2019-04-06 20:53     ` Juri Linkov
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Albinus @ 2019-04-05  7:08 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 35129

Juri Linkov <juri@linkov.net> writes:

Hi Juri,

>> Some escape sequences are unhandled in shell mode.
>> Most often they appear when running `apt install'
>> that shows its progress bar that is supposed to stay
>> on the same line, but spreads over several lines,
>> so the output looks like a mess (where ^[7 and ^[8
>> are escape sequences currently still unhandled):
>
> After more research, I found an interesting post
> https://oremacs.com/2019/03/24/shell-apt/
> that proposes a promising way to handle
> these escape sequences.
>
> So maybe this should be customizable?

Looks interesting. However, we have `progress-reporter'. The code from
above shall be made available via this.

This would also improve Tramp; there are requests to integrate the
progress reporter from external commands.

Best regards, Michael.





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

* bug#35129: Unsupported escape sequences for progress in shell
  2019-04-05  7:08   ` Michael Albinus
@ 2019-04-06 20:53     ` Juri Linkov
  2019-04-07  8:46       ` Michael Albinus
  0 siblings, 1 reply; 7+ messages in thread
From: Juri Linkov @ 2019-04-06 20:53 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 35129

>>> Some escape sequences are unhandled in shell mode.
>>> Most often they appear when running `apt install'
>>> that shows its progress bar that is supposed to stay
>>> on the same line, but spreads over several lines,
>>> so the output looks like a mess (where ^[7 and ^[8
>>> are escape sequences currently still unhandled):
>>
>> After more research, I found an interesting post
>> https://oremacs.com/2019/03/24/shell-apt/
>> that proposes a promising way to handle
>> these escape sequences.
>>
>> So maybe this should be customizable?
>
> Looks interesting. However, we have `progress-reporter'. The code from
> above shall be made available via this.

I'm not sure if we can provide min-value/max-value for
make-progress-reporter.  If not, then it uses spinning/pulsing.
It seems progress-reporter doesn't support arbitrary strings
such as that come from underlying process like ^[7Progress: [ 0%]^[8

> This would also improve Tramp; there are requests to integrate the
> progress reporter from external commands.

Could you show an example of a progress reporter from an external command.
Do they use arbitrary strings?





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

* bug#35129: Unsupported escape sequences for progress in shell
  2019-04-06 20:53     ` Juri Linkov
@ 2019-04-07  8:46       ` Michael Albinus
  2019-04-07 20:05         ` Juri Linkov
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Albinus @ 2019-04-07  8:46 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 35129

Juri Linkov <juri@linkov.net> writes:

Hi Juri,

>> Looks interesting. However, we have `progress-reporter'. The code from
>> above shall be made available via this.
>
> I'm not sure if we can provide min-value/max-value for
> make-progress-reporter.  If not, then it uses spinning/pulsing.
> It seems progress-reporter doesn't support arbitrary strings
> such as that come from underlying process like ^[7Progress: [ 0%]^[8

progress-reporter should be improved to accept also strings like "45%"
to be displayed literally.

>> This would also improve Tramp; there are requests to integrate the
>> progress reporter from external commands.
>
> Could you show an example of a progress reporter from an external command.
> Do they use arbitrary strings?

Some scp or pscp versions do it. For example:

--8<---------------cut here---------------start------------->8---
$ pscp -v localhost:/net/ford/Multimedia/Eigene\ Videos/Videos/20150829_145255.mp4 /tmp/foo
[...]
foo                       | 203369 kB | 5810.6 kB/s | ETA: 00:00:00 | 84%
--8<---------------cut here---------------end--------------->8---

Best regards, Michael.





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

* bug#35129: Unsupported escape sequences for progress in shell
  2019-04-07  8:46       ` Michael Albinus
@ 2019-04-07 20:05         ` Juri Linkov
  2019-04-08  7:36           ` Michael Albinus
  0 siblings, 1 reply; 7+ messages in thread
From: Juri Linkov @ 2019-04-07 20:05 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 35129

>>> Looks interesting. However, we have `progress-reporter'. The code from
>>> above shall be made available via this.
>>
>> I'm not sure if we can provide min-value/max-value for
>> make-progress-reporter.  If not, then it uses spinning/pulsing.
>> It seems progress-reporter doesn't support arbitrary strings
>> such as that come from underlying process like ^[7Progress: [ 0%]^[8
>
> progress-reporter should be improved to accept also strings like "45%"
> to be displayed literally.

Another problem is that there is no clear moment to start/stop
progress-reporter with calls to make-progress-reporter and
progress-reporter-done.

>>> This would also improve Tramp; there are requests to integrate the
>>> progress reporter from external commands.
>>
>> Could you show an example of a progress reporter from an external command.
>> Do they use arbitrary strings?
>
> Some scp or pscp versions do it. For example:
>
> $ pscp -v localhost:/net/ford/Multimedia/Eigene\ Videos/Videos/20150829_145255.mp4 /tmp/foo
> [...]
> foo                       | 203369 kB | 5810.6 kB/s | ETA: 00:00:00 | 84%

Progress on copying large files would be needed for local file operations
as well.





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

* bug#35129: Unsupported escape sequences for progress in shell
  2019-04-07 20:05         ` Juri Linkov
@ 2019-04-08  7:36           ` Michael Albinus
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Albinus @ 2019-04-08  7:36 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 35129

Juri Linkov <juri@linkov.net> writes:

Hi Juri,

>>> I'm not sure if we can provide min-value/max-value for
>>> make-progress-reporter.  If not, then it uses spinning/pulsing.
>>> It seems progress-reporter doesn't support arbitrary strings
>>> such as that come from underlying process like ^[7Progress: [ 0%]^[8
>>
>> progress-reporter should be improved to accept also strings like "45%"
>> to be displayed literally.
>
> Another problem is that there is no clear moment to start/stop
> progress-reporter with calls to make-progress-reporter and
> progress-reporter-done.

At least for my use case, calling external p?scp commands in Tramp,
there is no problem. But in general you might be right.

>>> Could you show an example of a progress reporter from an external command.
>>> Do they use arbitrary strings?
>>
>> Some scp or pscp versions do it. For example:
>>
>> $ pscp -v localhost:/net/ford/Multimedia/Eigene\ Videos/Videos/20150829_145255.mp4 /tmp/foo
>> [...]
>> foo                       | 203369 kB | 5810.6 kB/s | ETA: 00:00:00 | 84%
>
> Progress on copying large files would be needed for local file operations
> as well.

Yes. But local copying is not implemented via external commands; this
needs another progress reporter call.

Best regards, Michael.





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

end of thread, other threads:[~2019-04-08  7:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-03 20:27 bug#35129: Unsupported escape sequences for progress in shell Juri Linkov
2019-04-04 20:36 ` Juri Linkov
2019-04-05  7:08   ` Michael Albinus
2019-04-06 20:53     ` Juri Linkov
2019-04-07  8:46       ` Michael Albinus
2019-04-07 20:05         ` Juri Linkov
2019-04-08  7:36           ` Michael Albinus

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.