Fix cursor advancement in last column
ClosedPublic

Authored by mglb on Apr 26 2018, 9:56 PM.

Details

Summary

Until now, the cursor was moved from last column to the next column
outside the screen. Since screen array is linear, it partially worked
like it was on the beginning of a next line (as long as it was not the
last line).

Test Plan
  • Run cat > /dev/null (shells do their own line wrapping, so will not work)
  • Move cursor to terminal's last visible line using enter
  • Move cursor to terminal's last visible column by typing something
  • Type one more character

Expected result: new line should appear with the cursor on the beginning
Actual result: cursor disappears, no new line

  • Turn on blinking cursor
  • Run cat > /dev/null
  • Move cursor to terminal's last visible column by typing something
  • Type one more character

Expected result: the cursor should move to new line's first column
and blink
Actual result: the cursor "moves" but does not blink

Diff Detail

Repository
R319 Konsole
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
mglb requested review of this revision.Apr 26 2018, 9:56 PM
mglb created this revision.
mglb edited the test plan for this revision. (Show Details)Apr 26 2018, 10:40 PM

confirmed the issue and this fix it; however now I get an extra %<return> above my command line prompt now. It appears only to happen w/ zsh; with bash it works as expected.

example:
%
prompt here>

mglb added a comment.May 10 2018, 1:01 AM

Ok, this is a bug in my code.

On xterm, linux (and vt100 apparently) when the cursor is in the last empty column and a character is typed, the character is inserted and the cursor does not move. Typing in next character inserts new line and the character.
After inserting a character into the last column (case when the cursor does not move), the backspace key removes the character in second to last column, leaving the last column without changes. A bit unintuitive behavior, but vt100 did it so we should too. From emulators which handle backspace in more expected way I know at least tmux.

Going to fix it.

mglb updated this revision to Diff 34086.May 13 2018, 11:55 PM
  • Algorithm change removed - it is actually consistent with xterm and linux console.
  • Added cursor X position bounding in Screen external interface - again, to match xterm and linux console.
  • Updated description.
Restricted Application added a subscriber: konsole-devel. · View Herald TranscriptMay 13 2018, 11:55 PM
mglb edited the test plan for this revision. (Show Details)May 13 2018, 11:57 PM
hindenburg accepted this revision.May 14 2018, 2:46 PM

THanks

This revision is now accepted and ready to land.May 14 2018, 2:46 PM
This revision was automatically updated to reflect the committed changes.