Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disable lazy cursor operations in WezTerm as it does not support them #2089

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 16 additions & 0 deletions WinPort/src/Backend/TTY/TTYOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,15 @@ void TTYOutput::ChangeCursor(bool visible, bool force)
void TTYOutput::MoveCursorStrict(unsigned int y, unsigned int x)
{
// ESC[#;#H Moves cursor to line #, column #

const char *tp = getenv("TERM_PROGRAM");
if (tp && strcasecmp(tp, "WezTerm") == 0) {
Format(ESC "[%d;%dH", y, x);
_cursor.x = x;
_cursor.y = y;
return;
}

if (x == 1) {
if (y == 1) {
Write(ESC "[H", 3);
Expand All @@ -412,6 +421,13 @@ void TTYOutput::MoveCursorStrict(unsigned int y, unsigned int x)

void TTYOutput::MoveCursorLazy(unsigned int y, unsigned int x)
{
// workaround for https://github.com/elfmz/far2l/issues/1889
const char *tp = getenv("TERM_PROGRAM");
if (tp && strcasecmp(tp, "WezTerm") == 0) {
MoveCursorStrict(y, x);
return;
}

if (_cursor.y != y && _cursor.x != x) {
MoveCursorStrict(y, x);

Expand Down