macos: keep remote control tunnel alive
This commit is contained in:
@@ -261,7 +261,14 @@ final class ControlChannel: ObservableObject {
|
|||||||
let localPort = Self.pickAvailablePort()
|
let localPort = Self.pickAvailablePort()
|
||||||
let proc = Process()
|
let proc = Process()
|
||||||
proc.executableURL = URL(fileURLWithPath: "/usr/bin/ssh")
|
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 {
|
if !identity.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty {
|
||||||
args.insert(contentsOf: ["-i", identity], at: 2)
|
args.insert(contentsOf: ["-i", identity], at: 2)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,7 +83,9 @@ struct GeneralSettings: View {
|
|||||||
.pickerStyle(.segmented)
|
.pickerStyle(.segmented)
|
||||||
.frame(width: 380, alignment: .leading)
|
.frame(width: 380, alignment: .leading)
|
||||||
|
|
||||||
self.healthRow
|
if self.state.connectionMode == .local {
|
||||||
|
self.healthRow
|
||||||
|
}
|
||||||
|
|
||||||
if self.state.connectionMode == .remote {
|
if self.state.connectionMode == .remote {
|
||||||
self.remoteCard
|
self.remoteCard
|
||||||
|
|||||||
Reference in New Issue
Block a user