把eshell提示放到另一行
Place eshell prompts to the other line
我的eshell提示是
~ λ cd Documents/
~/Documents λ
我怎么能把另一行写成
~/Documents
λ:
自定义用户选项eshell-prompt-function
,C-h v
说
A function that returns the Eshell prompt string.
Make sure to update eshell-prompt-regexp
so that it will match your
prompt.
例如,
(defun your-eshell-prompt-function ()
(setq eshell-prompt-regexp "^λ: ")
(format "%s\nλ: " (abbreviate-file-name (eshell/pwd))))
(setq eshell-prompt-function #'your-eshell-prompt-function)
顺便说一句,如果您的提示是彩色的,您可能需要禁用 eshell-highlight-prompt
。
我的eshell提示是
~ λ cd Documents/
~/Documents λ
我怎么能把另一行写成
~/Documents
λ:
自定义用户选项eshell-prompt-function
,C-h v
说
A function that returns the Eshell prompt string.
Make sure to updateeshell-prompt-regexp
so that it will match your prompt.
例如,
(defun your-eshell-prompt-function ()
(setq eshell-prompt-regexp "^λ: ")
(format "%s\nλ: " (abbreviate-file-name (eshell/pwd))))
(setq eshell-prompt-function #'your-eshell-prompt-function)
顺便说一句,如果您的提示是彩色的,您可能需要禁用 eshell-highlight-prompt
。