diff options
author | Avi Halachmi (:avih) <avihpit@yahoo.com> | 2023-07-20 23:15:43 +0300 |
---|---|---|
committer | Avi Halachmi (:avih) <avihpit@yahoo.com> | 2023-07-23 14:41:20 +0300 |
commit | 9c0a4d8cd6d4abee680909ca5db7575012a6815b (patch) | |
tree | 77ec07f3d7084b782dbc8c62bcf05ac09f68ce4e | |
parent | 7aa64d90542cfc8f01f52ece38bf751c7b843875 (diff) | |
download | busybox-w32-9c0a4d8cd6d4abee680909ca5db7575012a6815b.tar.gz busybox-w32-9c0a4d8cd6d4abee680909ca5db7575012a6815b.tar.bz2 busybox-w32-9c0a4d8cd6d4abee680909ca5db7575012a6815b.zip |
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).
-rw-r--r-- | libbb/lineedit.c | 8 |
1 files 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) | |||
730 | * inc_cursor improves forward cursor movement appearance on | 730 | * inc_cursor improves forward cursor movement appearance on |
731 | * win 7/8 console, but it's broken with unicode wide-glyphs, | 731 | * win 7/8 console, but it's broken with unicode wide-glyphs, |
732 | * e.g. paste and move forward over: echo 开开心心过每一天 | 732 | * e.g. paste and move forward over: echo 开开心心过每一天 |
733 | * so disable inc_corsor when unicode is active (which is only | 733 | * so disable inc_cursor when unicode is active (which is only |
734 | * windows 10+, where inc_cursor is not needed anyway). | 734 | * windows 10+, where inc_cursor is not needed anyway). |
735 | * | ||
736 | * FIXME: the VT_INPUT condition is not required, because other | ||
737 | * than the wide-glyphs issue, inc_cursor works correctly | ||
738 | * regardless of the VT mode. | ||
739 | */ | 735 | */ |
740 | { | 736 | { |
741 | if (terminal_mode(FALSE) & VT_INPUT || unicode_status == UNICODE_ON) | 737 | if (unicode_status == UNICODE_ON) |
742 | put_cur_glyph_and_inc_cursor(); | 738 | put_cur_glyph_and_inc_cursor(); |
743 | else | 739 | else |
744 | inc_cursor(); | 740 | inc_cursor(); |