1
0
mirror of https://github.com/rfivet/uemacs.git synced 2024-06-29 04:55:31 +00:00

Fix regression: CSI character instead of ^{[ in terminal special key sequence.

Remove terminal special key conditional compilation.
This commit is contained in:
Renaud 2021-08-06 15:21:00 +08:00
parent 5002897705
commit 4b45ca231e
3 changed files with 18 additions and 34 deletions

View File

@ -3,13 +3,11 @@
#ifndef _ESTRUCT_H_
#define _ESTRUCT_H_
/* ESTRUCT.H
*
* Structure and preprocessor defines
/* Structure and preprocessor defines
*
* written by Dave G. Conroy
* modified by Steve Wilhite, George Jones
* substantially modified by Daniel Lawrence
* substantially modified by Daniel Lawrence
* modified by Petri Kutvonen
*/
@ -66,29 +64,12 @@
#endif
#ifndef AUTOCONF
/* Special keyboard definitions */
#define VT220 0 /* Use keypad escapes P.K. */
#define VT100 0 /* Handle VT100 style keypad. */
/* Terminal Output definitions */
#define ANSI 0 /* ANSI escape sequences */
#define VT52 0 /* VT52 terminal (Zenith). */
#define TERMCAP 0 /* Use TERMCAP */
#define IBMPC 1 /* IBM-PC CGA/MONO/EGA driver */
# define TERMCAP 0 /* Use TERMCAP */
# define IBMPC 1 /* IBM-PC CGA/MONO/EGA driver */
#else
#define VT220 UNIX
#define VT100 0
#define ANSI 0
#define VT52 0
#define TERMCAP UNIX
#define IBMPC MSDOS
# define TERMCAP UNIX
# define IBMPC MSDOS
#endif /* Autoconf. */
/* Configuration options */

18
input.c
View File

@ -352,8 +352,8 @@ static int get1unicode( int *up) {
return bytes ;
}
/* Terminal sequences need up to 6 read ahead characters */
#define STACKSIZE 6
/* Terminal sequences need up to 7 read ahead characters */
#define STACKSIZE 7
static int keystack[ STACKSIZE] ;
static int *stackptr = &keystack[ STACKSIZE] ;
#define KPUSH( c) *(--stackptr) = (c)
@ -381,8 +381,10 @@ int getcmd( void) {
int c ;
for( ;;) {
c = get1key() ;
if( c == (CTRL | '[')) {
c = *(kptr++) = get1key() ;
if( c == 0x9B)
goto foundCSI ;
else if( c == (CTRL | '[')) {
/* fetch terminal sequence */
c = *(kptr++) = get1key() ;
if( c == 'O') { /* F1 .. F4 */
@ -390,8 +392,10 @@ int getcmd( void) {
if( c >= 'P' && c <= 'S')
return c | SPEC | cmask ;
} else if( c == '[') {
int v = 0 ; /* ^[[v1;v~ or ^[[v~ */
int v1 = 0 ;
int v1, v ; /* ^[[v1;v~ or ^[[v~ */
foundCSI:
v1 = v = 0 ;
while( kptr < &keyread[ STACKSIZE]) {
c = *(kptr++) = get1key() ;
if( (c == '~') || (c >= 'A' && c <= 'Z')) {
@ -428,7 +432,7 @@ int getcmd( void) {
while( kptr > keyread)
KPUSH( *(--kptr)) ;
c = CTRL | '[' ;
c = get1key() ;
}
if( c == metac) {

View File

@ -232,7 +232,7 @@ const name_bind names[] = {
{ NULL, (fnp_t) setmark, META | '.'},
// { NULL, bktoshell, META | 'S'},
#if VT220
/* special key mapping */
{ NULL, yank, SPEC | '2'}, /* Insert */
{ NULL, forwdel /* killregion */, SPEC | '3'}, /* Delete */
{ NULL, (fnp_t) backpage, SPEC | '5'}, /* Page Up */
@ -244,7 +244,6 @@ const name_bind names[] = {
{ NULL, (fnp_t) gotoeob, SPEC | 'F'}, /* End */
{ NULL, (fnp_t) gotobob, SPEC | 'H'}, /* Home */
{ NULL, help, SPEC | 'P'}, /* F1 */
#endif
/* hooks */
{ NULL, nullproc, SPEC | META | 'R'}, /* hook */