Support UTF-8 auto-detection for MacOS Terminal v2.8.3 (404.1):
Unexpectedly, a ZWNBSP (U+FEFF) received/echoed by the MacOS Terminal while in the first column causes a subsequent cursor position report to indicate the 2nd column as the current only. I suppose in some weird world a zero-width character can can't as a column position. So if the cursor position has moved less than 2 columns (not exactly 0 columns), then consider it a UTF-8 terminal. Non-UTF-8 terminals normally move the cursor 3 columns when echoing a UTF-8 encoded ZWNBSP. So to summarize, when echoing a ZWNBSP: - Non-UTF-8 terminals: moves 3 columns - MacOS terminal: moves 1 columns - Other UTF-8 terminals: moves 0 columns
Please register or sign in to comment