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
3
votes
1 answer

set both PROMPT_COMMAND and PS4 (having date at command launch and tricky printed path)

I am trying to display the date of execution of my command. Thus I use PS4 bash environment variables giving here PS1="[\u@\h \W]\\$ " PS4=:\D{%F %T}: ; set -x what gives me the following prompt [user@host temp]$ \ls :2012-04-10 13:43:52: ls dir1 …
Sigmun
  • 1,002
  • 2
  • 12
  • 23
2
votes
1 answer

Bash Profile Setting not working for path - PS1

I've written the following bash profile settings…
Yeti
  • 841
  • 5
  • 26
2
votes
1 answer

bash: line wrapping with fancy PS1 that does positional echo'ing

I have something like this in my login script that keeps $foo in the top right of my terminal. It works, but with a caveat. If I type a really long command it doesn't wrap. (Well, it'll wrap if it's more than two lines long, but the 2nd line…
Norma Stitz
  • 89
  • 10
2
votes
1 answer

Why is PowerShell script pausing when prompted for input?

I successfully ran 3 commands in my PowerShell script shortcut but after running the last command it prompts the user for "y" or "N" and in my script I want to input "y" and press enter. After looking at other posts such as this I have tried to ECHO…
Dig Durr
  • 21
  • 1
2
votes
0 answers

How do I set the PS1 (prompt) macOS Monterey 12.6.2

How do I set the PS1 (prompt) in terminal on my macbook pro using Monterey 12.6.2. I am trying to have the prompt in terminal to display my current directory. In terminal and on the command line, I used PS1=\W and variations of that, but it is not…
2
votes
1 answer

replace match group using regex + powershell

I am trying to setup a PowerShell script that would replace a matching string from my GlobalAssemblyInfo.cs file. I am basically looking to update the Version number via powershell so I can do that in a post build automatically. Anyways, the input…
konrad
  • 3,544
  • 4
  • 36
  • 75
2
votes
0 answers

Gnome Terminal keeps appending prompt when window is resized

For some reason whenever I shrink my terminal window to be shorter than my prompt, it will start appending my prompts on to one another. Below are all the lines in my .bashrc file that are concerned with the PS1 environment…
2
votes
2 answers

Can't change sys.ps1 in IDLE

I've recently heard that you can change the prompt in python by changing variable sys.ps1. So I've decided to open IDLE, and write something like that: >>> import sys >>> sys.ps1 = ":::" However, that created a new variable and nothing changed…
2
votes
1 answer

Bash prompt changes when using arrow keys sometimes

When I use my terminal (iTerm 2 Mac) with my PS1 set to "\[\e[38;5;117m\W \e[39;38;5;104m\$\e[39;0m\] " and I use the arrow keys to go through my bash history it sometimes changes my prompt from ~ $ to just the first character of it and whatever…
2
votes
1 answer

get "svn info" to not complain if it's not in an svn folder

I'm tinkering with some bash scripting for the PS1 variable, to control my command line colors. One of the things i want to do is to put "(svn)" after the local folder name if i'm in an svn repo. How i'm trying to do this atm is with this function…
Max Williams
  • 32,435
  • 31
  • 130
  • 197
2
votes
2 answers

Conditional pwd in an PS1 definition

I want to display the current working directory in my prompt differently if I am in a symlink than not. I have this far: [[ `pwd -P` = `pwd` ]] && echo "\[1;31m\]$(pwd -P)" || echo "\[1;32m\]$(pwd)" will return the desired output but it will not…
user177800
2
votes
0 answers

Adding python version and pyenv virtualenv name to bash prompt?

I'm trying to achieve a PS1 that will output [3.6.5@BooksHerokuDjango ~]$ My .bashrc has this: export PYENV_ROOT="$HOME/.pyenv" export PATH="$PYENV_ROOT/bin:$PATH" if command -v pyenv 1>/dev/null 2>&1; then eval "$(pyenv init -)" fi eval "$(pyenv…
user6820969
2
votes
3 answers

Linux Script Command With PS1 Change

Saw one post here: Change PS1 after running the 'script' command but it didn't seem to answer the question. I am trying to have a script run the "script" command and also change the prompt (PS1) to indicate that the shell is now scripted. …
2
votes
2 answers

Bash - GIT small snippet for branch management

Stupid Saturday morning code snippet. I've found online a snippet code that allows me to get the current branch in PS1, wonderful! but... I'd like to have different colors based on the branch. I said, "You don't know anything about bash but should…
Dario
  • 755
  • 1
  • 7
  • 19
2
votes
1 answer

Bash - File local variables

I just wrote a small file to set my PS1 variable. This file is sourced from my .bashrc. Now I have a couple of questions regarding this approach. But first the code: setprompt: # Normal variables BOLD="$(tput bold)" RESET="$(tput…
user6105890