Summary: | Background Color Erase: bce madness when line too long | ||
---|---|---|---|
Product: | [Applications] konsole | Reporter: | rockandska <yoann_mac_donald> |
Component: | emulation | Assignee: | Konsole Developer <konsole-devel> |
Status: | CONFIRMED --- | ||
Severity: | normal | CC: | justin.zobel, ninjalj, perdrive, yoann_mac_donald |
Priority: | NOR | ||
Version: | 17.12.3 | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | bce konsole background repeat when scrolling |
Description
rockandska
2018-08-22 18:44:23 UTC
Confirmed with konsole from git master. However this is just applications or scripts not putting in a reset \e[0m type character in right? IMO it is not related. In the example provided, there is a reset sequence at the end of the prompt. Confirmed. UP.
I have a related bug so instead of opening a new one, I'll try updating it to give it visibility. And I think they have the same origin.
To me the bug lies in the calculations of the prompt size as it incorporates control characters which should not be taken into account.
So, the way to reproduce it is way simpler than in the original submission:
Step one: create a color prompt such as:
> PS1='${debian_chroot:+($debian_chroot)}\033[93m\u@\h:\w\033[0m > '
Step two: trigger a bug.
press page up to call last cmd in history.
Then press End. This step is not necessary but it makes the bug occur 100% of times.
Press Home to reach beginning of line. It doesnt.
Press End to reach end of line. It goes past that.
Note that in both cases (beginning & end of line), the offset is 9 characters, which corresponds to the number of invisible chars in var PS1, with \033 being 1 char.
Other side effect : overwriting current line instead of creating a new one when command longer than konsole width.
Fiddling with konsole window width shorter than the current command does strange things to the cursor position.
(In reply to Per Drive from comment #4) > UP. > I have a related bug so instead of opening a new one, I'll try updating it > to give it visibility. And I think they have the same origin. > > To me the bug lies in the calculations of the prompt size as it incorporates > control characters which should not be taken into account. > > So, the way to reproduce it is way simpler than in the original submission: > > Step one: create a color prompt such as: > > PS1='${debian_chroot:+($debian_chroot)}\033[93m\u@\h:\w\033[0m > ' Terminal control sequences in PS1 should be enclosed between \[ and \], as in: PS1='${debian_chroot:+($debian_chroot)}\[\033[93m\]\u@\h:\w\[\033[0m\] > ' so bash can keep a correct idea of where the cursor is. See https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#Controlling-the-Prompt Sorry for my "bug"; Thank you for the explanation and link. |