mirror of
https://github.com/tmate-io/tmate.git
synced 2025-02-24 14:21:00 +01:00
Okay, so I screwed up when testing this, doh. Unbreak so that CAN/SUB actually
do cancel the sequence, and tweak to make the code more clear.
This commit is contained in:
parent
6c1f03578d
commit
d6015824dd
18
input.c
18
input.c
@ -399,13 +399,16 @@ input_state_sequence_first(u_char ch, struct input_ctx *ictx)
|
|||||||
if (ch == 0x1b) { /* ESC */
|
if (ch == 0x1b) { /* ESC */
|
||||||
/* Abort sequence and begin with new. */
|
/* Abort sequence and begin with new. */
|
||||||
input_state(ictx, input_state_escape);
|
input_state(ictx, input_state_escape);
|
||||||
} else if (ch != 0x18 && ch != 0x1a) { /* CAN and SUB */
|
return;
|
||||||
|
} else if (ch == 0x18 || ch == 0x1a) { /* CAN and SUB */
|
||||||
/* Abort sequence. */
|
/* Abort sequence. */
|
||||||
input_state(ictx, input_state_first);
|
input_state(ictx, input_state_first);
|
||||||
} else {
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Handle C0 immediately. */
|
/* Handle C0 immediately. */
|
||||||
input_handle_c0_control(ch, ictx);
|
input_handle_c0_control(ch, ictx);
|
||||||
}
|
|
||||||
/*
|
/*
|
||||||
* Just come back to this state, in case the next character
|
* Just come back to this state, in case the next character
|
||||||
* is the start of a private sequence.
|
* is the start of a private sequence.
|
||||||
@ -467,13 +470,16 @@ input_state_sequence_next(u_char ch, struct input_ctx *ictx)
|
|||||||
if (ch == 0x1b) { /* ESC */
|
if (ch == 0x1b) { /* ESC */
|
||||||
/* Abort sequence and begin with new. */
|
/* Abort sequence and begin with new. */
|
||||||
input_state(ictx, input_state_escape);
|
input_state(ictx, input_state_escape);
|
||||||
} else if (ch != 0x18 && ch != 0x1a) { /* CAN and SUB */
|
return;
|
||||||
|
} else if (ch == 0x18 || ch == 0x1a) { /* CAN and SUB */
|
||||||
/* Abort sequence. */
|
/* Abort sequence. */
|
||||||
input_state(ictx, input_state_first);
|
input_state(ictx, input_state_first);
|
||||||
} else {
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Handle C0 immediately. */
|
/* Handle C0 immediately. */
|
||||||
input_handle_c0_control(ch, ictx);
|
input_handle_c0_control(ch, ictx);
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user