aboutsummaryrefslogtreecommitdiff
path: root/libbb/lineedit.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
| * line editing: make read_line_input() not take timeout paramDenys Vlasenko2017-08-021-7/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's almost always -1. function old new delta read_line_input 3902 3912 +10 new_line_input_t 24 31 +7 pgetc 583 585 +2 save_command_ps_at_cur_history 80 78 -2 read_line 76 74 -2 fgetc_interactive 246 244 -2 addLines 84 82 -2 doCommands 2226 2222 -4 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/5 up/down: 19/-12) Total: 7 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | lineedit: fix incorrect conflict resolution in bb8d79ead mergeRon Yorston2017-07-291-38/+0
| |
* | ash: remove old code to tab-complete 'busybox' in standalone shellRon Yorston2017-07-291-10/+2
| |
* | Merge branch 'busybox' into mergeRon Yorston2017-07-291-2/+2
|\|
| * shell: make standalone shell tab-complete "busybox"Denys Vlasenko2017-07-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta busybox_main - 624 +624 packed_usage 31758 31777 +19 applet_names 2638 2646 +8 applet_main 1528 1532 +4 applet_install_loc 191 192 +1 run_applet_and_exit 681 78 -603 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 4/1 up/down: 656/-603) Total: 53 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2017-02-081-1/+1
|\|
| * libbb: consolidate the code to set termios unbuffered modeDenys Vlasenko2017-01-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta set_termios_to_raw - 116 +116 count_lines 72 74 +2 powertop_main 1458 1430 -28 top_main 943 914 -29 more_main 759 714 -45 fsck_minix_main 2969 2921 -48 conspy_main 1197 1135 -62 rawmode 99 36 -63 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/6 up/down: 118/-275) Total: -157 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2016-11-291-44/+68
|\|
| * lineedit: simplify code a bitDenys Vlasenko2016-11-281-16/+14
| | | | | | | | | | | | | | | | | | | | | | | | function old new delta lineedit_read_key 155 162 +7 put_prompt 51 46 -5 read_line_input 3722 3715 -7 cmdedit_setwidth 81 50 -31 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/3 up/down: 7/-43) Total: -36 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * lineedit: fix two bugs in SIGWINCH signal handlingDenys Vlasenko2016-11-271-29/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (1) restore entire sigaction, not only signal handler function (2) do not use stdio when not sure WINCH did not interrupt a printf() or such. function old new delta cmdedit_setwidth - 81 +81 read_line_input 3682 3722 +40 lineedit_read_key 138 155 +17 put_prompt 55 51 -4 win_changed 93 47 -46 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 2/2 up/down: 138/-50) Total: 88 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ash,hush: make ^C in interactive mode visually much closer to bash behaviorDenys Vlasenko2016-11-251-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * lineedit: fix handling of repeating Alt-b, Alt-f, Alt-d, Alt-BackspaceRostislav Skudnov2016-11-241-42/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge branch 'busybox' into mergeRon Yorston2016-10-261-1/+1
|\|
| * lineedit: fix completion with applet names. closes 9361Denys Vlasenko2016-10-241-1/+1
| | | | | | | | | | | | Patch by Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch busybox (up to "ash: comment out free(p) just before...")Ron Yorston2016-10-191-8/+14
|\|
| * lineedit: trivial codeshrink for vi-modeNatanael Copa2016-08-141-8/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce and use BB_isalnum_or_underscore(). function old new delta BB_isalnum_or_underscore - 43 +43 vi_word_motion 162 150 -12 vi_end_motion 163 145 -18 vi_back_motion 198 179 -19 BB_isalnum 39 - -39 ------------------------------------------------------------------------------ (add/remove: 1/1 grow/shrink: 0/3 up/down: 43/-88) Total: -45 bytes Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | lineedit: tweak tab completion of commands in standalone shell modeRon Yorston2016-07-081-3/+11
| | | | | | | | | | | | | | | | | | | | When tab-completing commands in standalone shell mode: don't search the list of applet names if the command includes a path separator; since "busybox" doesn't appear in the list of applet names check for it separately.
* | Merge branch 'busybox' into mergeRon Yorston2016-05-161-4/+3
|\|
| * Rewrite iteration through applet names to save a few bytesRon Yorston2016-04-151-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | function old new delta run_applet_and_exit 758 755 -3 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-3) Total: -3 bytes In standalone shell mode the saving increases to 17 bytes. Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | lineedit: move console viewport to cursor on keypressRon Yorston2016-04-261-0/+5
| | | | | | | | | | | | When a normal *nix terminal has been scrolled back through its buffer, any keypress will return to the cursor position. Add code to lineedit.c to do the same for the Windows console.
* | libbb/lineedit: revert last two commitsRon Yorston2016-04-261-26/+1
| | | | | | | | We had a better idea.
* | libbb/lineedit: limit cases where redraw clears to end of screenRon Yorston2016-04-241-0/+25
| | | | | | | | | | The redraw() function only needs to clear to the end of the screen for ^L. In all other cases only clear to end of line.
* | libbb/lineedit: only clear to EOL when deleting characterRon Yorston2016-04-241-2/+2
| | | | | | | | | | When the console buffer is large clearing to the end of the buffer slows deletion noticeably. Only clear to end of line.
* | Merge branch 'busybox' into mergeRon Yorston2015-10-311-1/+3
|\|
| * lineedit: search applets as well as PATH for tab completionRon Yorston2015-10-301-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In standalone shell mode search the applet table as well as PATH when tab completing a command. Use a stupid linear search: we're also about to read all the directories on PATH so efficiency isn't a big concern. function old new delta add_match - 53 +53 complete_cmd_dir_file 687 724 +37 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/0 up/down: 90/0) Total: 90 bytes Signed-off-by: Ron Yorston <rmy@frippery.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | win32: silence some compiler warningsRon Yorston2015-07-151-3/+3
| |
* | lineedit: skip non-executables when tab-completing commandsRon Yorston2015-06-171-0/+3
| | | | | | | | | | Directories on PATH in Windows are stuffed full of DLLs: ignore them when doing tab completion.
* | lineedit: search applets as well as PATH for tab completionRon Yorston2015-06-171-1/+14
| | | | | | | | | | | | | | | | In standalone shell mode search the applet table as well as PATH when tab completing a command. Use a stupid linear search: we're also about to read all the directories on PATH so efficiency isn't a big concern.
* | Merge branch 'busybox' into mergeRon Yorston2015-03-141-16/+19
|\| | | | | | | | | | | Conflicts: coreutils/od_bloaty.c libbb/lineedit.c
| * libbb: introduce and use is_prefixed_with()Denys Vlasenko2015-03-121-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta is_prefixed_with - 18 +18 complete_username 78 77 -1 man_main 737 735 -2 fsck_device 429 427 -2 unpack_ar_archive 80 76 -4 strip_unsafe_prefix 105 101 -4 singlemount 1054 1050 -4 rtc_adjtime_is_utc 90 86 -4 resolve_mount_spec 88 84 -4 parse_one_line 1029 1025 -4 parse_conf 1460 1456 -4 may_wakeup 83 79 -4 loadkmap_main 219 215 -4 get_irqs_from_stat 103 99 -4 get_header_cpio 913 909 -4 findfs_main 79 75 -4 fbsplash_main 1230 1226 -4 load_crontab 776 771 -5 expand_vars_to_list 1151 1146 -5 date_main 881 876 -5 skip_dev_pfx 30 24 -6 make_device 2199 2193 -6 complete_cmd_dir_file 773 767 -6 run_applet_and_exit 715 708 -7 uudecode_main 321 313 -8 pwdx_main 197 189 -8 execute 568 560 -8 i2cdetect_main 1186 1176 -10 procps_scan 1242 1230 -12 procps_read_smaps 1017 1005 -12 process_module 746 734 -12 patch_main 1903 1891 -12 nfsmount 3572 3560 -12 stack_machine 126 112 -14 process_timer_stats 449 435 -14 match_fstype 111 97 -14 do_ipaddr 1344 1330 -14 open_list_and_close 359 343 -16 get_header_tar 1795 1779 -16 prepend_new_eth_table 340 323 -17 fsck_main 1811 1794 -17 find_iface_state 56 38 -18 dnsd_main 1321 1303 -18 base_device 179 158 -21 find_keyword 104 82 -22 handle_incoming_and_exit 2785 2762 -23 parse_and_put_prompt 774 746 -28 modinfo 347 317 -30 find_action 204 171 -33 update_passwd 1470 1436 -34 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/49 up/down: 18/-540) Total: -522 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libpwdgrp: use getpwent() instead of getpwent_r()Denys Vlasenko2015-02-071-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta massage_data_for_non_r_func - 90 +90 bb_internal_getpwent - 69 +69 getXXnam_r 94 162 +68 fill_bounds 131 128 -3 deluser_main 355 310 -45 complete_username 123 78 -45 getXXnam 163 90 -73 massage_data_for_r_func 103 - -103 bb_internal_getpwent_r 121 - -121 ------------------------------------------------------------------------------ (add/remove: 2/2 grow/shrink: 1/5 up/down: 227/-407) Total: -163 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * lineedit: don't block when looking for escape sequence in vi-modeRon Yorston2014-12-151-1/+1
| | | | | | | | | | | | | | | | | | | | In vi-mode lineedit tries to detect some escape sequences. After the ESC it reads the next character to check for certain values. This read should have a timeout or a user-entered ESC to switch to command mode doesn't properly handle the next character. Signed-off-by: Ron Yorston <rmy@tigress.co.uk> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2014-12-141-2/+6
|\| | | | | | | | | | | | | Conflicts: archival/libarchive/open_transformer.c libbb/lineedit.c miscutils/man.c
| * lineedit: don't fall back to simple line input if tty is in raw modeDenys Vlasenko2014-12-101-2/+6
| | | | | | | | | | | | Testcase: shell command input after python ^Z should still work Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | lineedit: don't block when looking for escape sequence in vi-modeRon Yorston2014-12-131-1/+1
| | | | | | | | | | | | | | When in vi-mode lineedit tries to detect some escape sequences. After an escape it reads the next character to check for certain values. This read should have a timeout or a user-entered ESC to switch to command mode doesn't properly handle the next character.
* | lineedit: improve appearance of forward cursor movementRon Yorston2014-04-091-0/+40
| |
* | Use ANSI escape to move cursor back during line editingRon Yorston2014-04-071-0/+2
| | | | | | | | | | | | BusyBox attempts to optimise for slow terminals by using backspace for small movements. In the Windows console this results in the cursor becoming invisible during backward movement.
* | Provide fake getpwent_r to reduce changes from upstreamRon Yorston2014-03-231-4/+0
| |
* | Merge branch 'busybox' into mergeRon Yorston2014-01-131-0/+2
|\| | | | | | | | | | | Conflicts: include/platform.h scripts/basic/fixdep.c
| * lineedit: fix trivial build failureDenys Vlasenko2014-01-101-0/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | libbb: drop unnecessary change from upstream BusyBoxRon Yorston2014-01-081-2/+0
| |
* | Merge branch 'busybox' into mergeRon Yorston2013-08-271-19/+63
|\|
| * lineedit: use unicode_strwidth instead of unicode_strlenDenys Vlasenko2013-08-201-3/+3
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * lineedit: fix multi-line PS1 handling: calculate PS1 length from last \nDenys Vlasenko2013-08-191-14/+30
| | | | | | | | | | | | | | function old new delta parse_and_put_prompt 755 774 +19 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * lineedit: improve Unicode handling (still buggy though)Denys Vlasenko2013-08-191-7/+23
| | | | | | | | | | | | | | | | | | | | | | | | function old new delta unicode_strlen - 31 +31 read_line_input 3876 3879 +3 lineedit_read_key 255 246 -9 parse_and_put_prompt 785 755 -30 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/2 up/down: 34/-39) Total: -5 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ash,hush: history builtinFlemming Madsen2013-04-071-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta show_history - 39 +39 builtin_history - 16 +16 historycmd - 13 +13 bltins1 312 324 +12 builtintab 336 344 +8 popstring 134 140 +6 hush_main 1048 1046 -2 ash_main 1398 1396 -2 size_from_HISTFILESIZE 44 40 -4 ------------------------------------------------------------------------------ (add/remove: 3/0 grow/shrink: 3/3 up/down: 94/-8) Total: 86 bytes Signed-off-by: Flemming Madsen <busybox@themadsens.dk> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2013-04-031-37/+87
|\| | | | | | | | | Conflicts: libbb/lineedit.c
| * lineedit: \W on "/bin" should show "bin", not "/bin"Denys Vlasenko2013-03-291-1/+1
| | | | | | | | | | | | | | function old new delta parse_and_put_prompt 793 785 -8 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * lineedit: implement \T \t \A \@ prompts escapes, fix \W escape, drop \!Denys Vlasenko2013-03-291-37/+47
| | | | | | | | | | | | | | | | function old new delta parse_and_put_prompt 742 793 +51 read_line_input 3836 3826 -10 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * lineedit: add handling of \H in promptDenys Vlasenko2013-03-281-5/+45
| | | | | | | | | | | | Based on the patch by Arnaud RĂ©billout <rebillout@syscom.ch> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>