summaryrefslogtreecommitdiffstats
path: root/bin/ksh/emacs.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Use proper function pointer type instead of void *jca2020-05-081-5/+7
| | | | | | | | | | Mixing up function and void pointers isn't defined by POSIX or the C standard. POSIX only specifies that casting the result of dlsym(3) to an appropriate function pointer works. Avoid all this by using a typedef. from Michael Forney, ok tb@
* Bind ^L (C-l) to clear-screen instead of redrawjca2019-04-031-2/+2
| | | | | Slightly more useful for some, same defaults as bash. No objection deraadt@ phessler@, ok tb@ kn@ benno@
* Add clear-screen emacs editing command, currently not bound to amillert2018-06-181-6/+31
| | | | | key by default. The shell will query the terminfo database to find the escape sequence to clear the screen. OK deraadt@
* One minor scan-build warningjca2018-01-161-2/+2
| | | | emacs.c:1041:2: warning: Value stored to 'cp' is never read
* unifdef BRACE_EXPAND; ok jca@anton2018-01-141-2/+2
|
* Remove unused "args" param from kb_add(), it is always NULL.millert2018-01-081-99/+99
| | | | OK anton@ jca@
* Add proper bounds checking to kb_add(). OK anton@millert2018-01-071-11/+12
|
* Bring back the sign compare changes, this time with a fix from otto@millert2018-01-061-9/+8
| | | | that fixes the issues seen on hppa. OK deraadt@ otto@
* Back out sign compare changes that appear to cause problems on hppa.millert2018-01-041-4/+4
| | | | Requested by deraadt@
* Add WARNINGS=yes to ksh and fix the resulting sign compare warnings.millert2018-01-011-4/+4
| | | | OK tb@
* Add -Wshadow to Makefile and fix the resulting warnings. Many ofmillert2017-12-271-3/+1
| | | | | | | the warnings are due to the use of globals with generic names, specifically "options" and "path". I've renamed "options" to "sh_options" since it holds the shell options and "path" to "search_path". OK jca@ tb@
* Add another pair of home/end key bindings; from Lari Rasku.anton2017-12-181-1/+3
| | | | ok jca@
* Remove the "version" interactive function in emacs mode.jca2017-11-261-32/+1
| | | | Not bound by default and not very useful. ok schwarze@ anton@
* Fix some incorrectness related to Emacs editing mode in ksh:anton2017-11-221-3/+3
| | | | | | | | - Keep the order of bindings in sync between the manual and implementation - Fix wrongly documented bindings in the manual - Break out commands without a default binding in the manual ok jmc@ tb@
* Stop exposing the emacs-usemeta option, and warn when trying to set it.jca2017-08-301-4/+1
| | | | | Unused since 2012, to be removed after 6.2. Input from anton@, ok anton@ millert@
* Drop needless commentjca2017-08-301-2/+1
| | | | ok anton@ millert@
* Kill a useless setlocale() queryjca2017-08-291-11/+3
| | | | | | | | Pointless since the removal of the setlocale() call in main.c:rev1.82, the emacs-usemeta flag isn't used in the code since 2012. This kills a chunk of code in a statically linked ksh. ok millert@
* No need to NUL-terminate the line buffer since it's handled by x_e_getu8() byanton2017-06-251-3/+1
| | | | | | now. ok schwarze@
* Don't output partial UTF-8 characters in ksh emacs mode. Instead, try to read aanton2017-06-251-12/+52
| | | | | | | | | complete UTF-8 character first. Fixes an issue while running ksh in tmux where UTF-8 characters inserted in columns other than the last one are discarded. With help from nicm@ and schwarze@ who also wrote the UTF-8 validation, thanks! ok schwarze@
* '^T' is documented to be bounded to transpose-chars while in emacsbrynet2017-06-201-40/+1
| | | | | | | | | | mode, not "stuff". While here, remove the poorly described "stuff" and "stuff" bind functions as well.. In the unlikely event anyone has those in .kshrc, they'll need to be removed. ok anton@
* Improve UTF-8 handling on lines that are wider than the terminal,schwarze2017-05-121-2/+4
| | | | | | | | | | | | | | in two respects: 1. During output in x_e_putc(), when counting display columns, skip UTF-8 continuation bytes. Fixes backward movements that cause horizontal scrolling. 2. After deleting characters, recalculate the last byte that fits on the line. Patch from <Anton dot Lindqvist at gmail dot com> on tech@. OK millert@ tb@
* In emacs incremental search mode (^R),schwarze2016-08-091-3/+4
| | | | | | make commands starting with the escape key (^[) work as documented. Long-standing bug, this time reported by Dave minus Cohen dot com. OK natano@ halex@
* remove a useless macrommcc2016-01-261-2/+4
| | | | ok nicm@
* Next step in UTF-8 support:schwarze2016-01-081-3/+9
| | | | | | | | | | | | | 1. Improve all functions involving words by allowing non-ASCII characters to be part of words. 2. Allow insertion of non-ASCII characters without screwing up the display, by backing up to the start byte after inserting a continuation byte, and starting to re-print there. 3. Fix forward movement which i didn't get quite right in my previous commit: Always advance to a start byte, never to a final continuation byte, or the next insertion would split the character in the middle. OK mpi@
* add another combo for home/end keys that works in tmux.tedu2015-12-301-1/+3
| | | | ok bmercer gsoares nicm sthen
* Move system headers from sh.h to those files that actually need them.tb2015-12-141-1/+3
| | | | ok mmcc@ a while ago
* In emacs command-line editing mode, make sure that moving left andschwarze2015-12-101-5/+24
| | | | | | | | | right can only move by whole characters, not into the middle of a character, and that deleting characters can only delete characters whole, not individual bytes out of characters. Based on parts of a patch by Frederic Nowak <fnwk at mailbox dot org>, tweaked by me. OK tedu@ semarie@ mpi@
* Move string.h include from sh.h to the files that use it.mmcc2015-10-191-1/+2
| | | | ok nicm@
* Apply style(9) to header includes.mmcc2015-10-191-3/+5
| | | | ok nicm@
* Change x_do_ins()'s arg type from int to size_t for correctness's sake,mmcc2015-10-161-4/+2
| | | | | | | and to silence a compiler warning. Also remove its prototype, which is directly above its definition. ok tedu@
* Cast iscntrl()'s arg to unsigned char.mmcc2015-10-161-2/+2
| | | | ok nicm@
* Replace calls to x_emacs_putbuf() with x_do_ins() since allmillert2015-10-101-17/+3
| | | | | x_emacs_putbuf() does is call x_do_ins(). From mksh via Michael McConville
* Unused macros; from Michael McConville.nicm2015-10-101-4/+1
|
* remove null check before afree. from Michael McConvilletedu2015-10-091-3/+2
|
* Last of the (thing *)0 -> NULL, from Michael McConville. No binarynicm2015-09-181-2/+2
| | | | change.
* Replace newline and space defines by "\n" and " " directly, from Michaelnicm2015-09-101-4/+4
| | | | McConville. ok millert
* remove casts and null checks before free. from Michael McConvilletedu2015-09-011-4/+3
| | | | ok deraadt
* Bind the Delete key (ESC[3~) to delete-char-forwardjca2015-03-251-2/+2
| | | | ok mpi@
* bcmp to memcmptedu2015-02-161-3/+3
|
* ctype cleanups. Repeated re-audits of this sensitive area by okan andderaadt2013-12-171-14/+16
| | | | | myself, with a variety of other people spending some time as well. Thanks.
* remove trailing whitespaces; use tabs instead of spaces where appropriate;sobrado2013-11-281-18/+18
| | | | no binary changes.
* Correctly expand bindings containing macros. Fix a regression introducedmpi2012-06-101-7/+15
| | | | in the keybinding system rewrite, reported by Lars Engblom.
* generalise ksh keybinding system - bindings are no longer limited indjm2012-04-301-333/+478
| | | | length and need not start with ESC or ^X; patch from marco@ feedback mpi@
* Fix hang in emacs mode. To reproduce the hang go like: "^[16000l" whichmarco2011-09-051-2/+7
| | | | | | | would insert 16000 letter l'. Going over the line limit makes no sense so limit it's repetition and prevent the hang in the process. ok guenther
* remove unused SILLY game of life.okan2011-03-141-58/+1
| | | | | | no binary change. sure @deraadt
* fix macro handlinghalex2009-06-021-4/+8
|
* fix memory leaks and one potential null deref found by coverity. from netbsd.fgsch2007-08-021-7/+7
| | | | millert@ ok
* fix ksh prompt wrapping, from Marcus Glocker <marcus@nazgul.ch>.beck2006-07-101-3/+22
| | | | | tested by me and naddy, and others... ok naddy@ and me.
* Fix a redraw problem that occurs when a recalled history line hasotto2005-09-261-5/+4
| | | | | length equal to screen width - 2. Spotted by jmc@, tested by various. ok deraadt@
* pascoe noted that ^V in ksh emacs mode is not what you expect -- literalderaadt2005-08-011-2/+2
| | | | | | next as it is every other canonical mode, or emulation of canonical mode. change it to act like it should ok djm david marc tdeval pvalchev