From e443cfa9a2d8d3759aa13602a4581f4d1e6c7da5 Mon Sep 17 00:00:00 2001 From: Nikolay Edigaryev Date: Fri, 12 Sep 2025 17:17:17 +0200 Subject: [PATCH] tart exec: do not attempt to call TTY-related methods when no -t is set (#1122) --- Sources/tart/Commands/Exec.swift | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Sources/tart/Commands/Exec.swift b/Sources/tart/Commands/Exec.swift index bfcc309..20952c9 100644 --- a/Sources/tart/Commands/Exec.swift +++ b/Sources/tart/Commands/Exec.swift @@ -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) + } } }) })