Summary: | Corruption of screen when using ncurses when terminal resized depending on line content | ||
---|---|---|---|
Product: | [Applications] konsole | Reporter: | Nick <nick.craig.law> |
Component: | general | Assignee: | Konsole Developer <konsole-devel> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | nate, ninjalj, solerman |
Priority: | NOR | ||
Version: | 20.12.1 | ||
Target Milestone: | --- | ||
Platform: | Neon | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/utilities/konsole/commit/7e0d300c2d08e8429b0e1997d07ce543c186767d | Version Fixed In: | 21.08 |
Attachments: |
Corruption shown in last line to the right of text
Corruption shown in last line, whole line should be light coloured |
Description
Nick
2021-02-08 22:08:28 UTC
Created attachment 135522 [details]
Corruption shown in last line, whole line should be light coloured
nwipe does the following to write the last line: SYS_write(1, "mq\033[98bj\033(B\033(B\033[m\033[39;49m\033[97m\033[40m\033[21;12H\033(0\033[0m\033[37m\033[44m", 60) = 60 SYS_write(1, "\033(B\033[0m\033[34m\033[47m\033[1K ", 22) = 22 SYS_write(1, "S=Start M=Method P=PRNG V=Verify R=Rounds B=Blanking Space=Select Ctrl-C=Quit\033[K\033[7;61H", 87) = 87 SYS_write(1, "\033(B\033[m\033[39;49m\033[97m\033[40m", 24) = 24 Notice that after printing "S=Start...", it clears to the end of line (CSI K). and then, when pressing M to select a Method: SYS_write(1, "\033[21;24H", 8) = 8 SYS_write(1, "\033[34m\033[47m\033[1K\t", 15) = 15 SYS_write(1, "J=Down K=Up Space=Select Backspace=Cancel", 41) = 41 SYS_write(1, "\033[12P\033[21;78H", 13) = 13 SYS_write(1, "\033(B\033[m\033[39;49m\033[97m\033[40m", 24) = 24 so, it positions the cursor in the middle of the previous "S=Start..." status message, clears to the beginning of line (CSI 1 K), writes the new "J=Down..." message, and deletes 12 characters (CSI 12 P). The bug appears because Konsole doesn't shrink lines when resizing (it just set a variable _columns to the maximum column available), and CSI K (Erase Line) just clears until _columns. Then when nwipe sends a CSI P (Delete CHaracters) request, which deletes some characters in the middle of the last line, characters from beyond _columns reappear. A possibly relevant merge request was started @ https://invent.kde.org/utilities/konsole/-/merge_requests/427 Git commit ed7fe4a2cbb8f4fc178ae83431f0190c92d39ba2 by Tomaz Canabrava, on behalf of Luis Javier Merino Morán. Committed on 16/07/2021 at 10:55. Pushed by tcanabrava into branch 'master'. Resize lines when clearing to end of line. clearImage() just clears until _columns. To prevent characters from beyond _columns from reappearing, e.g. due to DCH (Delete CHaracters) requests, make clearImage() resize lines when clearing to the end of line. M +4 -0 src/Screen.cpp https://invent.kde.org/utilities/konsole/commit/ed7fe4a2cbb8f4fc178ae83431f0190c92d39ba2 Git commit 7e0d300c2d08e8429b0e1997d07ce543c186767d by Kurt Hindenburg, on behalf of Luis Javier Merino Morán. Committed on 19/07/2021 at 22:40. Pushed by hindenburg into branch 'release/21.08'. Resize lines when clearing to end of line. clearImage() just clears until _columns. To prevent characters from beyond _columns from reappearing, e.g. due to DCH (Delete CHaracters) requests, make clearImage() resize lines when clearing to the end of line. (cherry picked from commit ed7fe4a2cbb8f4fc178ae83431f0190c92d39ba2) M +4 -0 src/Screen.cpp https://invent.kde.org/utilities/konsole/commit/7e0d300c2d08e8429b0e1997d07ce543c186767d |