From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from odin.INS.CWRU.Edu ([129.22.8.102]) by archone.tamu.edu with SMTP id <19071>; Tue, 1 Oct 1991 15:24:44 -0500 Received: by odin.INS.CWRU.Edu (5.65b+ida+/CWRU-1.4-ins) id AA20585; Tue, 1 Oct 91 16:23:38 -0400 (from chet for rc@archone.tamu.edu) Date: Tue, 1 Oct 1991 15:15:15 -0500 From: Chet Ramey To: d0asta@dtek.chalmers.se Subject: Re: fn prompt and readline Cc: rc@archone.tamu.edu Reply-To: chet@po.CWRU.Edu In-Reply-To: Message from d0asta@dtek.chalmers.se of Sun, 29 Sep 1991 11:28:14 -0500 Message-Id: <9110012015.AA20546.SM@odin.INS.CWRU.Edu> Read-Receipt-To: chet@po.CWRU.Edu > If i define... > > fn prompt {echo -n $HOSTNAME^'$'} > prompt='' > > ...I get... > > $ > > ...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