You are not logged in.

#1 2009-09-17 19:11:21

ozeta
Member
Registered: 2007-11-01
Posts: 63

what is wrong with this .bashrc?

hi,  i wrote this .bashrc for my user:

PS1='[\e[0;34m\u\e[0m@\h \W/]\$ '

and the result is this:

ozeta@dolphin ~/]$

however, with many commands (like mplayer tv:// -tv driver=v4l2:width=640:height=480:device=/dev/video0 -fps 15 -vf screenshot), if i press the "up" key to view command history, i have troble like this:

ozeta@dolphin ~/]$ mplayer tv:mplayer tv:// -tv driver=v4l2:width=640:height=480:device=/dev/video0 -fps 15 -vf screenshot


i cannot understand what is the problem...:o

does anybody can help me with the script? thank you smile

Offline

#2 2009-09-17 19:13:03

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: what is wrong with this .bashrc?

any non printing characters must be espaced with \[ \].  like so:

PS1='[\[\e[0;34m\]\u\[\e[0m\]@\h \W/]\$ '

Last edited by brisbin33 (2009-09-17 19:13:46)

Offline

#3 2009-09-17 19:45:02

ozeta
Member
Registered: 2007-11-01
Posts: 63

Re: what is wrong with this .bashrc?

brisbin33 wrote:

any non printing characters must be espaced with \[ \].  like so:

PS1='[\[\e[0;34m\]\u\[\e[0m\]@\h \W/]\$ '

hi!

EDIT:

i'm sorry, i forget to restart my user...the code works fine, thanks a lot!! big_smile

Last edited by ozeta (2009-09-17 19:50:05)

Offline

#4 2009-09-17 20:24:10

Lich
Member
Registered: 2009-09-13
Posts: 437

Re: what is wrong with this .bashrc?

ozeta wrote:
brisbin33 wrote:

any non printing characters must be espaced with \[ \].  like so:

PS1='[\[\e[0;34m\]\u\[\e[0m\]@\h \W/]\$ '

hi!

EDIT:

i'm sorry, i forget to restart my user...the code works fine, thanks a lot!! big_smile

For future reference..when you change your .bashrc, there's no need to logout...just do `source ~/.bashrc`. That will read the rc file and apply changes immediatly


Archlinux | ratpoison + evilwm | urxvtc | tmux

Offline

#5 2009-09-17 21:17:43

Boris Bolgradov
Member
From: Bulgaria
Registered: 2008-07-27
Posts: 185

Re: what is wrong with this .bashrc?

Lich wrote:

For future reference..when you change your .bashrc, there's no need to logout...just do `source ~/.bashrc`. That will read the rc file and apply changes immediatly

For this terminal only.

Offline

#6 2009-09-17 21:39:14

Lich
Member
Registered: 2009-09-13
Posts: 437

Re: what is wrong with this .bashrc?

Boris Bolgradov wrote:
Lich wrote:

For future reference..when you change your .bashrc, there's no need to logout...just do `source ~/.bashrc`. That will read the rc file and apply changes immediatly

For this terminal only.

Correct, but newly spawned terminals will use the new settings aswell


Archlinux | ratpoison + evilwm | urxvtc | tmux

Offline

#7 2009-09-19 06:48:33

ozeta
Member
Registered: 2007-11-01
Posts: 63

Re: what is wrong with this .bashrc?

Lich wrote:
ozeta wrote:
brisbin33 wrote:

any non printing characters must be espaced with \[ \].  like so:

PS1='[\[\e[0;34m\]\u\[\e[0m\]@\h \W/]\$ '

hi!

EDIT:

i'm sorry, i forget to restart my user...the code works fine, thanks a lot!! big_smile

For future reference..when you change your .bashrc, there's no need to logout...just do `source ~/.bashrc`. That will read the rc file and apply changes immediatly

nice! big_smile

thanks! smile

Offline

Board footer

Powered by FluxBB