mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-05-24 13:50:11 +00:00
macOS: normalize working directory paths with FilePath
This fixes for nuShell when opening Ghostty via Finder service and Shortcuts, also makes path parsing more robust in AppleScript.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import SwiftUI
|
||||
import UserNotifications
|
||||
import GhosttyKit
|
||||
import System
|
||||
|
||||
extension Ghostty {
|
||||
/// Render a terminal for the active app in the environment.
|
||||
@@ -611,8 +612,20 @@ extension Ghostty {
|
||||
/// Explicit font size to use in points
|
||||
var fontSize: Float32?
|
||||
|
||||
private var normalizedWorkingDirectory: String?
|
||||
/// Explicit working directory to set
|
||||
var workingDirectory: String?
|
||||
var workingDirectory: String? {
|
||||
get { normalizedWorkingDirectory }
|
||||
set {
|
||||
guard let newValue else {
|
||||
normalizedWorkingDirectory = nil
|
||||
return
|
||||
}
|
||||
// We use FilePath to normalize separators by removing redundant intermediary separators
|
||||
// and stripping any trailing separators.
|
||||
normalizedWorkingDirectory = FilePath(newValue).string
|
||||
}
|
||||
}
|
||||
|
||||
/// Explicit command to set
|
||||
var command: String?
|
||||
|
||||
Reference in New Issue
Block a user