Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!shadooby!accuvax.nwu.edu!hopf.math.nwu.edu!john From: john@hopf.math.nwu.edu (John Franks) Newsgroups: gnu.bash.bug Subject: Problems with TERMCAP in 0.99 Message-ID: <767@accuvax.nwu.edu> Date: 12 Jun 89 21:42:05 GMT Sender: news@accuvax.nwu.edu Reply-To: john@hopf.math.nwu.edu (John Franks) Distribution: gnu Organization: Northwestern Univ. Evanston, Il. Lines: 139 In subst.c the function sv_terminal() calls rl_reset_terminal(get_string_value (name)). If the TERMCAP variable has just been changed then name is "TERMCAP" and the name of a termcap file or a termcap entry is passed. rl_reset_terminal() passes it on to init_terminal_io( ) (in readline.c ) which tries to use it as a terminal name which of course it isn't. I see no reason for rl_reset_terminal( ) and init_terminal_io( )to have any argument at all. Even after this is fixed there seems to be another bug I can't track down. It may be a Sun problem (I'm using a Sun3, SunOs4.0). Here's what seems to happen: If I change the value of TERMCAP, rl_reset_terminal() gets called as it should, but the old value of TERMCAP continues to be used as the termcap file in that invocation of bash. If a new bash is invoked the new termcap file is used. I don't see why this happens. If anybody figurest this out please let me know. Here is a diff with version 0.99. It includes some previous changes to fix the way term_backspace is set. I posted this fix earlier. *** readline.c.orig.).99 Mon Jun 12 15:58:04 1989 --- readline.c Mon Jun 12 15:58:03 1989 *************** *** 232,235 **** --- 231,235 ---- #ifdef SIGWINCH + static int rl_handle_sigwinch (sig, code, scp) int sig, code; *************** *** 236,242 **** struct sigcontext *scp; { if (readline_echoing_p) { ! rl_reset_terminal (get_string_value ("TERM")); putc ('\r', out_stream); rl_forced_update_display (); --- 236,243 ---- struct sigcontext *scp; { + char *get_string_value( ); if (readline_echoing_p) { ! rl_reset_terminal (); putc ('\r', out_stream); rl_forced_update_display (); *************** *** 495,499 **** /* Initialize the terminal interface. */ ! init_terminal_io ((char *)NULL); /* Initialize default key bindings. */ --- 496,500 ---- /* Initialize the terminal interface. */ ! init_terminal_io( ); /* Initialize default key bindings. */ *************** *** 714,717 **** --- 715,721 ---- static int line_size = 1024; + static void move_cursor_relative(); + static void output_some_chars(); + /* Non-zero means to always use horizontal scrolling in line display. */ int horizontal_scroll_mode = 0; *************** *** 722,726 **** register int in, out, c, linenum; register char *line = invisible_line; - static void move_cursor_relative (); int c_pos = 0, v_pos = 0; int inv_botlin = 0; /* Number of lines in newly drawn buffer. */ --- 726,729 ---- *************** *** 1213,1226 **** /* Re-initialize the terminal considering that the TERM/TERMCAP variable has changed. */ ! rl_reset_terminal (terminal_name) ! char *terminal_name; { ! init_terminal_io (terminal_name); } ! init_terminal_io (terminal_name) ! char *terminal_name; { ! char *term = (terminal_name? terminal_name : (char *)getenv ("TERM")); char *tgetstr (), *buffer = term_string_buffer; --- 1216,1227 ---- /* Re-initialize the terminal considering that the TERM/TERMCAP variable has changed. */ ! rl_reset_terminal ( ) { ! init_terminal_io ( ); } ! init_terminal_io( ) { ! char *term = (char *)getenv ("TERM"); char *tgetstr (), *buffer = term_string_buffer; *************** *** 1234,1244 **** return; } ! ! buffer = (char *)xmalloc (2048); ! BC = tgetstr ("pc", &buffer); ! PC = buffer ? *buffer : 0; ! BC = tgetstr ("le", &buffer); ! ! term_backspace = tgetstr ("bw", &buffer); term_cr = tgetstr ("cr", &buffer); --- 1235,1240 ---- return; } ! PC = (tgetstr( "pc", &buffer) ? *buffer : 0); ! BC = term_backspace = tgetstr( "le", &buffer); term_cr = tgetstr ("cr", &buffer); John Franks Dept of Math. Northwestern University Internet john@math.nwu.edu Bitnet j_franks@nuacc