Conversation
… seq Three low-severity items. - tuish_clear_region re-implements _tuish_str_repeat's O(log n) doubling. It can't be deduplicated: that helper lives in str.sh, but term.sh depends only on tui.sh and is sourced without str.sh in minimal setups (README quick-start, examples/slow_menu.sh). Add a comment documenting the deliberate duplication so it isn't re-flagged. - Conjoining Hangul Jamo (U+1160-U+11FF, medial vowels and final consonants) were classified width 1; like other wcwidth implementations they are zero width (they combine onto the leading consonant, which stays width 2). Add a 0-width branch for that range. New width test: a decomposed syllable (U+1100 + U+1161 + U+11A8) is 2 columns, not 4. - More than cosmetic: tuish_save_cursor used '\x1b7', which ksh93's printf reads as hex 0x1b7 — so DECSC was emitted as the bytes c6 b7 instead of ESC 7. No single backslash escape works everywhere (the octal '\0337' becomes byte 337 on mksh). Emit a literal ESC byte (_tuish_chr_27 from the ord table) for both save and restore so the trailing digit can't be swallowed. Verified ESC 7 / ESC 8 on bash, zsh, ksh93, mksh, busybox (buffered and unbuffered). New tests/unit/test_term.sh guards it per shell. All unit suites pass on bash/zsh/ksh93/mksh/busybox; boxes/keyboard/editor integration pass under ksh93 and mksh.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
… seq
Three low-severity items.
tuish_clear_region re-implements _tuish_str_repeat's O(log n) doubling. It can't be deduplicated: that helper lives in str.sh, but term.sh depends only on tui.sh and is sourced without str.sh in minimal setups (README quick-start, examples/slow_menu.sh). Add a comment documenting the deliberate duplication so it isn't re-flagged.
Conjoining Hangul Jamo (U+1160-U+11FF, medial vowels and final consonants) were classified width 1; like other wcwidth implementations they are zero width (they combine onto the leading consonant, which stays width 2). Add a 0-width branch for that range. New width test: a decomposed syllable (U+1100 + U+1161 + U+11A8) is 2 columns, not 4.
More than cosmetic: tuish_save_cursor used '\x1b7', which ksh93's printf reads as hex 0x1b7 — so DECSC was emitted as the bytes c6 b7 instead of ESC 7. No single backslash escape works everywhere (the octal '\0337' becomes byte 337 on mksh). Emit a literal ESC byte (_tuish_chr_27 from the ord table) for both save and restore so the trailing digit can't be swallowed. Verified ESC 7 / ESC 8 on bash, zsh, ksh93, mksh, busybox (buffered and unbuffered). New tests/unit/test_term.sh guards it per shell.
All unit suites pass on bash/zsh/ksh93/mksh/busybox; boxes/keyboard/editor integration pass under ksh93 and mksh.