编辑 crontab 时在终端中打开 emacs

Clo*_*ldo 10 bash cron emacs

我已emacs/etc/profile. 当我想emacs在终端中使用时。我用-nw选项打开它。在crontab -e阻止它在窗口中打开时,我怎么能有相同的行为?

Sve*_*ven 14

你必须使用

    export EDITOR="emacs -nw"
Run Code Online (Sandbox Code Playgroud)

带引号,它应该按预期工作。


小智 7

如果你觉得emacs每次启动都很慢,你也可以使用:

export EDITOR="emacsclient -t"
Run Code Online (Sandbox Code Playgroud)

但是,您必须使用以下命令启动 emacs 服务器:

emacs --daemon
Run Code Online (Sandbox Code Playgroud)

  • 使用`EDITOR="emacsclient --alternate-editor= -t"`,emacsclient 将在必要时以守护进程模式启动 Emacs。 (2认同)