[gnu.bash.bug] fix for XON-handling

juha@tds.kth.se (Juha Sarlin) (09/04/89)

Bash 1.03 tries to rebind xon_char (normally C-Q) to rl_restart_output, but
passes the arguments in wrong order. My fix is at the end of this message.

I don't really like this automatic rebinding. Perhaps it would be better to
wait for all output to drain before disabling XON/XOFF. It might be possible
to do this with ioctl(fd, TCSBRK, 1) on SYSV, but I don't know how to do it
on BSD; TIOCSETP isn't useful because it discards input.

Also, there is a variable called xoff_state, which presumably was meant to
be true if the tty is in xoff state. However, it never gets set. Probably
for the very good reason that it doesn't seem possible to find out if
terminal is in xoff state or not.

*** /tmp/,RCSt1a04103	Mon Sep  4 14:49:27 1989
--- readline.c	Mon Sep  4 14:44:12 1989
***************
*** 1651,1657 ****
  
      /* If there is an XON character, bind it to restart the output. */
      if (xon_char != -1)
!       rl_bind_key (rl_restart_output, xon_char);
  
      /* If there is an EOF char, bind eof_char to it. */
      if (temp.t_eofc != -1)
--- 1651,1657 ----
  
      /* If there is an XON character, bind it to restart the output. */
      if (xon_char != -1)
!       rl_bind_key (xon_char, rl_restart_output);
  
      /* If there is an EOF char, bind eof_char to it. */
      if (temp.t_eofc != -1)
--
Juha Sarlin	juha@tds.kth.se