You are not logged in.

#1 2016-10-06 07:35:14

MisterMustafa
Member
Registered: 2016-10-06
Posts: 4

Weird escape character problem with gnome-terminal and guake

Hey guys, not really a newbie but I don't know where to put this. I've been using Arch for about five years now, normally I can work out my issues, but this one has me a little confused.

I'm having a weird problem with escape sequences in PS1, specifically with gnome-terminal and guake.

I'd google it, but I have no idea what this is called. It seems to be printing the escape sequences as a character.

Any ideas?

https://s9.postimg.org/7eqdo3m7j/Screen … _15_33.png

Offline

#2 2016-10-06 07:38:56

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: Weird escape character problem with gnome-terminal and guake

Read the Code of Conduct and only post thumbnails http://wiki.archlinux.org/index.php/Cod … s_and_code and post your .bashrc


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2016-10-06 07:44:03

MisterMustafa
Member
Registered: 2016-10-06
Posts: 4

Re: Weird escape character problem with gnome-terminal and guake

~/.bashrc

PS1="\e[0;32m\]\u@\h \w >\e[0m\] "

Offline

#4 2016-10-06 14:50:53

Vain
Member
Registered: 2008-10-19
Posts: 183

Re: Weird escape character problem with gnome-terminal and guake

It should read:

MisterMustafa wrote:

PS1="\[\e[0;32m\]\u@\h \w >\[\e[0m\] "

\[ and \] are used around any non-printable sequences, such as color codes.

Now, while this fixes the bug, I'm still a bit confused as to why gnome-terminal shows a "0002". That would indicate a byte with the value "0x02". I don't see such a byte in your $PS1. It appears a "0002" is printed instead of "\]".

A little riddle.

Offline

Board footer

Powered by FluxBB