screen-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bash escape character troubles


From: Troy Curtis Jr
Subject: Re: Bash escape character troubles
Date: Mon, 16 Jul 2007 21:44:45 -0500

On 7/16/07, donothing successfully <address@hidden> wrote:
On 16/07/07, Jean Jordaan <address@hidden> wrote:

> > Why do both use PROMPT_COMMAND to output your prompts?
>
> I use it to set the window title as described here:

Oh, it appears I've completely misunderstood what you were trying to do!
Sorry.

I haven't been able to replicate your problems with gnome
terminal, my version is 2.14.2.

I don't get the example you provided:
http://lists.gnu.org/archive/html/screen-users/2007-07/msg00009.html

> """
> address@hidden:~$ echo $PROMPT_COMMAND
> echo -ne "address@hidden:${PWD/#$HOME/~}\033\\
> address@hidden:${PWD/$HOME/~}\033\\"
> """

shouldn't there be an '\033k' somewhere to start the escape
sequence off?

I tried defining a function to do the escaping and called it
from PROMPT_COMMAND:
"""
harry8~> function settitle() { echo -n -e '\033k'"$@"'\033\134'; }
harry8~> PROMPT_COMMAND='settitle address@hidden:${PWD/$HOME/\~}'
"""
which worked for me at least. ;-)

cheers
H.


_______________________________________________
screen-users mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/screen-users


I got it working with some help from do nothings suggestion.  I really
liked his suggestion of using a function to the escaping, it really
clears up what is going on.  Then I simply removed "134".  I had found
the original code I got this from which stated they were using "\134"
for "\" because of a bug in an earlier bash.

I had tried a similar thing before, but with everything defined
directly in the PROMPT_COMMAND line I ended up with "\$" which didn't
work and "\\$" didn't parse right.

Thanks donothing!

Now do you know what I might need to do to get those single tick
marks? (Actually I think they are forward tick marks that I have
problems with.) :)

Troy
--
"Beware of spyware. If you can, use the Firefox browser." - USA Today
Download now at http://getfirefox.com
Registered Linux User #354814 ( http://counter.li.org/)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]