我喜歡使用Emacs的shell模式,但它有一些缺陷。其中之一是,當shell命令嘗試調用編輯器時,它不夠聰明打開新的緩衝區。例如與環境變量VISUAL
設置爲vim
我得到了來自svn propedit
如下:當一個命令嘗試以shell模式打開一個編輯器時打開一個Emacs緩衝區
$ 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模式在這裏做正確的事情並代表命令行進程打開一個新的緩衝區?
$ svn propedit svn:忽略。 等待Emacs ... -error未知&_command:&_ ABSPATH/TO/REPO/svn&-prop.tmp 沒有更改屬性的svn:ignore'on'。' – 2008-09-22 18:34:50