MacOS右键助手 Ghostty 打开新窗口

在 MacOS 上打开 Ghostty 总是 新标签打开,换成新窗口又不能进入路径。所以使用 AppleScript 来处理这个:

AppleScript 复制代码
set targetDir to do shell script "p=@rfpath; 
if [ -d \"$p\" ]; then 
    printf '%s' \"$p\"; 
else 
    dirname \"$p\"; 
fi"

tell application "Ghostty"

    set cfg to new surface configuration
    set initial working directory of cfg to targetDir

    set win to new window with configuration cfg

    activate
end tell
相关推荐
weixin_531670895 小时前
Interlude起来:久坐提醒软件为什么需要登录?有没有完全本地运行的Mac休息提醒软件?
人工智能·macos·swift
weixin_531670891 天前
Interlude起来:Swift原生Mac软件有什么优势?原生Mac应用和Electron应用有什么区别?
人工智能·macos·mac·swift
k4m7v2pz1 天前
Swift Package Manager 在 macOS 26 上的三个编译错误排查指南
macos·spm·ai编程·xcode·swift·命令行工具
zhonyu鱼1 天前
Pot 翻译:开源免费的跨平台划词翻译与 OCR 工具
windows·macos·开源·ocr·开源软件
杜子麟1 天前
Android studio模拟器离线安装
android·macos·android studio
守城小轩2 天前
Chromium 148 编译指南 macOS篇:环境配置要求(一)
macos
Codeking__2 天前
iOS 动画:core Animation 底层原理
macos·objective-c·cocoa
SatanII2 天前
读懂 SELinux:强制访问控制 MAC,解决 httpd 服务权限报错实战
linux·运维·服务器·网络·macos
mCell3 天前
谁在为 AI 开车:Agent 浏览器生态调研(2026)
chrome·macos·agent
sudebao点com4 天前
一次“Google 能打开,FlexTV 打不开”的 DNS 故障排查:从 curl 超时到完整证据链
windows·macos·https·cdn·dns·nslookup·网络排错