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 17:17:17 +02:00 committed by GitHub
parent e35c13425e
commit e443cfa9a2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 4 deletions

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)
}
}
})
})