After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 759146 - Bad cursor position after escape sequence resize
Bad cursor position after escape sequence resize
Status: RESOLVED OBSOLETE
Product: vte
Classification: Core
Component: general
git master
Other Linux
: Normal minor
: ---
Assigned To: VTE Maintainers
VTE Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-12-07 22:16 UTC by Egmont Koblinger
Modified: 2021-06-10 15:08 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Egmont Koblinger 2015-12-07 22:16:04 UTC
./src/vte-2.91

./src/window 8 23 80
  (or, equivalent)
echo -ne '\e[8;23;80t'

Notice that the cursor doesn't advance to the next line. (Requires that the window is actually resized, you don't "change" the size to the already existing one.)

Only happens as long as you haven't reached the bottom of the screen.

Doesn't happen with any of these:

sleep 0.01; ./src/window 8 23 80
echo -n a; ./src/window 8 23 80
echo -ne 'a\e[8;23;80t'

Broke somewhere in the 0.37 series.
Comment 1 Egmont Koblinger 2015-12-11 20:30:48 UTC
If there's a pause then this happens:

In vte_terminal_process_incoming(), processing the newline marks that the contents changed (sets "modified = TRUE"), and later the "if (modified)" branch does whatever it needs to do: calls _vte_terminal_update_insert_delta() which in turn calls vte_terminal_insert_rows() -> _vte_terminal_ring_append() -> _vte_terminal_ring_insert() -> _vte_ring_insert() -> this somehow adds another row to the ring.

After the pause, vte_terminal_process_incoming() processes the escape sequence which properly resizes the window.

Without the pause this happens:

The resize escape sequence is processed right after processing the newline ("modified" is already set to TRUE) but _before_ the "if (modified)" branch is reached, hence before another row is added to the ring.

vte_terminal_set_size() near its end CLAMPs terminal->pvt->cursor.row to be within the ring's area, which ring hasn't been extended yet.

---

It's yet another of those cases where addressing bug 747175 would make our lives so much simpler... this bug couldn't have happened then.

Possible quick hacks to fix it: revise the CLAMP, or on cursor down ensure that the row is in the ring. Or just wait until we get to address 747175.
Comment 2 GNOME Infrastructure Team 2021-06-10 15:08:29 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/vte/-/issues/2258.