Terminal prompt string change not persistent

I'm running Zorin OS 18 Pro on a Lenovo Thinkpad laptop. The Terminal shell prompt string on my Lenovo laptop is:
username@username-Thinkpad-X1-Carbon-Gen-9:~$

I created/edited .bashrc in my home directory root and added the following line:
PS1='[\u \w]$'
Then I ran the command "sudo source ~.bashrc" (witout the quotes) and the prompt changed as expected.

However, when I restart Terminal, or logout/login, the Terminal prompt string reverts back to:
username@username-Thinkpad-X1-Carbon-Gen-9:~$

How can I make my original change permanent?

You could try it with Starship. It is for customizing Bash (and others). You need a bit playing and Trying with it. But when You only wnat change that, You don't need to customize much.

in the original .bashrc you need to put your prompt after

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)

and comment the original prompt like this

# PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.