在终端中,我可以通过 Ctrl-U 擦除整个输入,而无需调用它。Eshell中有这样的命令吗?
您正在寻找eshell-kill-input
,默认情况下绑定到C-c C-u
。
我不认为eshell
本身支持杀死整个输入字符串(它只杀死点和提示之间的文本),但一些建议应该解决这个问题:
;;; For Emacs 24.4 and later
(defun eshell-kill-input--go-to-eol ()
"Go to end of line before killing input"
(end-of-line))
(advice-add 'eshell-kill-input :before #'eshell-kill-input--go-to-eol)
;;; For Emacs versions before 24.4
(defadvice eshell-kill-input (before go-to-eol ())
"Go to end of line before killing input"
(end-of-line))