From 3c9bdf3e1b72a5824ae833440647a9434fbeb5ed Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 2 Apr 2021 12:44:22 -0400 Subject: [PATCH] Fix ECH behavior ECH deletes specified number of characters right of the cursor. The clearline function however takes an absolute position, so the handler needed to add the current cursor. --- tmt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmt.c b/tmt.c index 7ace141..a6a8085 100644 --- a/tmt.c +++ b/tmt.c @@ -297,7 +297,7 @@ handlechar(TMT *vt, char i) DO(S_ARG, "P", dch(vt)) DO(S_ARG, "S", scrup(vt, 0, P1(0))) DO(S_ARG, "T", scrdn(vt, 0, P1(0))) - DO(S_ARG, "X", clearline(vt, l, c->c, P1(0))) + DO(S_ARG, "X", clearline(vt, l, c->c, P1(0) + c->c)) DO(S_ARG, "Z", while (c->c && t[--c->c].c != L'*')) DO(S_ARG, "b", rep(vt)); DO(S_ARG, "c", CB(vt, TMT_MSG_ANSWER, "\033[?6c"))