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
相关推荐
狂热开发者3 小时前
用 Typeoff 把会后口述整理成 Markdown 决策记录
人工智能·windows·macos·ios·安卓
ofoxcoding3 小时前
Codex Computer Use 完整指南:AI 自动操控 Mac 与 Windows 桌面实战详解
人工智能·windows·macos·ai
小牛不牛的程序员4 小时前
开源一个 macOS 剪贴板「意图识别」工具——不只是存储,更是理解你复制了什么
macos·swift
sg_knight7 小时前
Claude Code 安装指南(macOS / Linux / Windows WSL)
linux·windows·macos·claude·code·anthropic·claude-code
2601_9615934216 小时前
Rust 开发环境配置繁琐?RustRover 开箱即用搞定编码调试
开发语言·后端·macos·rust
在水一缸18 小时前
拒绝被打扰:深度解析 macOS 进程守护与“反自动启动”攻防战
macos·策略模式·用户体验·进程守护·自动启动·系统权限
REDcker1 天前
macOS 挂载 Linux 远程目录详解
linux·运维·macos
2601_961593421 天前
Mac 上搭建Linux环境吗?VMware + CentOS Stream 9 镜像快速部署
linux·运维·ide·macos·centos