Files
Netcatty/electron/bridges/systemManager/execConnHealth.cjs
T
陈大猫 36267717ac feat(terminal): add system manager side panel for processes, tmux, and Docker
Introduce workspace-aware System side panel with remote process/tmux/Docker management, terminal popup for interactive attach, capability warmup, review-hardened IPC, performance optimizations, toast action errors, and SSH channel recovery on reconnect.
2026-06-11 04:19:21 +08:00

28 lines
814 B
JavaScript

"use strict";
/** Best-effort check that an ssh2 Client transport is still usable. */
function isSshConnAlive(conn) {
if (!conn) return false;
const sock = conn._sock;
if (sock && sock.destroyed) return false;
return true;
}
/** True when conn.exec failed because the underlying transport/channel is gone. */
function isTransportExecError(message) {
const msg = String(message || "").toLowerCase();
return (
msg.includes("not connected")
|| msg.includes("connection lost")
|| msg.includes("socket hang up")
|| msg.includes("econnreset")
|| msg.includes("closed")
|| msg.includes("destroyed")
|| msg.includes("channel open failure")
|| msg.includes("unable to exec")
|| msg.includes("no response")
);
}
module.exports = { isSshConnAlive, isTransportExecError };