On 11/16/20 12:26 PM, Nick Black wrote:
Chet Ramey left as an exercise for the reader:
Readline provides defaults for rl_instream and rl_outstream the first time
it's called. These are in place before the first time rl_prep_terminal is
called. If an application using readline decides to change the file pointer
assigned to either of these variables, readline allows it.
Hrmmm. I definitely was crashing within rl_prep_terminal() (as
noted with valgrind) until I set this. I'll look deeper into how
this was happening, but gdb verified that rl_outstream was NULL
when the writeouts at the end of this function were hit.
Are you calling rl_prep_terminal directly, or letting readline call it for
you? If you call it before readline can initialize, or are calling it
without calling rl_initialize, all bets are off.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU [email protected] http://tiswww.cwru.edu/~chet/