fix: terminal, persistent (#12357)
Some checks are pending
CI / ${{ matrix.job.target }} (${{ matrix.job.os }}) (map[os:ubuntu-22.04 target:x86_64-unknown-linux-gnu]) (push) Waiting to run
Full Flutter CI / run-ci (push) Waiting to run

Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou 2025-07-21 17:15:02 +08:00 committed by GitHub
parent 9bcfe9d148
commit 391ef70007
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 9 deletions

View File

@ -124,7 +124,7 @@ class _TerminalTabPageState extends State<TerminalTabPage> {
},
setter: (bool v) async {
final ffi = Get.find<FFI>(tag: 'terminal_$peerId');
bind.sessionToggleOption(
await bind.sessionToggleOption(
sessionId: ffi.sessionId,
value: kOptionTerminalPersistent,
);

View File

@ -696,10 +696,7 @@ impl TerminalServiceProxy {
opened.success = true;
opened.message = "Reconnected to existing terminal".to_string();
opened.pid = session.pid;
// Return service_id for persistent sessions
if self.is_persistent {
opened.service_id = self.service_id.clone();
}
opened.service_id = self.service_id.clone();
if service.needs_session_sync {
if service.sessions.len() > 1 {
// No need to include the current terminal in the list.
@ -869,10 +866,7 @@ impl TerminalServiceProxy {
opened.success = true;
opened.message = "Terminal opened".to_string();
opened.pid = session.pid;
// Return service_id for persistent sessions
if self.is_persistent {
opened.service_id = service.service_id.clone();
}
opened.service_id = service.service_id.clone();
if service.needs_session_sync {
if !service.sessions.is_empty() {
opened.persistent_sessions = service.sessions.keys().cloned().collect();