CLI off-topic

rado84

Well-Known Member
Joined
Feb 25, 2019
Messages
1,090
Reaction score
930
Credits
8,403
In another topic @osprey said this:

Maybe the following works. It works with bash on debian here as shown on the command line. For persistence the PS1 code can be placed in .bashrc.
Code:
[ben@computer ~]$ PS1="[rado@resist] $"
[rado@resist] $

I decided to open a new topic, bc that other topic became a pool of off-topic. Whereas here in the CLI off-topic, we can discuss anything without clogging other topics.

Osprey's method (thanks for the idea, btw!) lacks something and PS1 simply takes the color of the regular text. So I asked an AI how to make it like the original. The AI gave me this code for ~/.bashrc (I put this at the very end of the file) which uses the user-defined colors in the terminal, so now it's practically indistinguishable from the original and nobody knows that the hostname is still "arch". :)

Code:
# Custom resist prompt in terminal, using the colors set by the user in the terminal config
PS1="$(tput setaf 2)[rado@$(tput setaf 7)resist$(tput setaf 2)]$(tput setaf 15): $(tput setaf 7)\w$(tput setaf 2)>\$$(tput sgr0) "

Picture_created_15-06-2026_00-28-44.png


terminal-colors.png
 




Follow Linux.org

Members online


Latest posts

Top