我想知道是否可以在eShell(Emacs Shell)中仅显示最后一个目录。例如,它目前位于路径/home/user/Programming/C++
中。使用eshell的当前设置~/Programming/C++ $
,但我只想显示:C++ $
。
由于
答案 0 :(得分: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.