[Top][All Lists]

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

"CR" in PS1, doesn't reset "col" to 0

From: Linda Walsh
Subject: "CR" in PS1, doesn't reset "col" to 0
Date: Wed, 24 Jan 2007 12:22:30 -0800
User-agent: Thunderbird (Windows/20061207)

I recently changed my PS1 prompt to set the title and icon text in the tty frame window to "address@hidden"; I wanted to put it in my PS1 as it catches "everything" -- from sudo/su to root (changes to address@hidden), to when I type "control-d" to exit a su script or log off a remote system -- the title maintains the correct address@hidden combination for non-local logins.

Problem has to do with ...I'm guessing (?) readline's idea of the Column.

Of course it doesn't know how "non-printing" (or text that doesn't generate a physical position as in the set-icon+title function). So I thought that it should be able to understand that a "CR" would return/reset the column to zero. That way it could correctly compute what column it was in.

Unfortunately it doesn't seem to work -- on "longer" lines -- those that are around 15-16 chars from end of line (set icon text is ~15-16 chars:
"\033]1;address@hidden").  I added the "CR" after the "\007" (hoping to
reset bash/readline's idea of the prompt-column to 0 at that point).

Is there a different way to do what I'm trying?  A different
"column reset" sequence known to bsh or rl?  Or a "PrePs1" type ENV var
that could be printed before the prompt with either it being the
user's responsibility to leave the cursor at col-0, or bsh/rl could
try to enforce by issuing a CR after the "pre-prompt" string, but
I don't know of any such mechanisms...



reply via email to

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