Repository navigation
macOS action's trailing workdir slash can break zsh prompts #14048
Issue DescriptionFollowing up on #8932, the workingDirectory strings passed from openTerminal end with a slash. This can break the common zsh prompt sequence Here is a swift program that runs the path processing logic on the current clipboard contents. Copy a file or folder, and then run it with getUrl.swift import AppKit
import Foundation
let pasteboard = NSPasteboard.general
guard
let pathURLs = pasteboard.readObjects(
forClasses: [NSURL.self], options: [.urlReadingFileURLsOnly: true]) as? [URL]
else {
fatalError("no string")
}
let directoryURLs = Set(
pathURLs.map { url -> URL in
let isDirectory =
(try? url.resourceValues(forKeys: [.isDirectoryKey]))?.isDirectory
?? url.hasDirectoryPath
return isDirectory ? url : url.deletingLastPathComponent()
}
)
guard !directoryURLs.isEmpty else {
fatalError("no string")
}
for url in directoryURLs {
let workingDirectory = url.path(percentEncoded: false)
print(workingDirectory.debugDescription)
}Expected BehaviorSet the working directory without the trailing slash so zsh understands it properly. Actual BehaviorZsh expands the prompt sequence Reproduction Steps
Ghostty LogsNo response Ghostty VersionOS Version InformationMacOS 26.6.2 (Linux only) Display ServerNone (Linux only) Desktop Environment/Window ManagerNo response Minimal Ghostty ConfigurationNo config needed but do use zsh.Additional Relevant ConfigurationBehavior observed with zsh. I acknowledge that:
|
Answered by
mitchellh
Aug 27, 2026
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fixed #14051