I'm using, at the terminal on my android device, an simple approach to show the path to my location (export PS1="(\w)$ "
). However, the \w
seems to not be working in emacs shell emulator running inside termux. That is not really a problem, because I know where I am any time I run shell inside emacs. Is there some way to change default bashrc running by emacs, or just set PS1
variable to be "$ "
only for emacs?
You can use the INSIDE_EMACS
environment variable. If you genuinely want to restrict it to M-x shell
usage, then you might do something like:
case $INSIDE_EMACS in
*comint*) PS1="$ ";;
esac
I'd recommend figuring out which part of your system is responsible for it not working as expected, though.
Also: Your question was not quite a duplicate of Startup script for term-mode, but you should read that as well.
PS1
not it's execution. – siery Feb 12 '18 at 4:36