Terminal-Bugfix: In-App-PTY-Terminal im Dracula-Theme, .command-Fallback, ANSI-Parser-Fix, Doku

This commit is contained in:
x3
2026-09-21 22:59:17 +02:00
parent 8fe8c4925e
commit 1828a96a2b
9 changed files with 699 additions and 18 deletions
@@ -20,14 +20,18 @@ enum SSHService {
return "ssh " + escaped.joined(separator: " ")
}
/// Öffnet die SSH-Session in Terminal.app
/// Öffnet die SSH-Session in Terminal.app — ohne AppleScript (das scheiterte
/// still an fehlender Automation-Berechtigung), sondern über eine .command-Datei.
static func openInTerminal(profile: ConnectionProfile, key: StoredSSHKey?) {
let cmd = sshCommandString(for: profile, key: key)
let script = "tell application \"Terminal\" to do script \"\(cmd.replacingOccurrences(of: "\"", with: "\\\""))\""
var err: NSDictionary?
if let appleScript = NSAppleScript(source: script) {
appleScript.executeAndReturnError(&err)
}
let dir = FileManager.default.urls(for: .applicationSupportDirectory, in: .userDomainMask).first!
.appendingPathComponent("RemminaMac", isDirectory: true)
try? FileManager.default.createDirectory(at: dir, withIntermediateDirectories: true)
let url = dir.appendingPathComponent("launch-\(profile.id.uuidString).command")
// exec bash hält das Fenster nach Sitzungsende offen
try? "#!/bin/bash\n\(cmd)\nexec bash\n".write(to: url, atomically: true, encoding: .utf8)
try? FileManager.default.setAttributes([.posixPermissions: 0o755], ofItemAtPath: url.path)
NSWorkspace.shared.open(url)
}
static func copyCommandToClipboard(profile: ConnectionProfile, key: StoredSSHKey?) {