🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Chip Salzenberg Mon, 22 Jan 1990 18:48
Bash 1.04 patch: termio support
#853
Author: Chip Salzenberg
Date: Mon, 22 Jan 1990 18:48
94 lines
2593 bytes
As distributed, Bash 1.04 picks up the current erase and kill characters from
the tty mode structure -- but only for BSD, not SysV.  This patch adds this
feature for SysV, and also cleans up the ttymode code a little.

Index: readline/readline.c
***************
*** 1035,1060 ****
  readline_default_bindings ()
  {
! #ifdef TIOCGETP
!   struct sgttyb ttybuff;
    int tty = fileno (rl_instream);
  
!   if (ioctl (tty, TIOCGETP, &ttybuff) != -1)
!     {
!       int erase = ttybuff.sg_erase, kill = ttybuff.sg_kill;
  
!       if (erase != -1 && keymap[erase].type == ISFUNC)
! 	keymap[erase].function = rl_rubout;
  
!       if (kill != -1 && keymap[kill].type == ISFUNC)
! 	keymap[kill].function = rl_unix_line_discard;
      }
  
  #ifdef TIOCGLTC
    {
      struct ltchars lt;
  
!     if (ioctl (tty, TIOCGLTC, &lt) != -1)
        {
! 	int erase = lt.t_werasc, nextc = lt.t_lnextc;
  
  	if (erase != -1 && keymap[erase].type == ISFUNC)
--- 1037,1063 ----
  readline_default_bindings ()
  {
!   int erase = -1, kill = -1;
    int tty = fileno (rl_instream);
  
! #ifdef NEW_TTY_DRIVER
  
!   struct sgttyb ttybuff;
  
!   if (ioctl (tty, TIOCGETP, &ttybuff) == 0)
!     {
!       erase = ttybuff.sg_erase;
!       kill = ttybuff.sg_kill;
      }
  
  #ifdef TIOCGLTC
+ 
    {
      struct ltchars lt;
+     int erase, nextc;
  
!     if (ioctl (tty, TIOCGLTC, &lt) == 0)
        {
! 	int erase = lt.t_werasc;
! 	int nextc = lt.t_lnextc;
  
  	if (erase != -1 && keymap[erase].type == ISFUNC)
***************
*** 1065,1070 ****
        }
    }
  #endif /* TIOCGLTC */
! #endif /*  TIOCGETP */
  }
  
--- 1068,1091 ----
        }
    }
+ 
  #endif /* TIOCGLTC */
! 
! #else /* not new driver */
! 
!   struct termio ttyio;
! 
!   if (ioctl (tty, TCGETA, &ttyio) == 0)
!     {
!       erase = ttyio.c_cc[VERASE];
!       kill = ttyio.c_cc[VKILL];
!     }
! 
! #endif  /* not new driver */
! 
!   if (erase != -1 && keymap[erase].type == ISFUNC)
!     keymap[erase].function = rl_rubout;
! 
!   if (kill != -1 && keymap[kill].type == ISFUNC)
!     keymap[kill].function = rl_unix_line_discard;
  }
  
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads