mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-16 20:11:08 +00:00
* fix(telnet, sudo): support Chinese-localized prompts with full-width colons (#1286) Two bugs in prompt detection for Chinese-locale users: 1. telnetAutoLogin: USERNAME_PROMPT_PATTERN, PASSWORD_PROMPT_PATTERN, and LAST_LOGIN_PATTERN only matched half-width colon ':' or '>'. Chinese-locale telnet prompts use full-width colon ':' (U+FF1A), e.g. '登录:', '密码:'. Changed [:'>] to [::'|] in all three patterns to accept both colon variants. 2. terminalSudoAutofill: EXPLICIT_SUDO_PROMPT_PATTERN required '[sudo]' (closing bracket immediately after 'sudo'), but Chinese sudo prompts use '[sudo: authenticate] 密码:' format where sudo is followed by colon. Changed \[sudo\] to \[sudo[^\]]*\] to match any '[sudo...]' variant, making the explicit (no-arm-needed) hint detection work for Chinese locale. Fixes #1286 * fix: restore OSC stripping pattern broken in previous commit The regex negated character class [^\x07]* was truncated to just \x07, breaking OSC sequence stripping (e.g. window title changes embedded in terminal output). Restore the original negated class so stripTerminalControl- Sequences continues to remove OSC title sequences before prompt detection. This was caught by Codex review of PR #1288.