我的$PATH
中有一个简单的 bash 脚本,可以在运行的 Emacs 实例中从终端快速打开文件或目录。
#!/usr/bin/env bash /Applications/Emacs.app/Contents/MacOS/bin/emacsclient "$@"
然而,升级到 macOS 15.3 后, emacsclient
停止将 Emacs 框架放在前面。
我能找到的解决方案之一建议将(select-frame-set-input-focus (selected-frame))
添加到 Emacs 配置中。但是,它仅在您启动 Emacs 的新实例时才起作用。
对我有用的是在调用emacsclient
之前将其添加到脚本中:
osascript << EOF tell application "System Events" tell application process "Emacs" set frontmost to true end tell end tell EOF
原文: https://dolzhenko.me/blog/2025/02/emacs-frames-are-not-coming-into-the-foreground-on-mac-os/