fix: adjust ssh config time resolution (#10803)
Some checks failed
Package-Build / Lint (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
Docs / build (push) Has been cancelled
Package-Build / macOS-Build (arm64, aarch64-apple-darwin) (push) Has been cancelled
Package-Build / macOS-Build (x86_64, x86_64-apple-darwin) (push) Has been cancelled
Package-Build / Linux-Build (amd64, x64, ubuntu-24.04, x86_64-unknown-linux-gnu) (push) Has been cancelled
Package-Build / Linux-Build (arm64, arm64, ubuntu-24.04-arm, aarch64-unknown-linux-gnu, aarch64-linux-gnu-) (push) Has been cancelled
Package-Build / Linux-Build (armhf, arm, ubuntu-24.04, arm-unknown-linux-gnueabihf, arm-linux-gnueabihf-) (push) Has been cancelled
Package-Build / Windows-Build (arm64, aarch64-pc-windows-msvc) (push) Has been cancelled
Package-Build / Windows-Build (x64, x86_64-pc-windows-msvc) (push) Has been cancelled

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
osm1892
2025-10-20 16:47:04 +09:00
committed by GitHub
parent 34c0c780f4
commit bbcb026433

View File

@@ -205,9 +205,7 @@ function convertHostToSSHProfile (host: string, settings: Record<string, string
// The following have single integer values
case SSHProfilePropertyNames.Port:
case SSHProfilePropertyNames.KeepaliveInterval:
case SSHProfilePropertyNames.KeepaliveCountMax:
case SSHProfilePropertyNames.ReadyTimeout:
const numberString = settings[key]
if (typeof numberString === 'string') {
options[targetName] = parseInt(numberString, 10)
@@ -216,6 +214,22 @@ function convertHostToSSHProfile (host: string, settings: Record<string, string
}
break
// KeepaliveInterval and ReadyTimeout are in seconds in SSH config but milliseconds in Tabby
case SSHProfilePropertyNames.KeepaliveInterval:
case SSHProfilePropertyNames.ReadyTimeout:
const secondsString = settings[key]
if (typeof secondsString === 'string') {
const parsedSeconds = parseInt(secondsString, 10)
if (!isNaN(parsedSeconds) && parsedSeconds >= 0) {
options[targetName] = parsedSeconds * 1000
} else {
console.log(`Invalid value for ${key}: "${secondsString}"`)
}
} else {
console.log('Unexpected value in settings for ' + key)
}
break
// The following have single yes/no values
case SSHProfilePropertyNames.X11:
case SSHProfilePropertyNames.AgentForward: