Skip to content

Conversation

@keszybz
Copy link
Contributor

@keszybz keszybz commented May 16, 2025

When scrolling through history with ↑/↓, once a sufficiently long line was shown, the cursor would not be returned to the beginning of the line and a portion of the previous line would be shown.

It turns out that this can be avoided if we wrap the color escape sequences with \1 … \2, which tells the terminal (?) that the sequence is zero-width. (The sequence is for the terminal, but maybe python, or libreadline, is smart enough to take this into account. I'm hazy on the details.)

When scrolling through history with ↑/↓, once a sufficiently long line
was shown, the cursor would not be returned to the beginning of the line
and a portion of the previous line would be shown.

It turns out that this can be avoided if we wrap the color escape sequences
with \1 … \2, which tells the terminal (?) that the sequence is zero-width.
(The sequence is for the terminal, but maybe python, or libreadline, is
smart enough to take this into account. I'm hazy on the details.)
@keszybz keszybz merged commit b9a63eb into ASPP:main Jun 3, 2025
4 checks passed
@keszybz keszybz deleted the color-zero-width branch June 3, 2025 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant