0
votes
2answers
20 views

Bash prompt coloring not appearing correctly

I had a functioning Bash prompt colored how I wanted it, but after reinstalling the background is gray rather than black like this setting should make it. My PS1 is \[\e[33;40m\]\T ...
0
votes
0answers
39 views

Bash Prompt : incorrect time displayed

Using the following prompt: export PS1="\n[$(date +%d-%m-%Y)] \u@\h [\t]\n{\w} [\!] # " and with TZ to my timezone : echo $TZ = America/Montreal The time on the prompt is OK at the start of a ...
0
votes
0answers
21 views

Customized bash prompt (PS1) issues when text moving to next line and back.(word wrapping) [duplicate]

I'm using a customized prompt which includes and output of a "case" script and also colors it. When the text is colored I'm having line wrapping issues, when I remove the color - the issue is gone. ...
0
votes
2answers
44 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 }'` ...
0
votes
0answers
33 views

how to list all CNAMEs of the current server in the bash prompt?

I have servers with a generic names (e.g. eu1.example.com) which has a set of useful CNAME (e.g. mail.example.com, rocket.example.com). How can I list the CNAME in a bash prompt, to go from ...
0
votes
1answer
69 views

How to change bash prompt?

I'd like to change my bash prompt when I login. But even after I change .bashrc and re-login, it still prompts the old one. What goes wrong please? I want to get [\u@\h \W]\$ but I get \s-\v\$ for ...
3
votes
1answer
42 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 ...
1
vote
2answers
42 views

Subdirectories in prompt?

I'm working on making my prompt as useful as possible. Right now, it contains the date, time, and directory, along with a colored divider line so I can easily see where each batch of input starts. I ...
0
votes
2answers
91 views

Sending special bash characters to a custom function

I read this great article on customizing the bash prompt: http://blog.superuser.com/2011/09/21/customizing-your-bash-command-prompt/ I also read about using 256 colors in bash: ...
2
votes
1answer
115 views

Line wrapping issues in bash/php

I am writing a program that prints colored lines, and the more I do with it the more I find myself working around line wrapping issues that come up. It is a sort of terminal written in php, here is ...
1
vote
3answers
87 views

Is it possible to have environment variables in the path of the working directory : PS1?

I am on Lubuntu and I am using bash. My PS1 (in .bashrc) is : PS1="\w> " I like it because I need to paste the working directory all the time. The problem is that the path is always very long ...
1
vote
1answer
82 views

Custom prompt doesn't work on Mac's terminal

I like to use a custom prompt (current path in blue) on my unix machine: export PS1='\[\e[0;34m\]\w \$\[\e[m\] ' But when I try to use it on Mac's terminal it doesn't work: it fails to detect the ...
2
votes
2answers
225 views

Custom prompt doesn't work on Mac Terminal

I like to use a custom prompt (current path in blue) on my unix machine: export PS1='\[\e[0;34m\]\w \$\[\e[m\] ' But when I try to use it on Mac's terminal it doesn't work: it fails to detect the ...
0
votes
0answers
80 views

Why is a “-1” appearing on right side of my zsh Terminal prompt?

Screenshot here I recently switched over from bash to zsh for my Terminal shell, however after using it for about a week this "-1" started appearing on the right hand side of my window. It get's ...
2
votes
1answer
641 views

colorized bash prompt overwrites previous command's output if the output doesn't end with a newline

On my system, when using a colorized prompt, the last line of the previous command's output gets overwritten if the last character of the output isn't a newline. Ex: Using the default, non-colored ...
1
vote
1answer
402 views

Make Bash's PS1 show original directory name and not symlink?

I currently have PS1='\W' but when in a symbolic link'd directory, the prompt shows the symlink name, how can I make PS1 to show the original directory name?
12
votes
5answers
2k views

Which directory does path `//` represent in Linux?

When I want to go back to upper level directory in Linux by typing cd .., I typo-ed cd //. To my great surprise, no errors are reported. What's more the prompt becomes username@hostname://$. ls ...
1
vote
2answers
328 views

How can I limit the number of directories in my prompt?

On my Mac OS X 10.6, I have my prompt set to PS1='\[\033[01;32m\][\w\[\033[00m\]\[\033[01;34m\]$(__git_ps1 " (%s)")\033[01;32m\]]\[\033[00m\]\$ ' How can I limit the number of directories in my ...
5
votes
2answers
1k views

Get current window number for bash prompt

I want to replace status bar with bash prompt displaying window number like ①. How can I get current window number in the shell? There's TMUX_PANE env variable, unfortunately no TMUX_WINDOW. The ...
4
votes
1answer
271 views

Why does this bash prompt sometimes keep part of previous commands when scrolling history?

My bash prompt, which I'll admit to have stolen from a few places and cobbled together, will sometimes add part of previous commands to its length when scrolling the bash history with up/down arrows. ...
0
votes
1answer
299 views

How can I remove new line character in prompt?

As you can see in the screenshot, I have an unneeded newline character in my prompt. Anyone know how to do remove this character from my prompt?
1
vote
2answers
342 views

Bash prompt output colors change after first 2 lines of output

I customized my bash PS1 prompt with this ~/.bashrc file. I can't seem to figure out why my output colors change after the first 2 lines of output. Any ideas what could be causing the issue?
1
vote
2answers
1k views

How to fix my bash prompt with long lines?

I have the following bash prompt: YELLOW="\[\033[0;33m\]" GREEN="\[\033[0;32m\]" RESET='\e[0m' export PS1="$GREEN[\W]$YELLOW \$(__git_ps1 \"(%s) \")$RESET\\$ " It looks like this: Which is what ...
6
votes
1answer
289 views

Custom prompt botched during history and control-a in OS X's Terminal.app using Bash

I customized my prompt in .bash_profile to look like this: export PS1="\w \e[0;32m\$(vcprompt -f '[%n:%b]')\e[m\$ " Now, when I press up arrow to go back through history, find the one I want, then ...
2
votes
2answers
2k views

~/.profile not being executed when Terminal opens? [OS X 10.6.8]

Somehow my bash prompt got changed to "elementary:~ steven$" and I want to change it back to the default prompt. I've added the following first to ~/.bashrc then to ~/.profile: export PS1="\s-\v\$ " ...
0
votes
1answer
193 views

FreeBSD 8.2: Keystrokes in Bash do not show up

I just installed the latest FreeBSD 8.2 distro using Parallels Desktop. Problem: Whatever I type in the Bash/Shell it is not echoed on the screen. It's behaving like a password prompt. As soon I hit ...
10
votes
2answers
1k views

Escape non-printing characters in a function for a Bash prompt

In a Bash Prompt (PS1 variable), I'm calling a function to potentially add text to the prompt: export PS1="\u@\h \$(my_function) \$ " However, the function in the prompt contains ANSI color codes ...
1
vote
1answer
164 views

Bash Prompt Loses Characters

After writing a new prompt for Bash, I noticed that one character of my commands were being lost when it wrapped to the new line. Here is an image of the example (I typed 1234567890 over and over): ...
4
votes
2answers
374 views

Is it possible to get bash to display the first letter of each directory in my working path?

For example working in: /home/stuart/src/project/com/example/package /usr/lib/python2.6 would appear as: ~/s/p/c/e/package$ /u/l/python2.6$
1
vote
1answer
348 views

Bash prompt breakdown

Can anyone explain the Ubuntu's bash prompt? It's basically username@box:~$ but the part that confuses me is $. Is it just a letter that can be of preference, or it has some actual meaning?
4
votes
2answers
374 views

Do I need to enclose ANSI escape sequences in \[ and \] in a bash prompt?

I want to customize my bash prompt using ANSI escape codes and have noticed that in some howtos the codes are enclosed in \[ and \] while in others they aren't. For example, these work equally well ...
3
votes
1answer
947 views

Bash command prompt overwrites the current line

My bash command prompt is: \e[32;1m[\e[m\h.\u \e[33;1m\W\e[m\e[32;1m]\e[0;36m::\e[m There must be something wrong with it, because on long lines, the current line is overwritten, instead of ...
1
vote
2answers
466 views

In GNU Screen, Recalled bash history command displays one character position to the left of actual location

I am running Red Hat 5 32-bit (2.6.18-194.26.1.el5). The issue is that when I recall any previous command in bash's history, the first character in the command is displayed immediately after the ...
4
votes
1answer
101 views

Force prompt on specific directories

Is there a way to change the prompt on a different directories on the same machine? For example, I want a simple prompt "[\W] \$" in development directories. Ideas?
7
votes
8answers
4k views

Pushing my PS1 prompt over ssh

I use a specific PS1 prompt that I like. I share a few logins with other other people on a few different servers. I was wondering if there was a way to specify in my local bash profile a remote prompt ...
7
votes
3answers
4k views

Lightning bolt for prompt (PS1)

I've seen on a few screencasts a while back where someone had a lightning bolt instead of $ on the bash prompt. Does anyone know how to do this?
2
votes
1answer
2k views

How to correctly set GNU Screen to display currently running program in hardstatus

In bash, to display the name of the current program in the GNU Screen hardstatus line takes only two configuration lines. First, tell screen what the end of your prompt normally looks like, and supply ...
2
votes
1answer
316 views

How can I minimise my Bash shell prompt?

Currently the terminal prompt looks like this: [karlis@karlis-desktop current_folder]$ How can I minimize the prompt, so that it only shows $ or # without extra info in square brackets? I checked ...
7
votes
5answers
20k views

How can I display the absolute path in bash prompt?

I currently have my bash PS1 set to something like this: PS1="\[\`if [[ \$? = "0" ]]; then echo '\e[32m\h\e[0m'; else echo '\e[31m\h\e[0m' ; fi\`:\w\n\$ " How can I make it show the absolute path ...
1
vote
2answers
445 views

How to highlight current folder in Bash prompt?

I'd like to use the \w variable in .bashrc, but I want the prompt to highlight the current end-directory. Something like this: /usr/local/<strong>bin</strong> How can I do that?
3
votes
2answers
1k views

How to make bash update its idea of hostname

My bash prompt shows my hostname. If I change my hostname with the hostname command, in /etc/hosts, /etc/hostname and $HOSTNAME, the prompt still uses the old name. Is it possible to update this ...
3
votes
1answer
188 views

Why is my bash prompt repeating its last line twice, when I ls, or cd or issue misc commands?

My prompt is such: PS1="\[\033[32m\]\u@myserver\n\[\033[33m\w$\033[0m\] " So as output after I ls i see this: jake@myserver ~/public_html$ ~/public_html$ When I should only (I think) see: ...
1
vote
1answer
533 views

ANSI prompts messed in Ubuntu 10.04 terminal window (Unicode 0002), but ok in Putty

My bash prompt is: PS1='\e[1;31m\]\[\u\e[0m\]@\h [\e[1;33m\]\w\[\e[0m\]]\$ ' (reddish username, yellowish current directory). If I connect with Putty from a Windows machine, everything is fine. If ...
2
votes
1answer
213 views

'sourcing' from the bash prompt

I have a little script that sets my proxy system wide in one go, it calls gconftool-2, sets a proxy in ~/.ssh/config and sets the proxy for apt. This is all relatively simple. The real problem comes ...
10
votes
4answers
6k views

How do I fix my prompt in emacs shell-mode?

I'm doing some programming on a colleague's machine. He has a version of emacs (23.1.1) I haven't used before. My problem is that when I go to shell-mode, my bash prompt looks like this: ...