Skip to content

Rework the logic of Screen::emulateUpDown()

Matan Ziv-Av requested to merge matan/konsole:fix-emulateUpDown2 into master

!951 (merged) exposed some bugs in the code used to emulate up/down/mouse click for bash. This MR reworks the code to be less 'hacky', and also adds a few bounds checks.

In sendKeyEvent() Stop processing the up/down event in case they are emulated. emulateUpDown() accept number of rows to go up down, rather than only going one row at a time. This simplifies sendMouseEvent().

While working on this code, I also implemented the expected column behaviour in up/down emulation. When moving the cursor a few lines up/down consequently remain in the same column even if some intermediate lines are too short.

Merge request reports