From 6a53757f6898f8d26ffd12cdc3abdcc3781f613c Mon Sep 17 00:00:00 2001 From: fufesou Date: Sun, 3 May 2026 11:37:01 +0800 Subject: [PATCH] fix(terminal): comments utf-8 chunk accumulator Signed-off-by: fufesou --- src/server/terminal_service.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/server/terminal_service.rs b/src/server/terminal_service.rs index 973a399a0..52a296b74 100644 --- a/src/server/terminal_service.rs +++ b/src/server/terminal_service.rs @@ -612,6 +612,12 @@ fn find_utf8_split_point(buf: &[u8]) -> usize { buf.len() } +// Terminal output currently follows a UTF-8 text model end to end: the service +// keeps replay buffers on UTF-8 boundaries, and Flutter decodes payload bytes as +// UTF-8 before writing to xterm. This accumulator only prevents splitting a +// trailing UTF-8 code point across PTY reads. Supporting non-UTF-8 terminals +// would need a separate design covering remote encoding detection, Flutter +// decoding, replay truncation, and input transcoding. #[derive(Default)] struct Utf8ChunkAccumulator { remainder: Vec,