fix: reconnection causing cloned sessions to close unexpectedly

This commit is contained in:
hstyi
2025-07-18 13:20:55 +08:00
committed by hstyi
parent aca0fbb1e3
commit 5fcda04544

View File

@@ -211,6 +211,17 @@ class SSHTerminalTab(
return super.getData(dataKey) return super.getData(dataKey)
} }
override fun reconnect() {
stop()
// 重新连接时就等于重新打开了一个标签handler 重置
handler.client = null
handler.session = null
handler.client = null
start()
}
override fun stop() { override fun stop() {
if (mutex.tryLock()) { if (mutex.tryLock()) {
try { try {