pkgsrc-Users archive

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

Re: Possible bash bug regarding control-o?



On Wed 17 Jan 2018 at 09:26:16 +0100, Rhialto wrote:
> I found out that it definitely has something to do with the discard
> character. If I "stty discard undef", the ^O works in bash too.
> Looks like they forgot to disable it while in their readline.

I created a patch, and reported it upstream:
http://savannah.gnu.org/support/index.php?109449

For the time being this should be added as a patch to
pkgsrc/shells/bash:

--- lib/readline/rltty.c.orig	2018-01-17 13:13:06.000000000 +0100
+++ lib/readline/rltty.c	2018-01-17 13:16:55.000000000 +0100
@@ -308,6 +308,7 @@
   /* Make the interrupt keys go away.  Just enough to make people happy. */
   tiop->ltchars.t_dsuspc = -1;	/* C-y */
   tiop->ltchars.t_lnextc = -1;	/* C-v */
+  tiop->ltchars.t_flushc = -1;	/* C-o */
 #endif /* TIOCGLTC */
 }
 
@@ -578,6 +579,10 @@
   tiop->c_cc[VDSUSP] = _POSIX_VDISABLE;
 #endif
 
+#if defined (VDISCARD)
+  tiop->c_cc[VDISCARD] = _POSIX_VDISABLE;
+#endif
+
 #endif /* TERMIOS_TTY_DRIVER && _POSIX_VDISABLE */
 }
 #endif  /* !NEW_TTY_DRIVER */

I added the handling in 2 places (the 2nd is effective for me); it is
somewhat unclear in the maze of ifdefs if there might be more locations,
and if the ifdefs are actually sensible. NEW_TTY_DRIVER seems to select
old pre-termios tty drivers (using TIOCLGET etc) for instance... and
that code isn't even C89 yet, without function prototypes...

-Olaf.
-- 
___ Olaf 'Rhialto' Seibert  -- Wayland: Those who don't understand X
\X/ rhialto/at/falu.nl      -- are condemned to reinvent it. Poorly.

Attachment: signature.asc
Description: PGP signature



Home | Main Index | Thread Index | Old Index