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?
Asked
Active
Viewed 246 times
1

siery
- 241
- 2
- 13
-
Just as idea: Have you tried uppercase "W" (works for me)? – kai-dj Feb 12 '18 at 04:13
-
No, its still the same problem, I can see the string as I typed in to `PS1` not it's execution. – siery Feb 12 '18 at 04:36
-
Oh, I missed the *shell*-part. "works for me" only in term (stupid me- sorry it's late here ^^) – kai-dj Feb 12 '18 at 04:47
1 Answers
2
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.

phils
- 48,657
- 3
- 76
- 115