tart exec: do not attempt to call TTY-related methods when no -t is set (#1122)

This commit is contained in:
Nikolay Edigaryev
2025-09-12 19:17:17 +04:00
committed by GitHub
parent e35c13425e
commit e443cfa9a2
+6 -4
View File
@@ -87,11 +87,13 @@ struct Exec: AsyncParsableCommand {
$0.args = Array(command.dropFirst(1))
$0.interactive = interactive
$0.tty = tty
$0.terminalSize = .with {
let (width, height) = try! Term.GetSize()
if tty {
$0.terminalSize = .with {
let (width, height) = try! Term.GetSize()
$0.cols = UInt32(width)
$0.rows = UInt32(height)
$0.cols = UInt32(width)
$0.rows = UInt32(height)
}
}
})
})