[konsole] [Bug 452476] New: Behaviour of ascii control sequences after sixel graphic depends on how much lines were already written before the program started.

Linus Dierheimer bugzilla_noreply at kde.org
Sun Apr 10 19:23:01 BST 2022


https://bugs.kde.org/show_bug.cgi?id=452476

            Bug ID: 452476
           Summary: Behaviour of ascii control sequences after sixel
                    graphic depends on how much lines were already written
                    before the program started.
           Product: konsole
           Version: master
          Platform: Archlinux Packages
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: konsole-devel at kde.org
          Reporter: Linus at Dierheimer.de
  Target Milestone: ---

SUMMARY

If a program outputs a sixel graphic, and then uses ascii control sequences to
move the cursor, the behaviour of cursor up is dependent on how many lines were
already written before the program started.

Cursor up will only work correctly if there were already lines present. To
illustrate this, think of a neofetch like program, that first prints a graphic,
then text right of it.

If the program is started as first line in the whole konsole session, the
output will look like this:
    |-----------|
    |-----------|
    |-----------|
    |-----------|
                    Text 1 
                    Text 2
                    Text 3
                    Text 4

If the program is started after a few lines were printed (some enters before
running it is enough), the output will look like this:
    |-----------|
    |-----------|
    |-----------|   Text 1
    |-----------|   Text 2
                    Text 3
                    Text 4

If the program is started with some lines before it (e.g. run multiple times).
The output will be correct:
    |-----------|   Text 1
    |-----------|   Text 2
    |-----------|   Text 3
    |-----------|   Text 4

Once this specific amount of lines is reached, the output will always be
correct. The amount of lines is dependent on the height of the picture.

I added an example minimal c program (+image) as an attachment, because code is
better than words. Sorry for the dependency on imagemagick. Compile instruction
is at the top of the c file.

STEPS TO REPRODUCE
1.  Compile and run the attached c program
2.  See how the height of the image and the text lines misalign
3.  Run it a few times without clearing
4.  See how the alignment gets better and better until it is correct

OBSERVED RESULT
Alignment wrong in the first few runs

EXPECTED RESULT
Alignment always correct. This type of program output interpretation shouldn't
give different results based on what was written to the console before.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 5.17.1-arch1-1 (64 bit)
KDE Plasma Version: 5.24.4
KDE Frameworks Version: 5.92.0
Qt Version: 5.15.2
Konsole Version: git

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the konsole-devel mailing list