refact: active terminal on conn the same remote (#12392)

Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou
2025-07-23 22:44:05 +08:00
committed by GitHub
parent f2473974b8
commit b4e13706bd
2 changed files with 23 additions and 1 deletions

View File

@@ -177,6 +177,18 @@ class _TerminalTabPageState extends State<TerminalTabPage> {
tabController.clear();
} else if (call.method == kWindowActionRebuild) {
reloadCurrentWindow();
} else if (call.method == kWindowEventActiveSession) {
if (tabController.state.value.tabs.isEmpty) {
return false;
}
final currentTab = tabController.state.value.selectedTabInfo;
assert(call.arguments is String,
"Expected String arguments for kWindowEventActiveSession, got ${call.arguments.runtimeType}");
if (currentTab.key.startsWith(call.arguments)) {
windowOnTop(windowId());
return true;
}
return false;
}
});
Future.delayed(Duration.zero, () {