Ghostty-per-Projekt-Builder: Template + make/rebuild-Skripte
- ghostty-template/Ghostty.app: lokal gebautes Ghostty v1.3.1 mit DockTilePlugin-Patch (eigenes Dock-Icon ueber Contents/Resources/DockIcon.png) - make-ghostty-app.sh: erzeugt pro Projekt eine App; Slots fuer icon/workdir/command/theme/bg/fg/font/font-size - rebuild-template.sh: baut Template lokal neu (nur Xcode, kein Zig/VM), gepinnt auf vendor/libghostty v1.3.1 - ghostty-template/dock-icon.patch: der DockTilePlugin-Patch - icons/robotunits.png - enthaelt zudem die vorausgehende MiniTerm/libghostty-Integration
This commit is contained in:
@@ -13,6 +13,8 @@ import SwiftTerm
|
||||
// MTFontName String Font family name (default "Menlo"). Falls back to
|
||||
// the system monospaced font if the name is missing.
|
||||
// MTWindowTitle String Window title (default = CFBundleName).
|
||||
// MTCloseOnExit Bool Close the window when the command exits (default
|
||||
// false = drop back into an interactive login shell).
|
||||
//
|
||||
struct AppConfig {
|
||||
let command: String
|
||||
@@ -21,6 +23,7 @@ struct AppConfig {
|
||||
let fontName: String
|
||||
let windowTitle: String
|
||||
let engine: String // "ghostty" (Default) oder "swiftterm"
|
||||
let closeOnExit: Bool // true = Fenster schließt, wenn der Befehl endet
|
||||
|
||||
static func load() -> AppConfig {
|
||||
let info = Bundle.main.infoDictionary ?? [:]
|
||||
@@ -46,12 +49,15 @@ struct AppConfig {
|
||||
?? (info["CFBundleName"] as? String)
|
||||
?? "Terminal"
|
||||
|
||||
let closeOnExit = (info["MTCloseOnExit"] as? NSNumber)?.boolValue ?? false
|
||||
|
||||
return AppConfig(command: cmd,
|
||||
workingDirectory: workdir,
|
||||
fontSize: CGFloat(size),
|
||||
fontName: fontName.isEmpty ? "Menlo" : fontName,
|
||||
windowTitle: title,
|
||||
engine: engine == "swiftterm" ? "swiftterm" : "ghostty")
|
||||
engine: engine == "swiftterm" ? "swiftterm" : "ghostty",
|
||||
closeOnExit: closeOnExit)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,6 +126,10 @@ final class AppDelegate: NSObject, NSApplicationDelegate, LocalProcessTerminalVi
|
||||
let args: [String]
|
||||
if config.command.isEmpty {
|
||||
args = ["-l"]
|
||||
} else if config.closeOnExit {
|
||||
// Run the command and let the process end with it; the window
|
||||
// closes via processTerminated().
|
||||
args = ["-l", "-c", config.command]
|
||||
} else {
|
||||
// Run the requested command, then hand control to an interactive
|
||||
// login shell so the window stays open after the command exits.
|
||||
|
||||
Reference in New Issue
Block a user