From 9c0a4d8cd6d4abee680909ca5db7575012a6815b Mon Sep 17 00:00:00 2001 From: "Avi Halachmi (:avih)" Date: Thu, 20 Jul 2023 23:15:43 +0300 Subject: win32: use inc_cursor regardless of VT mode Commit 8ade494 added VT input support and, among others, disabled inc_cursor (in favor of the upstream busybox code) when the terminal has VT input enabled. However, inc_cursor works correctly regardless of the VT mode, and that condition was not required. Revert this condition (but still disable inc_cursor with unicode because it handles wide-glyphs incorrectly). --- libbb/lineedit.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/libbb/lineedit.c b/libbb/lineedit.c index 1fb8919bb..54f0edef0 100644 --- a/libbb/lineedit.c +++ b/libbb/lineedit.c @@ -730,15 +730,11 @@ static void input_forward(void) * inc_cursor improves forward cursor movement appearance on * win 7/8 console, but it's broken with unicode wide-glyphs, * e.g. paste and move forward over: echo 开开心心过每一天 - * so disable inc_corsor when unicode is active (which is only + * so disable inc_cursor when unicode is active (which is only * windows 10+, where inc_cursor is not needed anyway). - * - * FIXME: the VT_INPUT condition is not required, because other - * than the wide-glyphs issue, inc_cursor works correctly - * regardless of the VT mode. */ { - if (terminal_mode(FALSE) & VT_INPUT || unicode_status == UNICODE_ON) + if (unicode_status == UNICODE_ON) put_cur_glyph_and_inc_cursor(); else inc_cursor(); -- cgit v1.2.3-55-g6feb