summaryrefslogtreecommitdiff
path: root/bin/ksh
AgeCommit message (Collapse)Author
2017-07-22Use monotonic clock for the time command in csh and ksh.anton
From Scott Cheloha ok tb@
2017-07-06fix broken cross references; found with mandoc -TlintIngo Schwarze
2017-07-04Backout previous due to a bug discovered by zhuk@ that requires some tinkeringanton
and is not an easy fix for now.
2017-07-04Add support for pattern substitution to variables in ksh using a common syntaxanton
borrowed from ksh93. Survived a ports build performed by naddy@ and encouraged by many.
2017-06-29Increase the input line buffer to 4096 bytes.Martijn van Duren
Sounds good to deraadt@ OK anton@
2017-06-25No need to NUL-terminate the line buffer since it's handled by x_e_getu8() byanton
now. ok schwarze@
2017-06-25Don't output partial UTF-8 characters in ksh emacs mode. Instead, try to read aanton
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@
2017-06-20'^T' is documented to be bounded to transpose-chars while in emacsBryan Steele
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@
2017-06-01The fact is simple: Subshells have the same PPID as the current shell.Theo Buehler
What is not so simple is squinting hard enough to conclude that POSIX actually says that. I'm still not sure how to do that. Problem with the shell manual pointed out by "Choose a display name". ok otto, halex, jmc
2017-05-31Let the 's' command delete the right number of bytes when UTF-8Ingo Schwarze
characters are involved; similar to what anton@ previously did for 'r'; OK tb@ anton@; also tested by Walter Alejandro Iglesias <wai at roquesor dot com>.
2017-05-31Allow replacement of UTF-8 characters in vi mode.anton
Reported by Walter Alejandro Iglesias on tech@. ok schwarze@ tb@
2017-05-29Change the mmap(2)-based binary history file with lots of magic and aTheo Buehler
tendency for corruption to a simpler plaintext version. To convert your current ksh history to plaintext, issue fc -ln 1 | sed 's/^ //' > ~/ksh_hist.txt before upgrading and use ksh_hist.txt as HISTFILE after the upgrade. Original patch by marco in 2011. Ported to current during g2k16 by me. Testing, bugfixes and improvements in joint work with natano. Additional testing by anton and mestre. Includes some tweaks by anton. Committing now to shake out remaining bugs before 6.2 is cut. ok deraadt, mestre, anton, sthen
2017-05-28Fix cursor position while removing characters from the command line.anton
While here, remove a condition that becomes redundant. ok schwarze@ tb@
2017-05-26document behaviour when CDPATH unset;Jason McIntyre
requested by a mail on misc, via otto; ok otto
2017-05-12Improve UTF-8 handling on lines that are wider than the terminal,Ingo Schwarze
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@
2017-05-11a little tidy up; from raf czlonkaJason McIntyre
2017-05-01Quiet an "implicit conversion from 'int' to 'char' changes value"Todd C. Miller
warning from clang.
2017-03-16document the "type" built-in, marked as xsi by posix;Jason McIntyre
2017-03-16document the ulimit built-in, which is now marked xsi by posix;Jason McIntyre
noted by scott cheloha
2017-03-16document the "hash" built-in, moved to (posix) base in issue 7;Jason McIntyre
2017-02-19Assigning to RANDOM calls srand_deterministic(3), not srand(3),Ingo Schwarze
and simplify the next sentence; triggered by a different patch from Anton dot Lindqvist at gmail dot com. OK millert@ tb@
2016-12-11I missed a bit of the indentation fix from Kartik Agaram.Todd C. Miller
2016-12-11When ERREXIT (set -e) is in effect, don't disable it after aTodd C. Miller
short-circuited `&&` or `||` chain in later iterations of `for` loops. It should be disabled after a short-circuited `&&` or `||` chain only in the *final* iteration of loops (as well as in conditionals, which was already working). From Kartik Agaram.
2016-12-11In execute() we assign xerrorok to a dummy value if it is NULLTodd C. Miller
so there is no need to check xerrorok for NULL after that. From Kartik Agaram.
2016-12-11Fix for() loop indentation for TCASE in execute() and add someTodd C. Miller
braces for improved readability. Based on a diff from Kartik Agaram.
2016-11-14Remove an escaped blank space and insert an No macro to keep \&; at aTheo Buehler
distance from 'Ar command'. This is schwarze's correct version of an initial incorrect diff from me.
2016-11-14Markup improvements:Ingo Schwarze
1. Mark up reserved words intended to appear at the beginning of command lines with .Ic. 2. Mark up syntax elements intended to appear in the middle of command lines with .Cm. This is not only more systematic, but also makes internal search commands like :tif<enter>, :tstop<enter>, and :t[[<enter> work in man(1).
2016-11-12Fix lexicographic order of shell built-ins: trap comes before true.Theo Buehler
2016-10-17simplify implementation of the '$' command, no functional change;Ingo Schwarze
OK nicm@ tb@ czarkoff@
2016-10-17resolve code duplication in domove() for the commands: b B w WIngo Schwarze
no functional change; suggested by tb@
2016-10-17No need to inspect LC_CTYPE:Ingo Schwarze
* It was only used in vi input mode. * No functional change in case of set -o vi-show8. * No functional change if LC_CTYPE is set to UTF-8. * More robust for the default of LC_CTYPE=C on a UTF-8 xterm. Behaviour changes for the combination LC_CTYPE=C with set +o vi-show8 on non-UTF-8 terminals, but that combination is useless and dangerous with or without this patch. If you want to edit individual raw non-ASCII non-UTF-8 bytes on the shell command line, always use set -o vi-show8. (Besides, i doubt that you actually want to do that; better use a real hex editor in the first place.) OK czarkoff@.
2016-10-17Make sure the cursor goes to the first byte of a UTF-8 characterIngo Schwarze
and not to a continuation byte for these commands: b B e E w W | Let {e,E}ndword return the position after the word because that is easier to handle in the caller. OK tb@ czarkoff@
2016-10-15remove the "in the future" notes from the past;Jason McIntyre
from ray lai
2016-10-14Correct description of the "bind" builtin command.Ingo Schwarze
jmc@ finds the key binding stuff "disgusting" (i can't argue with that) and doesn't want to comment on the content, but agrees with the wording.
2016-10-11Partial UTF-8 line editing support for ksh(1) vi input mode;Ingo Schwarze
so far, it covers these commands: a h i l x / This is an isu8cont()-based hack similar in style to what i did in emacs input mode, but less elegant and slightly more intrusive because the vi mode code is much more ugly and less straightforward than the emacs mode code. This one required partial rewrites of a few helper functions, and comments were added while there. This is not perfect, but hopefully reduces people's cursing until a more rigorous solution can be devised (much) later. Some polishing may be useful in tree, in particular adding utf8cont() support to a few missing commands. Mostly written shortly after Christmas 2015. Reminded by and OK czarkoff@. Feedback, partial review and testing, no longer any objection by martijn@. Feedback and testing by tb@. Also read fine to nicm@.
2016-10-07note that ulimit -m is not enforced, spotted by jmcTed Unangst
2016-09-30remove unneccessary .Pp; from jan staryJason McIntyre
2016-09-27Move bug description to the BUGS sectionDmitrij Czarkoff
OK natano@, jmc@ (I forgot to commit it back in mid-August when it was discussed.)
2016-09-08Mark PPID read-only as per the manual. From Anthony Coulter.Todd C. Miller
2016-09-08Add KSH_IGNORE_RDONLY flag and use it in var.c instead of the 0x4Todd C. Miller
magic number.
2016-09-08Allow "typeset -ir FOO" if FOO is not already marked read-only. OK tb@Todd C. Miller
2016-09-08Don't try to look up array names for complete_* that aren'tNicholas Marriott
alphanumeric, spotted by and ok sthen
2016-09-07remove unused variable 'last'David Coppa
ok nicm@
2016-09-04Allow simple custom completions by creating an array namedNicholas Marriott
"complete_commandname_argnum", for example: set -A complete_kill_1 -- -9 -HUP -INFO -KILL -TERM To set completions for the first argument to kill(1). If no complete_* arrays are present, the normal filename completion is offered. positive comments from many; man page ok/tweaks jmc; ok tedu
2016-08-24Use writev(2) to write history records using a single syscall.Todd C. Miller
OK deraadt@
2016-08-24Avoid recursively calling c_fc(). Fixes a core dump from "r r" andTodd C. Miller
other edge cases found by gsoares@. OK tb@ gsoares@
2016-08-16Avoid a compiler warning about use of uninitialized l.beg emittedTheo Buehler
when ksh is compiled with -Os (done in distrib/special): move the bit using XPptrv(l) (which expands to l.beg) where it is actually used and clearly initialized. ok tedu, tweak + ok millert
2016-08-12rework initial text a little, to read better;Jason McIntyre
2016-08-09In emacs incremental search mode (^R),Ingo Schwarze
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@
2016-07-28remove note about command substitution and double quotes: it is probableJason McIntyre
that i misunderstood something when i wrote it; found by guenther and naddy