Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
cs24-19fa
git_rec_nano
Commits
059c8efb
Commit
059c8efb
authored
8 years ago
by
David Lawrence Ramsey
Committed by
Benno Schulenberg
8 years ago
Browse files
Options
Download
Email Patches
Plain Diff
input: make Shift+Alt+Arrow work properly on rxvt and Eterm terminals
This fixes
https://savannah.gnu.org/bugs/?49636
.
parent
eb68cd1c
master
feature/match-parens
refactor/readbility
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/winio.c
+22
-8
src/winio.c
with
22 additions
and
8 deletions
+22
-8
src/winio.c
View file @
059c8efb
...
...
@@ -391,7 +391,8 @@ int parse_kbinput(WINDOW *win)
break
;
case
2
:
if
(
double_esc
)
{
/* An "ESC ESC [ X" sequence from Option+arrow. */
/* An "ESC ESC [ X" sequence from Option+arrow, or
* an "ESC ESC [ x" sequence from Shift+Alt+arrow. */
switch
(
keycode
)
{
case
'A'
:
retval
=
KEY_HOME
;
...
...
@@ -405,6 +406,18 @@ int parse_kbinput(WINDOW *win)
case
'D'
:
retval
=
controlleft
;
break
;
case
'a'
:
retval
=
shiftaltup
;
break
;
case
'b'
:
retval
=
shiftaltdown
;
break
;
case
'c'
:
retval
=
shiftaltright
;
break
;
case
'd'
:
retval
=
shiftaltleft
;
break
;
}
double_esc
=
FALSE
;
escapes
=
0
;
...
...
@@ -464,8 +477,9 @@ int parse_kbinput(WINDOW *win)
escapes
=
0
;
}
}
else
if
(
keycode
==
'['
&&
key_buffer_len
>
0
&&
'A'
<=
*
key_buffer
&&
*
key_buffer
<=
'D'
)
{
/* This is an iTerm2 sequence: ^[ ^[ [ X. */
((
'A'
<=
*
key_buffer
&&
*
key_buffer
<=
'D'
)
||
(
'a'
<=
*
key_buffer
&&
*
key_buffer
<=
'd'
)))
{
/* An iTerm2/Eterm/rxvt sequence: ^[ ^[ [ X. */
double_esc
=
TRUE
;
}
else
{
/* Two escapes followed by a non-escape, and there are more
...
...
@@ -1432,10 +1446,10 @@ int *get_verbatim_kbinput(WINDOW *win, size_t *kbinput_len)
return
retval
;
}
/* Read in one control character (or an iTerm double Escape),
or convert a
* series of six digits into a Unicode codepoint. Return
in count either 1
* (for a control character or the first byte of a
multibyte sequence), or 2
* (for an iTerm double Escape). */
/* Read in one control character (or an iTerm
/Eterm/rxvt
double Escape),
*
or convert a
series of six digits into a Unicode codepoint. Return
*
in count either 1
(for a control character or the first byte of a
*
multibyte sequence), or 2
(for an iTerm
/Eterm/rxvt
double Escape). */
int
*
parse_verbatim_kbinput
(
WINDOW
*
win
,
size_t
*
count
)
{
int
*
kbinput
;
...
...
@@ -1497,7 +1511,7 @@ int *parse_verbatim_kbinput(WINDOW *win, size_t *count)
*
count
=
1
;
/* If this is an iTerm double escape, take both Escapes. */
/* If this is an iTerm
/Eterm/rxvt
double escape, take both Escapes. */
if
(
key_buffer_len
>
3
&&
*
key_buffer
==
ESC_CODE
&&
key_buffer
[
1
]
==
ESC_CODE
&&
key_buffer
[
2
]
==
'['
)
*
count
=
2
;
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help