rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
* Re: fn prompt and readline
@ 1991-10-01 20:15 Chet Ramey
  0 siblings, 0 replies; 3+ messages in thread
From: Chet Ramey @ 1991-10-01 20:15 UTC (permalink / raw)
  To: d0asta; +Cc: rc

> If i define...
> 
> fn prompt {echo -n $HOSTNAME^'$'}
> prompt=''
> 
> ...I get...
> 
> <machine>$
> 
> ...for prompt.
> The Problem:
> Using readline to step back in history, the prompt disappears after
> a few steps. Is this a bug in readline or rc? What can I do to avoid it?

readline is called as readline(prompt_string) so that moving backwards and
forwards in the history will end up redrawing the screen to look right.
In your case, readline is being called with a null prompt, so nothing is
printed.

(Forgive me, I don't know the rc syntax very well, but wouldn't this or
something like it work?
	p1=`{echo -n $HOSTNAME^'$'}
	p2=';'
	prompt=( $p1^' ' $p2^' ' )

I'd better quit before I get confused...)

Chet


--
``Teach them politics and war so their sons may study medicine and mathematics
in order to give their children a right to study painting, poetry, music, and
architecture.''
Chet Ramey, CWRU  Inet: chet@po.CWRU.Edu   NeXT Mail: chet@macbeth.INS.CWRU.Edu


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

* Re: fn prompt and readline
@ 1991-10-02  0:54 Palmer Davis
  0 siblings, 0 replies; 3+ messages in thread
From: Palmer Davis @ 1991-10-02  0:54 UTC (permalink / raw)
  To: rc

[Chet]
>(Forgive me, I don't know the rc syntax very well, but wouldn't this or
>something like it work?

From my .rcrc, before I got sick of it and switched back to a bare semicolon:

#fn prompt { prompt=(`{whoami}^'@'`{hostname}^':'^`{pwd}^'; ' '' ); stty sane }

(It's "prompt", not "ps1"....)

Palmer Davis, CWRU INS Mac/UNIX Guy <davis@usenet.ins.cwru.edu>  Life is short.


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

* fn prompt and readline
@ 1991-09-29 16:28 d0asta
  0 siblings, 0 replies; 3+ messages in thread
From: d0asta @ 1991-09-29 16:28 UTC (permalink / raw)
  To: rc


If i define...

fn prompt {echo -n $HOSTNAME^'$'}
prompt=''

...I get...

<machine>$

...for prompt.
The Problem:
Using readline to step back in history, the prompt disappears after
a few steps. Is this a bug in readline or rc? What can I do to avoid it?

I haven't found this in 'rc-list', so hopefully it hasn't been
discussed yet (orelse flame me). :-)

Homann
-- 
	Magnus Homann			"The future is so bright,
	d0asta@dtek.chalmers.se		   you gotta wear shades..."


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

end of thread, other threads:[~1991-10-02  0:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1991-10-01 20:15 fn prompt and readline Chet Ramey
  -- strict thread matches above, loose matches on Subject: below --
1991-10-02  0:54 Palmer Davis
1991-09-29 16:28 d0asta

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).