📌 📄 内容摘要:
@kagg886 在 macOS Finder菜单 在终端中打开 替换为ghostty 中发帖
原理是在 .zshrc 里 编写脚本检测当前的终端类型。
如果不是 ghostty 的话,直接呼起ghostty。
脚本如下(建议贴在最顶端)
# Redirect Finder-opened Apple Terminal sessions into Ghostty.
if [[ -o interactive && "${TERM_PROGRAM:-}" == "Apple_Terminal" && -z "${GHOSTTY_TERMINAL_TAKEOVER_DONE:-}" ]]; then
export GHOSTTY_TERMINAL_TAKEOVER_DONE=1
__ghostty_app="/Applications/Ghostty.app"
__ghostty_lock_file="${TMPDIR:-/tmp}/ghostty-terminal-tak...
────────── 链接信息 ────────── 🔗 论坛链接: linux.do 📎 访问地址: https://linux.do/t/topic/2081199/1 ─────────────────────────────
📢 来源:LINUX DO