Questions tagged [ps1]

DO NOT USE this tag for questions about PowerShell scripts, use [powershell] instead. Questions about the BASH shell's PS1 (Prompt String 1) input prompt facility.

DO NOT USE this tag for questions about PowerShell scripts, use [powershell] instead.

Questions about the BASH shell's PS1 (Prompt String 1) input prompt facility.

222 questions
0
votes
0 answers

git ps1 is very slow in GNU-Screen

I have my custom PS1 on my virtual machine ( Vagrant / ubuntu-13.10 ), which works perfectly when I ssh to the machine. But when I run GNU-Screen to have multiple screens I loose that, which is normal (as ~/.bash_profile is not being called at…
Majid
  • 2,845
  • 3
  • 15
  • 14
0
votes
1 answer

Console2 not using PS1 colours

I am using Cygwin in Console2 with the following PS1 export PS1='\[\e]2;\w\a\e[1;32m\e[40m\n\w\n\d - \@ > \[\e[0;00m\]' The prompt has the correct text content, but all the colors are ignored. ~/wd Tue Mar 18 - 01:14 PM > Screenshot showing…
Robert Mark Bram
  • 8,104
  • 8
  • 52
  • 73
0
votes
5 answers

What directory is the default bash directory

I am using the bash console for Ubuntu and my console location is user@MyServer:~$ If user@MyServer:/$ is the root directory, what is user@MyServer:~$ ?
Andrew
  • 1,696
  • 2
  • 16
  • 20
0
votes
1 answer

Linux command line issue with prompt

I started to manage a new server based on CentOS. I wanted to change the prompt, so I wrote the following command : PS1="\e[0;36m[`pwd`]\$\e[m " It worked perfectly. But since I got an annoying issue. When I write something quite long, or displays…
Jeremy Belolo
  • 4,319
  • 6
  • 44
  • 88
0
votes
4 answers

How do I remove this space in this sed regex?

I have a script from a coworker that formats my prompt. It grabs my branch and formats with the code below using sed (note I hardcoded the branch name for testing): echo "* master" | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \1 /' In an effort to learn…
Kelly
  • 619
  • 8
  • 18
0
votes
2 answers

Trimming PS1's working directory path

Is there a way to get my ubuntu command prompt to be something like: user@host:home$ but still have the behavior of: user@host:home$ cd projects user@host:home/projects$ Right now, my working directory path before the home directory is cluttered…
rdav
  • 1
0
votes
1 answer

How to generate PS1 in a function (escaping issues)

I'd like to move my bash prompt's construction into a function that can build it up modularly. The problem is that I cannot figure out how to get the function's result to be interpreted. Example: function build_prompt { echo "\@" } export…
Joshua Cheek
  • 30,436
  • 16
  • 74
  • 83
0
votes
1 answer

Custom PS1 not showing the current working directory

I have customized the primary prompt for bash shell but unfortunately it is not showing the current working directory as can be seen below. [cifsamidala]w# pwd /home/Vinod/SearchIdIssue [cifsamidala]w# Here is what I have customized my PS1:…
Vinod Yadav
  • 359
  • 1
  • 5
  • 13
-1
votes
1 answer

Maintainable approach for generating a machine-specific PS1 Prompt

To help myself remember that I am logged into a different system, quickly and visually, I use different colors for the \h field in the Bash PS1 environment variable. I am looking for a way to reliably generate the PS1, tied to a static…
Jameson
  • 6,400
  • 6
  • 32
  • 53
-2
votes
1 answer

How to fix my PS1 and after I messed it up

I wanted to customize my terminal and one of the things I did was install zsh and made zsh my default shell (on iterm2). Now I wanted to customize my ps1. Following online tutorials, I edited my ~/.bash_profile and added the line PS1 = "\h:\W" Then…
hferaidon
  • 29
  • 4
-2
votes
2 answers

Why is the super simple fuction not displaying 256 colors in my Mac terminal?

Long time Mac (read GUI) user who recently started running Ubuntu and has spent a week or so customizing my .bashrc (Ubuntu) file and .bash_profile (Mac) for informative and colorful PS1 and terminal output. I've got this tiny little…
iMattux
  • 3
  • 2
-3
votes
1 answer

Programming environment?

I'm trying to add color to a part of my Ubuntu bash prompt. This part isn't working: (\e[0;31m\1\e[m) It works, however, if I place it within the PS1 export. What am I doing wrong? show_git_branch() { git branch 2> /dev/null | sed -e '/^[^*]/d' -e…
Gary
  • 909
  • 9
  • 26
1 2 3
14
15