Bug 407627 - tldr++ output reprints
Summary: tldr++ output reprints
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: emulation (show other bugs)
Version: master
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL: https://github.com/isacikgoz/tldr
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-17 05:01 UTC by tjquillan
Modified: 2022-11-04 00:26 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: v20.08.0


Attachments
konsole vs vte (161.57 KB, image/png)
2019-06-17 08:49 UTC, tcanabrava
Details
attachment-24069-0.html (1.29 KB, text/html)
2019-06-17 13:45 UTC, tcanabrava
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tjquillan 2019-05-17 05:01:18 UTC
SUMMARY:
When using tldr++ (https://github.com/isacikgoz/tldr) in its interactive mode the output reprints in konsole every action.

STEPS TO REPRODUCE
1. Install tldr++
2. Run tldr++ in interactive mode
3. press the up/down arrow and observe results.

OBSERVED RESULT
https://user-images.githubusercontent.com/10000914/57115864-3fda1900-6d06-11e9-976c-4a9ec7c1785a.gif

EXPECTED RESULT
https://github.com/isacikgoz/tldr/raw/master/img/screenplay.gif

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux
(available in About System)
KDE Plasma Version: 5.15.5
KDE Frameworks Version: 5.58.0
Qt Version: 5.12.3

ADDITIONAL INFORMATION
tldr++ Issue: https://github.com/isacikgoz/tldr/issues/12

I tried the above steps in the terminal emulators kitty and tilix and observed the expected results.
Comment 1 tcanabrava 2019-05-17 13:13:44 UTC
Tested against xterm and vte, both have the correct behavior, konsole fails.
@kurt, I have no idea what to do here, it's completely out of my area of expertise, can you point me where to look?
Comment 2 Kurt Hindenburg 2019-06-17 02:36:00 UTC
I'm not clear I see a difference between Konsole and gnome-terminal.
Comment 3 tcanabrava 2019-06-17 08:49:13 UTC
Created attachment 120933 [details]
konsole vs vte

Easy to see the difference. Install tldr++ (not tldr) and run it with an argument, for instance, zip. then just press arrow up / down and you will see the incorrect behavior. In konsole there are newlines, in vte / xterm the lines are correctly overwriten.
Comment 4 Kurt Hindenburg 2019-06-17 13:42:36 UTC
  What Konosle version are you using?  Can you clarify the difference between tldr and tldr++ - I only see tldr in the github listed.

I would guess they are using an xterm/term command to clear portions of the screen which Konsole is not handling correctly.
Comment 5 tcanabrava 2019-06-17 13:45:24 UTC
Created attachment 120947 [details]
attachment-24069-0.html

Im using master Kurt. As I compile daily :) tldr is the "main"
implementation, tldr++ is another approach written in go:

https://github.com/isacikgoz/tldr


Em seg, 17 de jun de 2019 às 15:42, Kurt Hindenburg <
bugzilla_noreply@kde.org> escreveu:

> https://bugs.kde.org/show_bug.cgi?id=407627
>
> --- Comment #4 from Kurt Hindenburg <kurt.hindenburg@gmail.com> ---
>   What Konosle version are you using?  Can you clarify the difference
> between
> tldr and tldr++ - I only see tldr in the github listed.
>
> I would guess they are using an xterm/term command to clear portions of the
> screen which Konsole is not handling correctly.
>
> --
> You are receiving this mail because:
> You are the assignee for the bug.
Comment 6 Mariusz Glebocki 2019-06-19 00:51:20 UTC
Some sequences for cursor movement from `man console_codes` do not work in Konsole. I remember save/restore cursor position (e[7, e[8) being one of them. The problem looks like an effect of absence of these sequences. The cursor should be moved to message's origin, a new message should be printed, overwriting the old one. Cursor is not moved, so new message is printed where the cursor was (at the end of previous message).
Comment 7 ninjalj 2022-11-04 00:26:38 UTC
Fixed a couple of years ago by adding support for CPL (Cursor to Previous Line).  Old versions of tldr++ (e.g. 72ad2f55b663667e8506b92e647c166cf77b60c0) used a bunch of CPL + EL (Erase Line) to clear the portion of the display that tldr++ uses on each UP/DOWN key press.