You are not logged in.

#1 2015-02-22 02:11:38

subverted
Member
Registered: 2013-12-23
Posts: 31

[solved] help with bash prompt script

i wrote a bash prompt script (code below) and if i type over 26 chars the text lapses over it self. it's the weirdest thing. if anyone can figure it out i'd greatly appreciate it!

PS1='\[\e[m\]\e[1;37m╭─[\e[1;30m\u\e[1;36m@\e[1;30m\h\e[1;37m]\[\e[0m\]\[\e[1;37m\e[1;36m✖\e[1;37m(\e[1;30m\w\e[1;37m)\n\[\e[m\]\e[1;37m╰─[\e[1;37m\e[1;30m\@\e[1;37m]\[\e[0m\]\e[1;36m➜\e[0m '

Last edited by subverted (2015-02-22 03:45:21)

Offline

#2 2015-02-22 03:13:28

mkoskar
Member
Registered: 2014-07-16
Posts: 64
Website

Re: [solved] help with bash prompt script

First please always enclose all code in proper BBCode markup.

Regarding prompt every non-printable character (hence all terminal control sequences) has to be enclosed properly:

\[     begin  a  sequence of non-printing characters, which could be used to embed a
       terminal control sequence into the prompt
\]     end a sequence of non-printing characters

I think you don't do that.

Offline

#3 2015-02-22 03:44:56

subverted
Member
Registered: 2013-12-23
Posts: 31

Re: [solved] help with bash prompt script

mkoskar wrote:

First please always enclose all code in proper BBCode markup.

Regarding prompt every non-printable character (hence all terminal control sequences) has to be enclosed properly:

\[     begin  a  sequence of non-printing characters, which could be used to embed a
       terminal control sequence into the prompt
\]     end a sequence of non-printing characters

I think you don't do that.

thank you very much!

Offline

Board footer

Powered by FluxBB