Change the color of the "small-thing-before-the-command-in-the-konsole" on kde

hello , i just want to customise my terminal a little bit and wanted to change the color of the small text (actually a little bit more evolved than the normal text on the kde console) with your working directory in it before the command , or configure it a little bit .
i dont have found parameters for changing it (but i’m really new with manjaro and i possibly missed something ) , so where and how did i change the color of this ? (and also where is the theme file or his equivalent of this terminal)
thanks for your help :slightly_smiling_face:

Welcome to the forum!

That “little bit of text before the command” is your shell prompt. Given that you are running the KDE edition, that shell will be bash, and defining the prompt and its appearance for bash is done in the file ~/.bashrc, by defining the $PS1 variable. Here’s an example… :arrow_down:

PS1="\[\e[1;33m\]\n[\h:\$(/usr/bin/tty)][\${PWD}]\n[\t][\u] \[\e[1;37m\]>\[\e[0m\] "
export PS1

The above two commands in ~/.bashrc ─ you’ll need to log out and back in, or close and reopen the terminal ─ will make your prompt bright yellow, and it will look like this… :arrow_down:

[nx-74205:/dev/pts/2][/home/aragorn]
[20:03:20][aragorn] > 

The string “nx-74205” in the above example is the hostname of my computer, and will of course be different on your own machine. Basically, what it shows me is… :arrow_down:

[ machine hostname: the terminal I'm logged into ] [ the current working directory ]
[ the time in a 24-hour format ] [ whom I'm logged in as ] > command_goes_here

The color codes are as follows… :arrow_down:

  • 32 = bright green
  • 33 = bright yellow
  • 34 = blue
  • 35 = pink
  • 36 = bright cyan
  • 37 = bright white

More information can be found in… :arrow_down:

man bash
3 Likes

ok thanks , that was rapid x)

1 Like

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