NetBSD-Bugs archive

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

Re: lib/48957 libedit/readline.c prompt bug



The following reply was made to PR lib/48957; it has been noted by GNATS.

From: "Simon J. Gerraty" <sjg%juniper.net@localhost>
To: <christos%netbsd.org@localhost>
Cc: <sjg%juniper.net@localhost>, <fgsch%lodoss.net@localhost>, <gnats-bugs%netbsd.org@localhost>
Subject: Re: lib/48957 libedit/readline.c prompt bug
Date: Thu, 7 Dec 2017 17:01:48 -0800

 Hi Christos,
 
 > when we build python for Junos we use libedit's readline.
 > However there's a bug. We fixed it internally some years ago,
 > but it was never upstreamed.
 > 
 > Having just wasted several hours re-discoverying that, I figured
 > I'd address it.
 > 
 > Patch is below - it removes the call to set EL_UNBUFFERED
 > from rl_callback_read_char() since this causes the prompt to be issued
 > again - before caller has processed current input.
 
 So after more digging I see that this was previously commented out then
 uncommented in reponse to this PR 48957
 but the test app there appears to me to be questionable.
 
 If I tweak that to stop doing the
 write "\r                  \r" dance,
 (which is hiding the extra prompt output)
 we see that the bug is there:
 
 prompt> hi
 prompt> prompt> there
 prompt> prompt> oops
 prompt> prompt>
 
 as I said, I'm not certain what the best fix is, but
 calling el_set(e, EL_UNBUFFERED, 1) here does not appear to be correct.
 


Home | Main Index | Thread Index | Old Index