Skip to content

Commit e443cfa

Browse files
authored
tart exec: do not attempt to call TTY-related methods when no -t is set (#1122)
1 parent e35c134 commit e443cfa

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Sources/tart/Commands/Exec.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,13 @@ struct Exec: AsyncParsableCommand {
8787
$0.args = Array(command.dropFirst(1))
8888
$0.interactive = interactive
8989
$0.tty = tty
90-
$0.terminalSize = .with {
91-
let (width, height) = try! Term.GetSize()
90+
if tty {
91+
$0.terminalSize = .with {
92+
let (width, height) = try! Term.GetSize()
9293

93-
$0.cols = UInt32(width)
94-
$0.rows = UInt32(height)
94+
$0.cols = UInt32(width)
95+
$0.rows = UInt32(height)
96+
}
9597
}
9698
})
9799
})

0 commit comments

Comments
 (0)