aboutsummaryrefslogtreecommitdiff
path: root/libbb/lineedit.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* | 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>
* | Merge branch 'busybox' into mergeRon Yorston2013-03-191-0/+1
|\|
| * lineedit: initialize delptrShawn J. Goff2013-02-271-0/+1
| | | | | | | | | | | | | | | | In vi mode, the 'p' and 'P' commands caused a segfault when nothing had been put in the buffer yet because the delptr was not initialized. Signed-off-by: Shawn J. Goff <shawn7400@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2012-10-101-1/+2
|\|
| * lineedit: in !EDITING config, return -1 on fgets errorDenys Vlasenko2012-09-271-1/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2012-09-071-3/+3
|\| | | | | | | | | | | Conflicts: include/libbb.h shell/ash.c
| * lineedit: fix Alt-D when cursor==0Cliff Frey2012-08-071-3/+3
| | | | | | | | | | Signed-off-by: Cliff Frey <cliff@meraki.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | lineedit: disable hack for wrong width on MinGWRon Yorston2012-05-011-1/+1
| |
* | Merge branch 'busybox' into mergeRon Yorston2012-04-291-4/+2
|\|
| * lineedit: histfile can get emptied when CONFIG_FEATURE_EDITING_SAVE_ON_EXIT=yDennis Groenen2012-04-261-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When CONFIG_FEATURE_EDITING_SAVE_ON_EXIT is set to y, the histfile will get cleared if the total amount of history lines is less than MAX_HISTORY. Only if the histfile is not empty _and_ the amount of lines currently in memory are equal to or greater than MAX_HISTORY, history saving will work as expected with this feature enabled. Output from defconfig + CONFIG_FEATURE_EDITING_SAVE_ON_EXIT=y: $ echo "foo" > ~/.ash_history $ ./busybox ash ~/busybox/a $ echo "bar" > /dev/null ~/busybox/a $ exit $ cat ~/.ash_history $ Output with the patch applied and same config as above: $ echo "foo" > ~/.ash_history $ ./busybox ash ~/busybox/b $ echo "bar" > /dev/null ~/busybox/b $ exit $ cat ~/.ash_history foo echo "bar" > /dev/null exit $ Signed-off-by: Dennis Groenen <tj.groenen at gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | win32: support fancy prompts and (limited) tilde expansionRon Yorston2012-04-231-0/+10
| |
* | Merge commit '1_20_0' into mergeRon Yorston2012-04-231-1/+1
|\|
| * whitespace fixesDenys Vlasenko2012-04-201-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2012-03-231-6/+9
|\| | | | | | | | | Conflicts: Makefile.flags
| * shell_builtin_read: set cc[VMIN] to 1; lineedit: don't clear c_cc[VINTR]Denys Vlasenko2012-01-151-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | First change fixes "read -n NUM". Apparently poll() won't report data availability if cc[VMIN] > 1 until there are at least cc[VMIN] bytes. function old new delta read_line_input 3885 3877 -8 shell_builtin_read 1097 1087 -10 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-18) Total: -18 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge commit 'c0cae52662ccced9df19f19ec94238d1b1e3bd71' into mergeRon Yorston2012-03-231-8/+102
|\| | | | | | | | | | | Conflicts: Makefile.flags scripts/basic/fixdep.c
| * lineedit: fix build failureDenys Vlasenko2011-11-041-1/+3
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * lineedit: add support for M-b, M-f, M-d, M-BackspaceDenys Vlasenko2011-11-031-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | 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>