zsh-users
 help / color / mirror / code / Atom feed
* lining up RPS1 and PS1
@ 2005-06-06 10:18 Miek Gieben
  2005-06-06 10:35 ` Thorsten Kampe
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Miek Gieben @ 2005-06-06 10:18 UTC (permalink / raw)
  To: zsh users

[-- Attachment #1: Type: text/plain, Size: 878 bytes --]

Hello,

I've been looking into the RPS1 variable to spice up my prompt.
Currently my prompt looks like this: (it's a 2-line prompt)

[some info]
%

Now I wanted to make it look like this:
[some info]                  [some more]
%
(where RPS1="[some more]")

But as the PS1 includes a newline (to put the '%' on a seperate line)
the prompt looks like:
[some info]
%                            [some more]

Is there any way to make a RPS1 line up with the first part of the PS1
/and/ still have a newline in the PS1?

Thanks for any info!

[I could stretch PS1 and calculate the placement of '[some more]', but 
I really like the features of RPS1, like automatic placement.]

--
grtz,
  - Miek

http://www.miek.nl                      http://www.nlnetlabs.nl
PGP Key ID: 0xB18453A1
fingerprint: 002B B079 0DDA 7D44 2B5C  CAB0 C3B7 F943 B184 53A1

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: lining up RPS1 and PS1
  2005-06-06 10:18 lining up RPS1 and PS1 Miek Gieben
@ 2005-06-06 10:35 ` Thorsten Kampe
  2005-06-06 10:43   ` Miek Gieben
  2005-06-06 15:04 ` lining up RPS1 and PS1 Dan Nelson
  2005-06-06 15:23 ` Bart Schaefer
  2 siblings, 1 reply; 11+ messages in thread
From: Thorsten Kampe @ 2005-06-06 10:35 UTC (permalink / raw)
  To: zsh-users

* Miek Gieben (2005-06-06 11:18 +0100)
> I've been looking into the RPS1 variable to spice up my prompt.
> Currently my prompt looks like this: (it's a 2-line prompt)
> 
> [some info]
> %
> 
> Now I wanted to make it look like this:
> [some info]                  [some more]
> %
> (where RPS1="[some more]")

Not directly the answer you're waiting for: most people don't like
two-line-prompts and use it only because their shell doesn't have an
RPROMPT/RPS1.

So the classic use for you would be
%                  [some info]
or
%                 [some more] [some info]

Thorsten


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: lining up RPS1 and PS1
  2005-06-06 10:35 ` Thorsten Kampe
@ 2005-06-06 10:43   ` Miek Gieben
  2005-06-06 10:53     ` Thorsten Kampe
  0 siblings, 1 reply; 11+ messages in thread
From: Miek Gieben @ 2005-06-06 10:43 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 1050 bytes --]

[On 06 Jun, @12:35, Thorsten Kampe wrote in "Re: lining up RPS1 and PS1 ..."]
> * Miek Gieben (2005-06-06 11:18 +0100)
> > I've been looking into the RPS1 variable to spice up my prompt.
> > Currently my prompt looks like this: (it's a 2-line prompt)
> > 
> > [some info]
> > %
> > 
> > Now I wanted to make it look like this:
> > [some info]                  [some more]
> > %
> > (where RPS1="[some more]")
> 
> Not directly the answer you're waiting for: most people don't like
> two-line-prompts and use it only because their shell doesn't have an
> RPROMPT/RPS1.
> 
> So the classic use for you would be
> %                  [some info]
> or
> %                 [some more] [some info]

thanks for your answer. But this is indeed not answer I'm looking for :)

Changing my prompt in this way is too much of a change for my peace of
mind :)

--
grtz,
  - Miek

http://www.miek.nl                      http://www.nlnetlabs.nl
PGP Key ID: 0xB18453A1
fingerprint: 002B B079 0DDA 7D44 2B5C  CAB0 C3B7 F943 B184 53A1

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: lining up RPS1 and PS1
  2005-06-06 10:43   ` Miek Gieben
@ 2005-06-06 10:53     ` Thorsten Kampe
  2005-06-06 15:09       ` Gmane (Re: lining up RPS1 and PS1) Bart Schaefer
  0 siblings, 1 reply; 11+ messages in thread
From: Thorsten Kampe @ 2005-06-06 10:53 UTC (permalink / raw)
  To: zsh-users

* Miek Gieben (2005-06-06 11:43 +0100)
> [On 06 Jun, @12:35, Thorsten Kampe wrote in "Re: lining up RPS1 and PS1 ..."]
>> * Miek Gieben (2005-06-06 11:18 +0100)
>>> I've been looking into the RPS1 variable to spice up my prompt.
>>> Currently my prompt looks like this: (it's a 2-line prompt)
>>> 
>>> [some info]
>>> %
>>> 
>>> Now I wanted to make it look like this:
>>> [some info]                  [some more]
>>> %
>>> (where RPS1="[some more]")
>> 
>> Not directly the answer you're waiting for: most people don't like
>> two-line-prompts and use it only because their shell doesn't have an
>> RPROMPT/RPS1.
>> 
>> So the classic use for you would be
>> %                  [some info]
>> or
>> %                 [some more] [some info]
> 
> thanks for your answer. But this is indeed not answer I'm looking for :)
> 
> Changing my prompt in this way is too much of a change for my peace of
> mind :)

Well, okay. But see it like this: you're losing half of the screen/
/size/ for - probably - static information (meaning that "some
info"/"more info" doesn't change with every prompt).

And: please don't crosspost to .devel.

Thorsten


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: lining up RPS1 and PS1
  2005-06-06 10:18 lining up RPS1 and PS1 Miek Gieben
  2005-06-06 10:35 ` Thorsten Kampe
@ 2005-06-06 15:04 ` Dan Nelson
  2005-06-06 15:23 ` Bart Schaefer
  2 siblings, 0 replies; 11+ messages in thread
From: Dan Nelson @ 2005-06-06 15:04 UTC (permalink / raw)
  To: zsh users

In the last episode (Jun 06), Miek Gieben said:
> Hello,
> 
> I've been looking into the RPS1 variable to spice up my prompt.
> Currently my prompt looks like this: (it's a 2-line prompt)
> 
> [some info]
> %
> 
> Now I wanted to make it look like this:
> [some info]                  [some more]
> %
> (where RPS1="[some more]")
> 
> But as the PS1 includes a newline (to put the '%' on a seperate line)
> the prompt looks like:
> [some info]
> %                            [some more]
> 
> Is there any way to make a RPS1 line up with the first part of the PS1
> /and/ still have a newline in the PS1?

Simplest workaround would be to add escape codes to the start and end
of your RPROMPT that shifts the cursor up then back down:

RPROMPT="%{$termcap[up]%}Right Justified%{$termcap[do]%}"

Alternatively, take a look at the 'bart' prompt style, which is a
2-line prompt with right-aligned text on the top line.

-- 
	Dan Nelson
	dnelson@allantgroup.com


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Gmane (Re: lining up RPS1 and PS1)
  2005-06-06 10:53     ` Thorsten Kampe
@ 2005-06-06 15:09       ` Bart Schaefer
  2005-06-06 16:23         ` Thorsten Kampe
  0 siblings, 1 reply; 11+ messages in thread
From: Bart Schaefer @ 2005-06-06 15:09 UTC (permalink / raw)
  To: zsh-users

On Jun 6, 11:53am, Thorsten Kampe wrote:
}
} And: please don't crosspost to .devel.

He didn't cross-post.  I got only one copy of his message.

Although you're reading zsh-users via gmane.org's interface, zsh-users
is a mailing list, not a newsgroup.

And it happens that the maintainers of the zsh-users mailing list have
arranged for all messages sent to zsh-users to be sent to zsh-workers,
another mailing list.  This is so that the zsh developers don't have to
subscribe to both lists in order to see all the postings.

It happens that gmane is also mirroring the zsh-workers into a newsgroup
named, apparently, something ending in .devel.  That newsgroup is going
to get a copy of everything that's in zsh-users, whether its readers like
it or not.  Complain to gmane, or quit reading the non-.devel newsgroup,
but don't blame the people using zsh-users as a mailing list like it was
meant to be used.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: lining up RPS1 and PS1
  2005-06-06 10:18 lining up RPS1 and PS1 Miek Gieben
  2005-06-06 10:35 ` Thorsten Kampe
  2005-06-06 15:04 ` lining up RPS1 and PS1 Dan Nelson
@ 2005-06-06 15:23 ` Bart Schaefer
  2005-06-06 16:38   ` Miek Gieben
  2 siblings, 1 reply; 11+ messages in thread
From: Bart Schaefer @ 2005-06-06 15:23 UTC (permalink / raw)
  To: zsh users

On Jun 6, 12:18pm, Miek Gieben wrote:
} 
} Now I wanted to make it look like this:
} [some info]                  [some more]
} %
} (where RPS1="[some more]")
[...]
} [I could stretch PS1 and calculate the placement of '[some more]', but 
} I really like the features of RPS1, like automatic placement.]

The whole point of RPS1 is that it gets automatically hidden as command
input extends to the right into the space it occupies.  But with a two-
line prompt, your typing is never going to intersect with "[some more]".
So, really, putting it in PS1 is the right way to go about this.

However:

RPS1="%{$(echotc UP 1)%}[some more]%{$echotc DO 1)%}"


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Gmane (Re: lining up RPS1 and PS1)
  2005-06-06 15:09       ` Gmane (Re: lining up RPS1 and PS1) Bart Schaefer
@ 2005-06-06 16:23         ` Thorsten Kampe
  2005-06-06 16:42           ` Miek Gieben
  2005-06-06 16:53           ` Bart Schaefer
  0 siblings, 2 replies; 11+ messages in thread
From: Thorsten Kampe @ 2005-06-06 16:23 UTC (permalink / raw)
  To: zsh-users; +Cc: zsh-workers

* Bart Schaefer (2005-06-06 16:09 +0100)
> On Jun 6, 11:53am, Thorsten Kampe wrote:
> }
> } And: please don't crosspost to .devel.
> 
> He didn't cross-post.  I got only one copy of his message.
> 
> Although you're reading zsh-users via gmane.org's interface, zsh-users
> is a mailing list, not a newsgroup.

Correct.
 
> And it happens that the maintainers of the zsh-users mailing list have
> arranged for all messages sent to zsh-users to be sent to zsh-workers,
> another mailing list.  This is so that the zsh developers don't have to
> subscribe to both lists in order to see all the postings.

I know.
 
> It happens that gmane is also mirroring the zsh-workers into a newsgroup
> named, apparently, something ending in .devel.  That newsgroup is going
> to get a copy of everything that's in zsh-users, whether its readers like
> it or not.

I'm not subscribed to the devel mailing list.

> Complain to gmane, or quit reading the non-.devel newsgroup,
> but don't blame the people using zsh-users as a mailing list like it was
> meant to be used.

I'm only subscribed to the user list. So I only got one article and
had no problem. Hitting the follow-up button on MG's article shows the
devel and the user mailing list.

So I thought he sent his article to the devel and the user. Maybe he
sent it only to devel - I don't know.

I suspected that you - the developers - got it twice. But anyway: *I*
didn't have any problem with that.

Nevertheless: there has to be a reason why your and his article has a
"Newsgroups: gmane.comp.shells.zsh.devel,gmane.comp.shells.zsh.user"
and mine and DN's for example show only "Newsgroups:
gmane.comp.shells.zsh.user".

T.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: lining up RPS1 and PS1
  2005-06-06 15:23 ` Bart Schaefer
@ 2005-06-06 16:38   ` Miek Gieben
  0 siblings, 0 replies; 11+ messages in thread
From: Miek Gieben @ 2005-06-06 16:38 UTC (permalink / raw)
  To: zsh users

[-- Attachment #1: Type: text/plain, Size: 988 bytes --]

[On 06 Jun, @17:23, Bart Schaefer wrote in "Re: lining up RPS1 and PS1 ..."]
> } [I could stretch PS1 and calculate the placement of '[some more]', but 
> } I really like the features of RPS1, like automatic placement.]
> 
> The whole point of RPS1 is that it gets automatically hidden as command
> input extends to the right into the space it occupies.  But with a two-
> line prompt, your typing is never going to intersect with "[some more]".
> So, really, putting it in PS1 is the right way to go about this.

true, but transient_rprompt is another feature you get for free by 
using RPS1.

> However:
> 
> RPS1="%{$(echotc UP 1)%}[some more]%{$echotc DO 1)%}"

ah, amazing! :-) [Small note, there is a typo here, the
last bit must be: {$(echotc DO 1)%} - extra '(' inserted]

Thanks!

--
grtz,
  - Miek

http://www.miek.nl                      http://www.nlnetlabs.nl
PGP Key ID: 0xB18453A1
fingerprint: 002B B079 0DDA 7D44 2B5C  CAB0 C3B7 F943 B184 53A1

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Gmane (Re: lining up RPS1 and PS1)
  2005-06-06 16:23         ` Thorsten Kampe
@ 2005-06-06 16:42           ` Miek Gieben
  2005-06-06 16:53           ` Bart Schaefer
  1 sibling, 0 replies; 11+ messages in thread
From: Miek Gieben @ 2005-06-06 16:42 UTC (permalink / raw)
  To: Thorsten Kampe; +Cc: zsh-users, zsh-workers

[-- Attachment #1: Type: text/plain, Size: 990 bytes --]

[On 06 Jun, @18:23, Thorsten Kampe wrote in "Re: Gmane (Re: lining up RPS1  ..."]
> 
> I'm only subscribed to the user list. So I only got one article and
> had no problem. Hitting the follow-up button on MG's article shows the
> devel and the user mailing list.
> 
> So I thought he sent his article to the devel and the user. Maybe he
> sent it only to devel - I don't know.

I sent it to users, and nothing else.

I'm sending /this/ message to both lists (as someone has added the cc)

> Nevertheless: there has to be a reason why your and his article has a
> "Newsgroups: gmane.comp.shells.zsh.devel,gmane.comp.shells.zsh.user"
> and mine and DN's for example show only "Newsgroups:
> gmane.comp.shells.zsh.user".

dunno, maybe gmane gets confused by some of the mailing list
x-headers?

--
grtz,
  - Miek

http://www.miek.nl                      http://www.nlnetlabs.nl
PGP Key ID: 0xB18453A1
fingerprint: 002B B079 0DDA 7D44 2B5C  CAB0 C3B7 F943 B184 53A1

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Gmane (Re: lining up RPS1 and PS1)
  2005-06-06 16:23         ` Thorsten Kampe
  2005-06-06 16:42           ` Miek Gieben
@ 2005-06-06 16:53           ` Bart Schaefer
  1 sibling, 0 replies; 11+ messages in thread
From: Bart Schaefer @ 2005-06-06 16:53 UTC (permalink / raw)
  To: zsh-users

[removed zsh-workers, moved zsh-users from Cc to To]

On Jun 6,  5:23pm, Thorsten Kampe wrote:
}
} Nevertheless: there has to be a reason why your and his article has a
} "Newsgroups: gmane.comp.shells.zsh.devel,gmane.comp.shells.zsh.user"
} and mine and DN's for example show only "Newsgroups:
} gmane.comp.shells.zsh.user".

I suspect a gmane problem.  When you post an article, you are posting
it through gmane, so gmain inserts only the one newsgroup header.
When gmane receives an article via the mailing list, it's receiving it
via both lists, so it inserts both groups into the Newsgroups: header
(which gmane creates -- it's not present in the messages I send).

(I did get two copies of <k8g70cy8iq90$.oyyyvskwtbo3$.dlg@40tude.net>
from you.)


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2005-06-06 16:53 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-06 10:18 lining up RPS1 and PS1 Miek Gieben
2005-06-06 10:35 ` Thorsten Kampe
2005-06-06 10:43   ` Miek Gieben
2005-06-06 10:53     ` Thorsten Kampe
2005-06-06 15:09       ` Gmane (Re: lining up RPS1 and PS1) Bart Schaefer
2005-06-06 16:23         ` Thorsten Kampe
2005-06-06 16:42           ` Miek Gieben
2005-06-06 16:53           ` Bart Schaefer
2005-06-06 15:04 ` lining up RPS1 and PS1 Dan Nelson
2005-06-06 15:23 ` Bart Schaefer
2005-06-06 16:38   ` Miek Gieben

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).