Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Possible bug to RPROMPT
- X-seq: zsh-workers 32932
- From: "Felipe G. Silveira" <thezoc@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Possible bug to RPROMPT
- Date: Fri, 1 Aug 2014 05:20:25 -0300
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=VtiTC2XRkt22FsURzzJgmRSINHMDzBI5ummZBL/9pMM=; b=cJGbkKtOJkpNgJ1by6x88bQl5Gx3sa+kxgLyELgoZniixklX6YWHo5J1CWWMUwuFva X9mlWMBeimRTGmwu2ugRQWc6s67kFrE3tY01V8m5inPFjVee68rj/M0FIorQAAc1IDd2 rXZDefY0xvniNlZ0BujniUzGpqZlug2lapJzh7Y7KrJDLDcZkh7jTzoPcFzzmyxXtAow btJvYEwtUByGmELgVWdZuUalbRxo+4vWn2VyJeiR7JppuMNSorRvyrCZh7Gw1wZx4DKE 2tkPDqnTVGyfjQadSkk5Y5FH25weTJDulx1XK1LsoP28mlUWEb4MWNtTGshft8/oTKQv A1ig==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
Hello,
I've been tinkering with zsh for the past couple weeks, and I'm loving it!
But I think I hit a bug regarding the RPROMPT definition.
Since I setup my PROMPT so the information comes in one line and my cursor
below it, I was trying to align the RPROMPT to always appear 1 line before
where it generally is printed.
This is a bit confuse, but hopefully everything will clear up with an
example. So, lets suppose I have:
PROMPT='a lot of cosmetic and information stuff here.
{colors} > {reset colors}'
So I have a 2 line definition. this works fine.
so I tried
RPROMPT='< [current time]'
this works, BUT it's one line below form where I want it.
so after some tinkering, I decided to try some escape commands:
PROMPT=$'\e[s'$'\e[1A''< [clock] ''$'\e[1B'$'\e[u'
Where:
$'\e[s' - Save current cursor position
$'\e[1A' - go back one line up
<<render stuff between them >>
$'\e[1B' - go one line down
$'\e[u' - Restore cursor position
It worked! But... The cursor ends up on the far left side of the screen,
before any characters that are already printed. (so, in my example, it
would be before the > printed by PROMPT).
So.. is this a real (possible?) bug, or did I "abuse" too much from the
prompt parameters and broke it ?
Hopefully it's something that can be fixed!
Thank you in advance!
-Felipe
Messages sorted by:
Reverse Date,
Date,
Thread,
Author