From 22259a322d199696b4d4a1db3ce250d025190a2d Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 8 Dec 2025 23:28:03 +0100 Subject: [PATCH] macos: keep remote control tunnel alive --- apps/macos/Sources/Clawdis/ControlChannel.swift | 9 ++++++++- apps/macos/Sources/Clawdis/GeneralSettings.swift | 4 +++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/apps/macos/Sources/Clawdis/ControlChannel.swift b/apps/macos/Sources/Clawdis/ControlChannel.swift index 8c7e05b1f..f52530b02 100644 --- a/apps/macos/Sources/Clawdis/ControlChannel.swift +++ b/apps/macos/Sources/Clawdis/ControlChannel.swift @@ -261,7 +261,14 @@ final class ControlChannel: ObservableObject { let localPort = Self.pickAvailablePort() let proc = Process() proc.executableURL = URL(fileURLWithPath: "/usr/bin/ssh") - var args: [String] = ["-o", "BatchMode=yes", "-o", "ExitOnForwardFailure=yes", "-L", "\(localPort):127.0.0.1:18789", target] + var args: [String] = [ + "-o", "BatchMode=yes", + "-o", "ExitOnForwardFailure=yes", + "-N", // don't run a remote shell; keep the tunnel open + "-T", // no pseudo-tty + "-L", "\(localPort):127.0.0.1:18789", + target, + ] if !identity.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty { args.insert(contentsOf: ["-i", identity], at: 2) } diff --git a/apps/macos/Sources/Clawdis/GeneralSettings.swift b/apps/macos/Sources/Clawdis/GeneralSettings.swift index 12ee8d809..6e47ea752 100644 --- a/apps/macos/Sources/Clawdis/GeneralSettings.swift +++ b/apps/macos/Sources/Clawdis/GeneralSettings.swift @@ -83,7 +83,9 @@ struct GeneralSettings: View { .pickerStyle(.segmented) .frame(width: 380, alignment: .leading) - self.healthRow + if self.state.connectionMode == .local { + self.healthRow + } if self.state.connectionMode == .remote { self.remoteCard