Murph9000 wrote:
Thank you again.
Thanks for the suggestion Murph9000. What I want is to have user@host: (Current working Directory) as the title of the terminal and "$ " as the prompt for the shell. Your solution is only addressing what happens to the shell prompt. That problem I have already solved. It is actually the default behavior at least in the version of Raspberry Pi OS I am running.It's unclear to me why you are persisting with the more complicated PROMPT_COMMAND solution, instead of the simpler PS1 solution, but you just need a little bash magic parameter expansion:
Code: Select all
murph@raspberrypi:~ $ title_prompt='\u@\h: \w'
murph@raspberrypi:~ $ echo ${title_prompt@P}
murph@raspberrypi: ~
murph@raspberrypi:~ $ cd tmp
murph@raspberrypi:~/tmp $ echo ${title_prompt@P}
murph@raspberrypi: ~/tmp
murph@raspberrypi:~/tmp $ cd /etc
murph@raspberrypi:/etc $ echo ${title_prompt@P}
murph@raspberrypi: /etc
murph@raspberrypi:/etc $
Thank you again.
Statistics: Posted by cimpi — Fri Sep 27, 2024 4:59 pm