Termux - Custom Prompt¶
Termux is a terminal emulator and Linux environment for Android. I wanted to customise my prompt in the same way that I have done on my desktop/laptop machines. Ordinarily I would have a .bashrc in my home directory where I would make the changes to the prompt (PS1). However Termux doesn’t recognise this.
I found a reference to configuring this: http://blog.ataboydesign.com/2015/12/01/termux-is-the-one-for-android/
Following this method the changes to PS1 are made in “/data/data/com.termux/files/usr/etc/bash.bashrc”. I had been successfully using this method for a while with no ill effects. That was until today when I realised an update to Termux had overwritten the changes. Not what I wanted.
1 2 3 4 5 6 7 8 9
# .profile if [ -n "BASH_VERSION" ]; then # Echo msg to indicate file is run - can be removed later echo "Profile load.bashrc" # include .bashrc if it exists if [ -f "$HOME/.bashrc" ]; then . "$HOME/.bashrc" fi fi
Create and edit “.bashrc” with any custom options. Exit and restart Termux and your custom configuration should be loaded.