Files
tty7/src
l0ng-ai d7e43bb2f8 fix(history): unmetafy zsh history before decoding it as UTF-8
zsh escapes every byte in 0x83..=0xA2 (and NUL) as Meta (0x83) followed
by the byte xor 0x20 when writing $HISTFILE. tty7 decoded those files
with from_utf8_lossy directly, so CJK commands showed up as mojibake or
U+FFFD in history search, next to tty7's own clean copy of the same
command.

Undo the escaping at the byte level, but only for zsh files: by name
(.zsh_history, .zhistory) or, for a custom local HISTFILE, by the
presence of extended-history lines. bash and fish files are left alone,
since valid UTF-8 like `ー` (E3 83 BC) contains 0x83.

Also read tty7's own history file as bytes with a lossy decode, so one
invalid byte no longer drops the whole file.

Fixes #1175
2026-10-15 15:16:09 +08:00
..