0

我想知道是否可以只显示 eShell(Emacs Shell)中的最后一个目录。例如,它当前在 path 中/home/user/Programming/C++。使用当前的 eshell 设置~/Programming/C++ $,但我只想显示以下内容:C++ $.

谢谢

4

1 回答 1

1

Yes, it's possible - the prompt is generated by function stored in the eshell-prompt-function variable. You can redefine it to whatever you want. You can define it something like: (lambda () (concat (car (last (split-string (eshell/pwd) "/"))) " $ "))

See EmacsWiki for examples.

于 2017-10-30T15:30:49.933 回答