Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
0 votes
1 answer
103 views

Colored multiline PS1 losing track of where the beginning of the command is [duplicate]

my .bashrc: export COLOR_RST=$(tput sgr0) export COLOR_WHI=$(tput setaf 15)$(tput bold) export COLOR_gra=$(tput setaf 7) export COLOR_GRA=$(tput setaf 8)$(tput bold) export COLOR_BLK=$(tput setaf 16)$(...
onlycparra's user avatar
0 votes
1 answer
571 views

Unable to customize command prompt after installing oh-my-posh Theme on Linux CentOS

I'm using oh-my-posh theme to customize my terminal. I want to configure my command prompt adding more details but it doesn't work after installing the theme. Screenshot: Changing the command prompt ...
diogenes31's user avatar
0 votes
1 answer
756 views

Changing bash PS1 colors ruins bash command line [duplicate]

Hi I am using Fedora 37 and came across next problem. Adding export PS1="\e[43;39m[\t]\w\r\n[\u@\h]\\$\e[40m \[$(tput sgr0)\]" to my .bashrc file in /home/username in my case led up to this ...
GabrijelOkorn's user avatar
1 vote
1 answer
234 views

My ps1 line is changed when i logout and re login?

I have this in .bash_profile if [ -n "$TMUX" ]; then # called inside tmux session, do tmux things . ~/.profile fi # Trigger ~/.bashrc commands . ~/.bashrc # ------------------------...
sbh7600's user avatar
  • 45
2 votes
1 answer
2k views

Cannot change tab label in MobaXterm

I am using MobaXterm v20.6 and WSL2+Ubuntu 20.04 from Microsoft Store. I am trying to label the tabs defining PS1 like: PS1="\e]0;\u@\h\a\w #" but tabs are still labeled as "1. WSL-...
Vinod Gupta's user avatar
1 vote
1 answer
35 views

Bash PS1 dissappears after history browsing [duplicate]

I have been configuring my new fresh Arch installation. I just finished with my PS1 in Bash and realized about an error I do not know how to solve. This is the code: PS1='\n\[\e[30;44m \u@\h \]\[\e[34;...
aru-hackZ's user avatar
1 vote
1 answer
1k views

How to get the length of a prompt?

Is there a way that I can determine the length of a prompt? Is there a way that I can look at the PS1 variable and get the length from it and repeat characters for the same length? I am trying to ...
billsecond's user avatar
0 votes
2 answers
95 views

PS1 Customization

Just a quick one. Trying to modify my PS1 to show just a specific number of chracters. Currently : [email protected]@linuxhostname This is because I have just intergrated some systems in my ...
ChrisWatson's user avatar
5 votes
2 answers
2k views

Is there a command to get bash to print a new prompt string and redraw the current line?

Instead of waiting for slow commands to finish, I'd like to run them in the background. However, when they finish running and print to stdout, I get (where █ represents my cursor) this: $ slowcmd &...
Ari Sweedler's user avatar
0 votes
1 answer
1k views

Bash PS1 and single vs. double quotes

I'm a linux and Bash newbie and would like to ask help understanding the role of single and double quotes when assigning the PS1 env var. I wanted to set the terminal to always show the current ...
StoneThrow's user avatar
  • 1,207
0 votes
2 answers
176 views

Making PS1 prompt refreshable

I want my prompt to be changed based on an output of a certain command. and based on the command result to add a color. example: run the command: cphaprob stat | grep local | awk '{ print $NF }'` (...
AlonCo's user avatar
  • 3
0 votes
1 answer
538 views

Using \r in bash PS1

I was getting a little tired of my typeaheads in Bash from messing up the PS1. For instance, I would execute a command, like ls, and while it is running, start typing the next command, like echo, and ...
asmeurer's user avatar
  • 570
2 votes
2 answers
3k views

How to insert bash scripts inside the PS1 variable

I made a custom PS1 variable, which is a tremendously confusing. Here is the one that is closest to being fully working: PS1="\n[\e[1;31m]\u@\H[\e[35m] \@ [\e[32m] PWD: \w [\e[1;34m]This folder has ...
SOMN's user avatar
  • 1,121
0 votes
1 answer
958 views

Bash echo color as function output in PS1

I want my PS1 to display (if i'm in a git folder) the branch, and color the branch with red if working dir is dirty, and blue if it's clean. Here is what i came up to IBlack='\e[0;90m' # Nero ...
Francesco Zaffaroni's user avatar
3 votes
1 answer
925 views

bash's command number ( \# ) equivalent in zsh

I'm looking for a character to put in my zsh's $PROMPT that would be equivalent to bash's \# (the command number of this command, according to this site). So far I've found only %h but this is not ...
shrx's user avatar
  • 464

15 30 50 per page