fix(terminal): reconnect, refactor

Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou
2026-04-29 23:11:13 +08:00
parent 929a4e78ba
commit 26a356d0f5
3 changed files with 29 additions and 70 deletions

View File

@@ -288,7 +288,8 @@ class TerminalModel with ChangeNotifier {
// On reconnect, the server may replay recent output. That replay can include
// terminal queries like DSR/DA; xterm answers them through onOutput as
// "^[[1;1R^[[2;2R^[[>0;0;0c", which must not be sent back to the peer.
_suppressNextTerminalDataOutput = evt['replay_in_next_data'] == true;
_suppressNextTerminalDataOutput =
message == 'Reconnected to existing terminal with pending output';
// Fallback: if terminal view is not yet ready but already has valid
// dimensions (e.g. layout completed before open response arrived),
@@ -347,8 +348,7 @@ class TerminalModel with ChangeNotifier {
final data = evt['data'];
if (data != null) {
final suppressTerminalOutput =
evt['replay'] == true || _suppressNextTerminalDataOutput;
final suppressTerminalOutput = _suppressNextTerminalDataOutput;
_suppressNextTerminalDataOutput = false;
try {
String text = '';