unix – 当命令尝试以shell模式打开编辑器时,打开Emacs缓冲区

我喜欢使用Emacs的shell模式,但它有一些缺陷。其中之一是,当shell命令尝试调用编辑器时,打开新缓冲区不够聪明。例如,将环境变量VISUAL设置为vim,我从svn propedit得到以下内容
$ svn propedit svn:externals . 
"svn-prop.tmp" 2L,149C[1;1H
~                                                                               [4;1H~                                                                               [5;1H~                                                                               [6;1H~                                                                               [7;1H~            
...

(从代表中可能很难说,但这是一个可怕的丑陋的混乱。)

使用VISUAL设置为“emacs -nw”,我得到

$ svn propedit svn:externals .
emacs: Terminal type "dumb" is not powerful enough to run Emacs.
It lacks the ability to position the cursor.
If that is not the actual type of terminal you have,use the Bourne shell command `TERM=... export TERM' (C-shell:
`setenv TERM ...') to specify the correct type.  It may be necessary
to do `unset TERMINFO' (C-shell: `unsetenv TERMINFO') as well.svn: system('emacs -nw svn-prop.tmp') returned 256

(它与VISUAL设置为只是emacs,但只能从Emacs X窗口内部,而不是在终端会话内)。

有没有办法让shell模式在这里做正确的事情,代表命令行进程打开一个新的缓冲区?

您可以通过emacsclient附加到Emacs会话。首先,启动emacs服务器
M-x server-start

或者添加(服务器启动)到.emacs。然后,

export VISUAL=emacsclient

编辑。

注意:

> emacs和emacsclient的版本必须同意。如果安装了多个版本的Emacs,请确保调用与运行服务器的Emacs版本相对应的emacsclient版本。>如果您在多个Emacs进程/帧中启动服务器(例如,因为(.server启动)),缓冲区将在最后一帧中创建以启动服务器。

相关文章

用的openwrt路由器,家里宽带申请了动态公网ip,为了方便把2...
#!/bin/bashcommand1&command2&wait从Shell脚本并行...
1.先查出MAMP下面集成的PHP版本cd/Applications/MAMP/bin/ph...
1、先输入locale-a,查看一下现在已安装的语言2、若不存在如...
BashPerlTclsyntaxdiff1.进制数表示Languagebinaryoctalhexa...
正常安装了k8s后,使用kubect工具后接的命令不能直接tab补全...