[BACK]Return to tty-keys.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / tmux

Diff for /src/usr.bin/tmux/tty-keys.c between version 1.2 and 1.3

version 1.2, 2009/07/21 17:57:29 version 1.3, 2009/07/26 21:42:08
Line 20 
Line 20 
 #include <sys/time.h>  #include <sys/time.h>
   
 #include <string.h>  #include <string.h>
   #include <termios.h>
   #include <unistd.h>
   
 #include "tmux.h"  #include "tmux.h"
   
Line 235 
Line 237 
         struct timeval   tv;          struct timeval   tv;
         char            *buf;          char            *buf;
         size_t           len, size;          size_t           len, size;
           cc_t             bspace;
   
         buf = BUFFER_OUT(tty->in);          buf = BUFFER_OUT(tty->in);
         len = BUFFER_USED(tty->in);          len = BUFFER_USED(tty->in);
Line 245 
Line 248 
         /* If a normal key, return it. */          /* If a normal key, return it. */
         if (*buf != '\033') {          if (*buf != '\033') {
                 *key = buffer_read8(tty->in);                  *key = buffer_read8(tty->in);
   
                   /*
                    * Check for backspace key using termios VERASE - the terminfo
                    * kbs entry is extremely unreliable, so cannot be safely
                    * used. termios should have a better idea.
                    */
                   bspace = tty->tio.c_cc[VERASE];
                   if (bspace != _POSIX_VDISABLE && *key == bspace)
                           *key = KEYC_BSPACE;
                 goto found;                  goto found;
         }          }
   

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3