aboutsummaryrefslogtreecommitdiff
path: root/libbb/read_key.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* lineedit: fix handling of repeating Alt-b, Alt-f, Alt-d, Alt-BackspaceRostislav Skudnov2016-11-241-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | These key combinations should repeat correctly when the keys are pressed and held. Before this change, they do this erratically - many repeats are "eaten" because they are treated as unrecognized ESC seqs: ESC 0x7f is treated by Alt+baskspace, but ESC 0x7f ESC 0x7f ESC 0x7f is unrecognized. Escape sequences corresponding to these key combinations are moved from read_line_input to lineedit_read_key. Also, these key sequences are now enabled regardless of whether FEATURE_EDITING_VI is set, since Vim does not actually support these key combinations, but they are present in readline library. function old new delta static.esccmds 93 103 +10 read_line_input 3737 3687 -50 Signed-off-by: Rostislav Skudnov <rostislav@tuxera.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Add comments in keyboard escape sequences tableDenys Vlasenko2012-06-111-5/+10
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* lineedit: add support for M-b, M-f, M-d, M-BackspaceDenys Vlasenko2011-11-031-3/+8
| | | | | | | | | | | | function old new delta ctrl_left - 96 +96 ctrl_right - 76 +76 static.esccmds 81 93 +12 read_line_input 3876 3885 +9 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 2/0 up/down: 193/0) Total: 193 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* less: optionally query terminal size via "ESC [ 6 n". Closes bug 2659.Denys Vlasenko2011-07-251-1/+4
| | | | | | +7 bytes is not selected, +100 if selected. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: make GNU licensing statement forms more regularDenys Vlasenko2010-08-161-1/+1
| | | | | | | This change retains "or later" state! No licensing _changes_ here, only form is adjusted (article, space between "GPL" and "v2" and so on). Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* vi: discover window size even on serial consoles. optionalDenys Vlasenko2010-04-181-1/+1
| | | | | | | | | | | | | | | | function old new delta edit_file 671 761 +90 wh_helper - 57 +57 query_screen_dimensions 54 63 +9 ar_main 533 542 +9 refresh 767 773 +6 vi_main 242 243 +1 text_yank 56 54 -2 get_terminal_width_height 180 135 -45 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 5/2 up/down: 172/-47) Total: 125 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* read_key: fix buffer length calculationTomas Heinrich2010-04-161-1/+1
| | | | | Signed-off-by: Tomas Heinrich <heinrich.tomas@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* lineedit: fix another corner case with bad unicode inputDenys Vlasenko2010-03-111-5/+16
| | | | | | | | | | | | | | | | | function old new delta read_key 607 646 +39 readit 50 55 +5 getch_nowait 290 295 +5 hash_find 233 234 +1 xstrtoul_range_sfx 231 230 -1 passwd_main 1058 1056 -2 builtin_exit 45 43 -2 cmp_main 649 645 -4 lineedit_read_key 257 245 -12 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 4/5 up/down: 50/-21) Total: 29 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* lineedit: invalid unicode characters are replaced with CONFIG_SUBST_WCHARTomas Heinrich2010-03-091-0/+9
| | | | | | | | | function old new delta read_key_ungets - 50 +50 lineedit_read_key 223 252 +29 Signed-off-by: Tomas Heinrich <heinrich.tomas@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* read_key,lineeedit: parse position answerback faster; sanitize its useDenys Vlasenko2009-10-261-28/+25
| | | | | | | | | | | | | | | | it's still not reliable, and probably cannot be made so... added comment with explanation. function old new delta put_prompt 52 110 +58 read_key 601 607 +6 lineedit_read_key 201 207 +6 win_changed 108 104 -4 read_line_input 4824 4809 -15 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/2 up/down: 70/-19) Total: 51 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* read_key: ignore unknown keys (do not return them to caller byte-by-byte)Denys Vlasenko2009-10-261-50/+74
| | | | | | | function old new delta read_key 568 601 +33 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* read_key: remove handling for ctrl-up/down, we don't use that. -12 bytesDenys Vlasenko2009-10-261-2/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* read_key: document more weird key sequencesDenys Vlasenko2009-10-261-1/+11
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* lineedit: handle Ctrl-arrowsDenys Vlasenko2009-10-251-1/+15
| | | | | | | | | | | | | | | | | | | function old new delta read_line_input 4629 4824 +195 BB_isalnum - 39 +39 BB_ispunct - 35 +35 BB_isspace - 31 +31 static.esccmds 69 93 +24 vi_word_motion 165 162 -3 vi_back_motion 204 198 -6 vi_end_motion 172 163 -9 bb_iswspace 28 - -28 bb_iswpunct 32 - -32 bb_iswalnum 37 - -37 ------------------------------------------------------------------------------ (add/remove: 3/3 grow/shrink: 5/8 up/down: 334/-129) Total: 205 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* comment anc Config.in changes, no code changesDenys Vlasenko2009-10-141-0/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* read_key: drop optimization where we read 3 bytes at onceDenys Vlasenko2009-05-291-5/+8
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* line editing: add an option to emit ESC [ 6 n and use resultsDenys Vlasenko2009-05-171-8/+49
| | | | | | | | | This makes line editing able to recognize case when cursor was not at the beginning of the line. It may also be adapted later to find out display size (serial line users would love it). Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* lineedit: use read_key to recognize ESC sequence.Denys Vlasenko2009-05-151-0/+1
| | | | | | | | | | | | | | | This fixes several vi mode bugs and prepares for further fixes. function old new delta read_line_input 3287 5511 +2224 remember_in_history - 499 +499 lineedit_read_key - 70 +70 read_key 321 332 +11 input_tab 2823 - -2823 ------------------------------------------------------------------------------ (add/remove: 2/1 grow/shrink: 2/0 up/down: 2804/-2823) Total: -19 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* read_key is actually written by Rob, add him to copyright noticeDenis Vlasenko2008-10-261-2/+3
|
* read_key: add comments how Shift and Meta keys looks like.Denis Vlasenko2008-10-251-0/+5
| | | | | no code changes
* less: reuse former vi's key reading code. Improve SIGWINCH handling.Denis Vlasenko2008-10-251-6/+11
| | | | | | | | | | | | | | | function old new delta less_main 2056 2097 +41 getch_nowait 248 273 +25 read_key 310 321 +11 static.esccmds 61 69 +8 count_lines 72 74 +2 less_gets 166 142 -24 less_getch 172 43 -129 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 6/5 up/down: 91/-170) Total: -79 bytes text data bss dec hex filename
* libbb: add forgotten file from previous commit :(Denis Vlasenko2008-10-251-0/+146