I have played around with PS1 and PROMPT_COMMAND in bash to create a zsh-style right side prompt. I have a solution who almost works.
The problem is that if I write a long line of input, the second line overwrites the first one.
I changed my bash prompt to this:
PS1="\[\033[1;31m[\[\033[1;33m\$(date +%H:%M)\[\033[1;31m] \u:\[\033[1;32m\W\[\033[1;37m\$\[\033[0m\] "
Sorry for the long line, it is mostly due to colors. Basically when I hit the up arrow to go back in Bash history the prompt disappears and everything screws up.
It is similar to this question but I don't know if a \[
is missing and where.
For tcsh, I have a prompt that is multiline:
set prompt = "%/\\
%n@%m[%h]% "
This shows the cwd on one line and then the user/host on second line.
I added this command to my root .bashrc file to add color to my prompt
and to simplify its path portion to the lowest level directory,
Code:
export PS1="\e[1;31m\u@\h:\W\$\e[m "
and my bash prompt comes up ending with $ when I expected #.
Also, occasionally, when I enter a command, part of that command
becomes part of my prompt!
If the following is a prompt and command,
Code:
In the next couple lessons here at Nocturnal Slacker v1.0 we'll be discussing the Bourne Again Shell (BASH) in a bit more detail.With that in mind, though, how 'bout we play around with a neat trick that will customize your BASH prompt whenever you go to the command line? Sound like fun? OK, here we go...There's a file in your /home/<your_username> directory called .bashrc.
I'm trying to configure bash to display the current git branch, based off the example here, but I can't figure out how to get bash to stop escaping the colour strings.
Hi All,
So I recently started learning Ubuntu and playing with the terminal (I'm using Unix Power Tools, is it a good book?), and I'm stuck on the first thing that I got to ,which is to modify the prompt of the shell.
I typed
$ echo $SHELL
and
$ printenv SHELL
just to make sure I did indeed have bash shell.
Often when I start looking at history of commands some of chars from command displayed aren't erased, for example:
Whats happening:
prompt$ some_command
prompt$ some_commanother_command
What should have happened:
prompt$ some_command
prompt$ another_command
I can't erase those chars and bash ignores them when executing command, also they disappear when new prompt is being displayed (after p
Introduction
This is a compendium of five good bash prompts I've found all over the web in a long time frame, and have been archiving them and using one and other though the time.
I want now to share them with you, you may probably know some of them as they are taken all over the web.
Two lines bash prompt with full path info
This is one of my favorites, I like minimalism, so this one only have th