Konsole Backend needs to be updated to handle new xterm features #71

Open
opened 2 years ago by drankin · 3 comments

Basic information

  • R14.0.11:
  • openSUSE/SuSE:
  • amd64:

Feature Request

Description

We need to update the xterm backend as for konsole. The new xterm provides handling for multi-line write that some package managers are using that is not ANSI escape based that opensuse KDE3 hasn't been patched for (and I suspect TDE is in the same boat). pacman (Arch package manager) is doing this now and konsole just kind of provides jittery output on a single line, rather than displaying the progress bar with current progress and total downloaded on separate lines.

This new feature appeared ~6 months ago and Arch updated pacman to use it. I'm not sure whether this is strictly xterm or wide-character related. (konsole handles UTF-8 fine) The actual update is done with wide-char strings Arch pacman callback.c progress draw. The selection of which line to draw on is done with simple ANSI escapes. Code moving multi-line progress bar cursor

Using any new xterm displays the multi-line progress bar correctly, but konsole won't.

I discussed the problem on the Arch list a few months back and mentioned it on tde-devel where J Leslie Turriff suggested I open a feature request. I have another open thread with Arch to drill down on just what konsole is having trouble with and I'll update the issue here when I get more information. (the issue being I'm not completely sure what konsole is stumbling on -- I know what code is causing it, but not why exactly)

Steps to reproduce

  1. open konsole and ssh into any Archlinux system. Do a full system update.
  2. What should be a smooth display of the current package bytes downloaded in a hashed progress bar with the total displayed below is instead somewhat of a jittery mess.

Screenshots

Ironically, when done the screenshot looks okay, this has to do with how konsole displays the output when it is being written.

<!-- This is a comment. Please fill in the required fields below. The comments provide instructions on how to do so. Note: You do not need to remove comments. --> ## Basic information - R14.0.11: <!-- such as R14.0.10 - see tde-config -v --> - openSUSE/SuSE: <!-- such as Debian Buster - see lsb_release -sd --> - amd64: <!-- amd64 / i386 / armhf / ... --> <!-- Use SL/* labels to set the severity level. Please do not set a milestone. --> Feature Request ## Description We need to update the xterm backend as for konsole. The new xterm provides handling for multi-line write that some package managers are using that is not ANSI escape based that opensuse KDE3 hasn't been patched for (and I suspect TDE is in the same boat). pacman (Arch package manager) is doing this now and konsole just kind of provides jittery output on a single line, rather than displaying the progress bar with current progress and total downloaded on separate lines. This new feature appeared ~6 months ago and Arch updated pacman to use it. I'm not sure whether this is strictly xterm or wide-character related. (konsole handles UTF-8 fine) The actual update is done with wide-char strings [Arch pacman callback.c progress draw](https://gitlab.archlinux.org/pacman/pacman/-/blob/master/src/pacman/callback.c#L773). The selection of which line to draw on is done with simple ANSI escapes. [Code moving multi-line progress bar cursor](https://gitlab.archlinux.org/pacman/pacman/-/blob/master/src/pacman/util.c#L1835) Using any new xterm displays the multi-line progress bar correctly, but konsole won't. I discussed the problem on the Arch list a few months back and mentioned it on tde-devel where J Leslie Turriff suggested I open a feature request. I have another open thread with Arch to drill down on just what konsole is having trouble with and I'll update the issue here when I get more information. (the issue being I'm not completely sure what konsole is stumbling on -- I know what code is causing it, but not why exactly) ## Steps to reproduce 1. open konsole and ssh into any Archlinux system. Do a full system update. 2. What should be a smooth display of the current package bytes downloaded in a hashed progress bar with the total displayed below is instead somewhat of a jittery mess. ## Screenshots <!-- If it seems useful, please provide provide one or more screenshots. --> Ironically, when done the screenshot looks okay, this has to do with how konsole displays the output when it is being written.
Owner

Hi David,
is there an easier (== non Arch user) way to simulate this?
What encoding is used in your system? Have you tried different character encoding in Konsole?
Konsole definitely needs some fixing up (there are other issues documented) but I would like to better understand if this is a Konsole issue or a character encoding issue.

Hi David, is there an easier (== non Arch user) way to simulate this? What encoding is used in your system? Have you tried different character encoding in Konsole? Konsole definitely needs some fixing up (there are other issues documented) but I would like to better understand if this is a Konsole issue or a character encoding issue.
Poster

I'm looking for other implementations to test with. But here is another IMPORTANT point. If I use the xterm (xterm-330-lp150.2.8.x86_64) that comes with opensuse 15.0 all works as it is supposed to. But if I use konsole on the same box, the output is jittery.

I think this is the issue. There are new escape codes supported by xterm that are described here. This is what I've been searching for:

From Arch list:

You are missing support for two of those escape codes. Upstream Konsole has them since last year:

https://git.trinitydesktop.org/cgit/tdebase/tree/konsole/konsole/TEmuVt102.cpp?h=r14.0.11#n623

https://git.trinitydesktop.org/cgit/tdebase/tree/konsole/doc/More/ansix364.txt?h=r14.0.11#n34

https://invent.kde.org/utilities/konsole/-/merge_requests/116

The link to the mailing list thread from today is: (arch-genera) pacman 6 current/total not displayed on TDE - what does old konsole lack? (and see the follow-up in thread by Ralph Corderoy). That has a bit of further detail in it, but it appears konsole does not support the F escape and one other.

Honestly, from the TDE tree links, I can't tell if TDE supports the ANSI x3.64 escapes or if that is just a proposal in the tree stashed for later.

I'm looking for other implementations to test with. But here is another IMPORTANT point. If I use the xterm (xterm-330-lp150.2.8.x86_64) that comes with opensuse 15.0 all works as it is supposed to. But if I use konsole on the same box, the output is jittery. I think this is the issue. There are new escape codes supported by xterm that are described here. This is what I've been searching for: From Arch list: You are missing support for two of those escape codes. Upstream Konsole has them since last year: https://git.trinitydesktop.org/cgit/tdebase/tree/konsole/konsole/TEmuVt102.cpp?h=r14.0.11#n623 https://git.trinitydesktop.org/cgit/tdebase/tree/konsole/doc/More/ansix364.txt?h=r14.0.11#n34 https://invent.kde.org/utilities/konsole/-/merge_requests/116 The link to the mailing list thread from today is: [(arch-genera) pacman 6 current/total not displayed on TDE - what does old konsole lack?](https://lists.archlinux.org/pipermail/arch-general/2021-December/049459.html) (and see the follow-up in thread by Ralph Corderoy). That has a bit of further detail in it, but it appears konsole does not support the `F` escape and one other. Honestly, from the TDE tree links, I can't tell if TDE supports the ANSI x3.64 escapes or if that is just a proposal in the tree stashed for later.
Owner

Hi David,
thanks for pointing to the exact point. The missing CNL/CPL escape sequences have been added in the above commits.
Is that all that was needed for this issue? Is there anything else?

Hi David, thanks for pointing to the exact point. The missing CNL/CPL escape sequences have been added in the above commits. Is that all that was needed for this issue? Is there anything else?
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: TDE/tde#71
Loading…
There is no content yet.