Feature: auto-close controlled term windows on session exit

This commit is contained in:
Peter Steinberger 2025-06-19 23:05:43 +02:00
parent d64abdafad
commit 25857fb2de

View file

@ -517,8 +517,8 @@ final class TerminalLauncher {
// When called from Swift server, we need to construct the full command with tty-fwd
// When called from Rust via socket, command is already pre-formatted
let fullCommand: String = if command.contains("TTY_SESSION_ID=") {
// Command is pre-formatted from Rust, just add cd
"cd \"\(escapedDir)\" && \(command)"
// Command is pre-formatted from Rust, add cd and exit
"cd \"\(escapedDir)\" && \(command) && exit"
} else {
// Command is just the user command, need to add tty-fwd
"cd \"\(escapedDir)\" && TTY_SESSION_ID=\"\(sessionId)\" \(ttyFwd) -- \(command) && exit"