Re: [PATCH 5/5 v2] keyboard input: when an unknown sequence is seen, purge all buffered input

2013-02-20 Thread Denys Vlasenko
On Mon, Feb 4, 2013 at 12:54 PM, Slava Zanko slavaza...@gmail.com wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 31.01.2013 19:27, Oswald Buddenhagen wrote:

 the mc devs are rather insistent on their process and often simply
 ignore contributions on the list, so you may get a better response
 when you create trac tickets.

 It's is not the only reason, but yes, better to create a new ticket.

https://github.com/MidnightCommander/mc/issues/10

ping...
___
mc-devel mailing list
https://mail.gnome.org/mailman/listinfo/mc-devel


Re: [PATCH 5/5 v2] keyboard input: when an unknown sequence is seen, purge all buffered input

2013-02-04 Thread Slava Zanko
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

31.01.2013 19:27, Oswald Buddenhagen wrote:

 the mc devs are rather insistent on their process and often simply 
 ignore contributions on the list, so you may get a better response
 when you create trac tickets.

It's is not the only reason, but yes, better to create a new ticket.

Thanks in advance.

- -- 
WBR, Slavaz.
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.13 (GNU/Linux)

iEYEARECAAYFAlEPoV0ACgkQb3oGR6aVLppJDgCdGaVUlcsd9fxbBAT26wKYcqxY
jJAAn35G63jXSgvCjxEMe1wYtQuOXv7R
=7t3Y
-END PGP SIGNATURE-
___
mc-devel mailing list
https://mail.gnome.org/mailman/listinfo/mc-devel


Re: [PATCH 5/5 v2] keyboard input: when an unknown sequence is seen, purge all buffered input

2013-01-31 Thread Denys Vlasenko
Ping...

On Thu, Oct 25, 2012 at 4:45 PM, Denys Vlasenko
vda.li...@googlemail.com wrote:
 When we see an unknown sequence, it is not enough
 to drop already received part - there can be more of it
 coming over e.g. a serial line.

 To prevent interpreting it as a random garbage,
 eat and discard all chars that follow.
 Small, but non-zero timeout is needed to reconnect
 escape sequence split up by a serial line.

 Before this change, Ctrl-Alt-Shift-Right_Arrow generates 1;8C
 bogus input in MC on my machine; after the change,
 nothing is generated.

 Signed-off-by: Denys Vlasenko vda.li...@googlemail.com
 ---
  lib/tty/key.c |   21 -
  1 files changed, 16 insertions(+), 5 deletions(-)

 diff --git a/lib/tty/key.c b/lib/tty/key.c
 index 9b97aa8..818b2e6 100644
 --- a/lib/tty/key.c
 +++ b/lib/tty/key.c
 @@ -1216,14 +1216,14 @@ correct_key_code (int code)
  /* 
 -
  */

  static int
 -xgetch_second (void)
 +getch_with_timeout (unsigned delay_us)
  {
  fd_set Read_FD_Set;
  int c;
  struct timeval time_out;

 -time_out.tv_sec = old_esc_mode_timeout / 100;
 -time_out.tv_usec = old_esc_mode_timeout % 100;
 +time_out.tv_sec = delay_us / 100u;
 +time_out.tv_usec = delay_us % 100u;
  tty_nodelay (TRUE);
  FD_ZERO (Read_FD_Set);
  FD_SET (input_fd, Read_FD_Set);
 @@ -1891,7 +1891,18 @@ get_key_code (int no_delay)
  seq_append = NULL;
  }
  if (bad_seq)
 +{
 +/* This is an unknown ESC sequence.
 + * To prevent interpreting its tail as a random garbage,
 + * eat and discard all buffered and quickly following 
 chars.
 + * Small, but non-zero timeout is needed to reconnect
 + * escape sequence split up by e.g. a serial line.
 + */
 +int paranoia = 20;
 +while (getch_with_timeout (old_esc_mode_timeout) = 0  
 --paranoia != 0)
 +continue;
  goto nodelay_try_again;
 +}
  }
  if ((d  127  d  256)  use_8th_bit_as_meta)
  {
 @@ -2009,8 +2020,8 @@ get_key_code (int no_delay)
  goto nodelay_try_again;
  }
  esctime.tv_sec = -1;
 -c = xgetch_second ();
 -keylog ( c=xgetch_second()=%d\n, c);
 +c = getch_with_timeout (old_esc_mode_timeout);
 +keylog ( c=getch_with_timeout(%d)=%d\n, 
 old_esc_mode_timeout, c);
  if (c == -1)
  {
  pending_keys = seq_append = NULL;
 --
 1.7.7.6

___
mc-devel mailing list
https://mail.gnome.org/mailman/listinfo/mc-devel


Re: [PATCH 5/5 v2] keyboard input: when an unknown sequence is seen, purge all buffered input

2013-01-31 Thread Oswald Buddenhagen
On Thu, Jan 31, 2013 at 11:38:58AM +0100, Denys Vlasenko wrote:
 Ping...
 
the mc devs are rather insistent on their process and often simply
ignore contributions on the list, so you may get a better response when
you create trac tickets.
___
mc-devel mailing list
https://mail.gnome.org/mailman/listinfo/mc-devel