有没有办法让Emacs图形版本的 daemon 常驻后台?

如题,我发现我机器临时关闭Wayland会话的话emacs --daemon会退出

Emacs 28.0.50 pgtk

还能有什么办法,服务?

换一个 tty, 起个 emacs

用systemd, 一旦退出,再让它起一个?

systemctl enable --user emacs

不知道我理解的对不对,你实际上需要的是 tmux?

1 个赞

tmux 不错,解决了我在 mac 上通过 nix 使用 Emacs 的一大痛点。

现在的工作流:

  1. 在 iterm 中 新建会话 tmux new -s emacs
  2. 在 Tmux 窗口运行 runemcs, 这是我自己的启动脚本。
  3. 按下快捷键 Ctrl+b d 将会话分离。
  4. 下次使用时,重新连接到会话 tmux attach-session -t emacs
  5. 需要在终端下修改小配置时,直接启动 emacsclient -c -n <filename> 编辑文件。