Maybe not what you're looking for exactly, but I have a script to add a string to the beginning of the bash prompt. It's called shellname.sh
and looks like this:
#!/bin/bash -x
if [[ -z "$ORIG_PS1" ]] ; then
export ORIG_PS1="$PS1" ;
fi
export PS1="($1) $ORIG_PS1"
Then I can call source ~/testname.sh "Shell Name Here"
. Note that you have to use source
instead of running it directly so it can effect the local environment. For example:
stokastic@home:~/test#
stokastic@home:~/test# source ~/shellname.sh "build shell"
(build shell) stokastic@home:~/test#
(build shell) stokastic@home:~/test# echo "now my shell name is on the left"
now my shell name is on the left
(build shell) stokastic@home:~/test# make
byobu
, a wrapper forscreen
andtmux
. It can use custom scripts to set the status, so while the status is not directly editable, you could use simple shell scripts to get close.