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
2 answers

How the highlight text in PS1 environment variable

Currently my PS1 environment variable is displaying as shown below: The below image is what I would like my PS1 environment variable to display as: The below is how my PS1 environment variable is set as: export PS1='$LOGIN@'`hostname`':$PWD>…
Christopher Karsten
  • 387
  • 1
  • 2
  • 12
0
votes
1 answer

How do I color bash PS1 prompt from the result of a function

I want to set my PS1 prompt to the output from a function, but when I try to include ansi color sequences, bash will think the line length is longer than it actually is and mess up when you type enough after it to go to a new line. Here's what the…
Jake
  • 2,106
  • 1
  • 24
  • 23
0
votes
1 answer

when I try to move to previous command, it covers current dir root in iterm

Hi i'm new to command line interface on OSX. before I started to code, I changed bash color I like. #github branch show parse_git_branch() { git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' } #export PS1="\W \$" export…
gnujoow
  • 374
  • 1
  • 3
  • 16
0
votes
2 answers

Customize linux terminal PS1 variable in a function before starting a session

I often start a terminal session to servers from different tabs of my terminal. I would like to create a function that before starting the session it changes the title of the tab so that I can easily recognize which tab has which session open.…
aless80
  • 3,122
  • 3
  • 34
  • 53
0
votes
1 answer

Can I change the terminal's PS1 only when working in certain directories/sub-directories?

I would like to change PS1, but only if I am working in a particular directory. Is this possible, and how can I do this?
nikojpapa
  • 660
  • 1
  • 8
  • 16
0
votes
1 answer

PS1 Command - Bash

I am trying to get the PS1 command working with bash. What I am trying to do is capture the user's data and input it to change the field on the command line. I know the command is PS1="MadMike", but what I am trying to do is the captured data from…
MadMike
  • 9
  • 1
0
votes
2 answers

Preventing 'process completed' after bashrc function in OS X

In my .bashrc file, I have the following lines: alias cd='_cd' function cd() { cd "$1" PS1='[$USER] "$PWD" $ ' } However, after sourcing my .bashrc, every time I try to run the command, I get a process completed message, and I am locked…
0
votes
1 answer

a Trouble with Android Terminal

Why terminal IDE (a terminal emulator for Android) doesn't execute some .sh files on my rooted Android device?(the error is: "permission denied") I have typed this code in terminal: su sh dprompt.sh and "dprompt.sh" contains this code: export…
0
votes
1 answer

why my function does not execute in PS1?

get_git_branch(){ local branch__= git branch &> /dev/null if [ $? -eq 0 ]; then branch__=`git branch --no-color | sed -ne 's/^\* \(.*\)$/\1/1p' | tr a-z A-Z` else branch__="NORMAL" …
ggaaooppeenngg
  • 1,323
  • 3
  • 17
  • 27
0
votes
1 answer

__git_ps1 shows wrong branch

I'm getting an issue where the __git_ps1 script returns the wrong branch. First, I'll check my branches: ssalisbury@DOTWeb ssalisbury (master)$ git branch -a * master remotes/origin/HEAD -> origin/master remotes/origin/master Then I'll create…
smsalisbury
  • 345
  • 4
  • 15
0
votes
1 answer

Animated PS1 prompt BASH

I'm aware that this has been asked before but I couldn't find the answer I wanted anywhere. What I need (would like to have) is a BASH prompt that looks like this: [ blah@blah ] > [ blah@blah ] > [ blah@blah ] > (then the animation repeats) Its…
QuaDECH
  • 35
  • 2
  • 10
0
votes
2 answers

how to get the coordinate of cursor when setting PS1 variable for command line prompt?

I'm using Mac. I want to set PS1 variable to get current time at the end of line in command line prompt. Like this: or this: But, unfortunately, I can't get what I want through following configuration: CYAN="\[$(tput setaf 6)\]" GREEN="\[$(tput…
AngelIW
  • 23
  • 7
0
votes
1 answer

Custom PS1: usual PS1 for all directories excluding single directory with subdirectories

Consider fixed absolute path to some directory with arbitrary subdirectories: /full/path/to/fixed/directory /full/path/to/fixed/directory/first_subdirectory /full/path/to/fixed/directory/first_subdirectory/second_subdirectory and arbitrary other…
user1569844
0
votes
1 answer

Linux Terminal PS1

I am not sure if this is possible but I couldn't find the answer anywhere else or even people who have tried it but my current PS1 is this: export PS1="\[\e[00;32m\]??\[\e[0m\]\[\e[00;37m\]\n\[\e[0m\]\[\e[01;31m\]\d\[\e[0m\]\[\e[00;37m\] \[\e[0m …
Cuffuffles
  • 15
  • 2
0
votes
1 answer

Making the bash prompt smaller

Currently my Windows Git Bash shell prompt looks like this: UserName@ComputerName Path (Branch) When I echo $PS1, I get: \[\033]0;$MSYSTEM:\w\007\]\n\[\033[32m\]\u@\h \[\033[33m\]\w$(__git_ps1)\[\033[0m\]\n$ In my .bashrc file I tried to update…
Laoujin
  • 9,962
  • 7
  • 42
  • 69
1 2 3
14
15