ps1 Questions
3
Solved
13
Solved
I am using Ubuntu and I am tired of this long prompts in bash when I am working with some deep directory hierarchy. So, I would like to tweak my PS1 to shorten the working directory part the follow...
4
Solved
Newbie question, I recently changed my PS1 into this:
RESET="\[\017\]"
NORMAL="\[\033[0m\]"
YELLOW="\[\033[0;33m\]"
CYAN="\[\033[0;36m\]"
export PS1="\[$RESET\]\u@\h:\[$CYAN\]\w\[$YELLOW\]\$(__gi...
Scherman asked 1/9, 2013 at 14:34
2
Solved
I created an anaconda environment in a project folder specifying the path with -p option, i.e. not in the default anaconda3/envs folder:
conda create -p venv
The problem is that when I activate ...
Cityscape asked 16/6, 2019 at 13:36
2
Solved
Say I have this as my PS1
PS1='\[\e]0;TITLE\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$ '
it will give me this prompt
Steven@Steven-PC ~
$
with a window title as TITLE
I understand that this p...
5
Solved
I use zsh but not equipted with oh-my-zsh, since I cloned many git repos on my machine and oh-my-zsh's default theme or 'josh' theme makes it very slow, for cd and ls commands, etc.
Thus I delete ...
6
It seems that by executing code in PS0 and PS1 variables (which are eval'ed before and after a prompt command is run, as I understand) it should be possible to record time of each running command a...
Mister asked 4/4, 2017 at 7:48
1
Solved
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...
Hillard asked 8/3, 2022 at 18:30
1
Solved
$password = ConvertTo-SecureString “Password+++” -AsPlainText -Force
$Cred = New-Object System.Management.Automation.PSCredential ("Admin", $password)
$FileLocale = Split-Path -Parent -Pa...
Arrowroot asked 15/2, 2022 at 14:8
7
Solved
I have a shell script that runs the same command in several directories (fgit). For each directory, I would like it to show the current prompt + the command which will be run there. How do I get th...
21
Solved
I'm trying to change my command promt in terminal. I keep getting the error:
-bash: __git_ps1: command not found
I've tried it just by typing it into the terminal as is: __git_ps1. I've also tried ...
4
Solved
I am trying to set PS1 so that it prints out something just right after login, but preceded with a newline later.
Suppose export PS1="\h:\W \u\$ ", so first time (i.e., right after login) you get:...
3
Solved
This command succeeds
$ PS1='$(date +%s) $ '
1391380852 $
However if I add a newline it fails
$ PS1='$(date +%s)\n$ '
bash: command substitution: line 1: syntax error near unexpected token `)...
Knave asked 2/2, 2014 at 22:46
6
Solved
You can use \d in the your PS1 confuration to display a long date ie. Tues 18 May, but how can I get it to display it in a format like 18.05.2012 for example?
1
Solved
How can I edit the conda prompt's behavior without touching my normal prompt? I want to retain conda's prepend-to-PS1 behavior, but change the string that gets prepended.
The question how to modify...
1
My PS1 variable cannot parsed correctly, it looks like this,
\[\033[01;32m\]\u@\h\[\033[01;34m\] [\w]\[\033[00m\]
\[\033[01;32m\]\u@\h\[\033[01;34m\] [\w]\[\033[00m\]
\[\033[01;32m\]\u@\h\[\033[01...
6
Solved
1
Solved
My .bashrc:
# show a short way
shortwd() {
num_dirs=3
pwd_symbol="..."
newPWD="${PWD/#$HOME/~}"
if [ $(echo -n $newPWD | awk -F '/' '{print NF}') -gt $num_dirs ]; then
newPWD=$(echo -n $newPW...
2
I want to use an American flag emoji in my bash prompt (i.e. PS1 environment variable). However, the American flag emoji causes the terminal cursor to offset an extra character to the right.
🇺🇸 ...
6
Solved
The question is simple. I want to evaluate current value of PS1 in my bash script.
All materials on google point to tutorials on pimping it up, but I want to evaluate to see how would it be rendere...
2
How can I change the prompt of my zsh shell while still retaining the cool coloring that agnoster provides? For people who don't know, it looks like this
I want to add some things like ! and \u be...
8
Solved
I'm looking for a bash function that will shorten long path names to keep my PS1 variable from getting excessively long. Something along the lines of:
/this/is/the/path/to/a/really/long/directory/...
2
Solved
my current bash ps1 is as follows:
bldred='\e[1;31m' # Red
bldcyn='\e[1;36m' # Cyan
bldwht='\e[1;37m' # White
txtrst='\e[0m' # Text Reset - Useful for avoiding color bleed
export PS1="\n\[$bldred...
2
Solved
\h is a bash prompt escape sequence that expands to the hostname. Where does it get the hostname from? On my system it shows a value that I cannot find anywhere, not in hostname -f or /etc/hosts or...
5
Solved
Consider this PS1
PS1='\n${_:+$? }$ '
Here is the result of a few commands
$ [ 2 = 2 ]
0 $ [ 2 = 3 ]
1 $
1 $
The first line shows no status as expected, and the next two lines show the
cor...
Enchilada asked 9/12, 2014 at 17:10
1 Next >
© 2022 - 2024 — McMap. All rights reserved.