commit: 9c179f6168bb9c2bf2aa6e46805be33454faa290
parent: 1bcebb56c19af88f770cc04986de87d03df550bf
author: Brian Callahan <bcallah@openbsd.org>
date: Sun, 7 Apr 2019 17:44:10 -0400
Update oksh.1
Closes #32
1 file changed, 40 insertions(+), 17 deletions(-)
diff --git a/oksh.1 b/oksh.1
@@ -1,8 +1,8 @@
-.\" $OpenBSD: ksh.1,v 1.195 2017/08/30 17:08:45 jca Exp $
+.\" $OpenBSD: ksh.1,v 1.203 2019/04/03 14:55:12 jca Exp $
.\"
.\" Public Domain
.\"
-.Dd $Mdocdate: August 30 2017 $
+.Dd $Mdocdate: April 3 2019 $
.Dt OKSH 1
.Os
.Sh NAME
@@ -540,7 +540,7 @@ if no
.Ar list
is executed, the exit status is zero.
.It Xo Ic for Ar name
-.Oo Cm in Ar word No ... Oc ;
+.Op Cm in Op Ar word ... ;
.Cm do Ar list ; Cm done
.Xc
For each
@@ -564,10 +564,10 @@ e.g.\&
The exit status of a
.Ic for
statement is the last exit status of
-.Ar list ;
-if
+.Ar list .
+If there are no items,
.Ar list
-is never executed, the exit status is zero.
+is not executed and the exit status is zero.
.It Xo Ic if Ar list ;
.Cm then Ar list ;
.Oo Cm elif Ar list ;
@@ -858,8 +858,6 @@ The following command aliases are defined automatically by the shell:
.Ic r Ns ='fc -s'
.It
.Ic stop Ns ='kill -STOP'
-.It
-.Ic type Ns ='whence -v'
.El
.Pp
Tracked aliases allow the shell to remember where it found a particular
@@ -1539,7 +1537,7 @@ By the way, don't blame me for
this hack; it's in the original
.Nm .
.Pp
-The default prompt is
+The default prompt is the first part of the hostname, followed by
.Sq $\ \&
for non-root users,
.Sq #\ \&
@@ -1719,6 +1717,10 @@ loops to store the value that is read from standard input.
The number of seconds since the shell started or, if the parameter has been
assigned an integer value, the number of seconds since the assignment plus the
value that was assigned.
+.It Ev TERM
+The user's terminal type.
+If set, it will be used to determine the escape sequence used to
+clear the screen.
.It Ev TMOUT
If set to a positive integer in an interactive shell, it specifies the maximum
number of seconds the shell will wait for input after printing the primary
@@ -2788,11 +2790,16 @@ for more information.
.Ar string Ns = Ns Op Ar editing-command
.Ar ...
.Xc
-The specified editing command is bound to the given
+In
+.Sx Emacs editing mode ,
+the specified editing command is bound to the given
.Ar string .
Future input of the
.Ar string
will cause the editing command to be immediately invoked.
+Bindings have no effect in
+.Sx Vi editing mode .
+.Pp
If the
.Fl m
flag is given, the specified input
@@ -4070,6 +4077,11 @@ traps in functions are not yet implemented.
.It Ic true
A command that exits with a zero value.
.Pp
+.It Ic type
+Short form of
+.Ic command Fl V
+(see above).
+.Pp
.It Xo
.Ic typeset
.Oo
@@ -4656,7 +4668,7 @@ Simply causes the character to appear as literal input.
Most ordinary characters are bound to this.
.It Xo backward-char:
.Op Ar n
-.No ^B , ^XD
+.No ^B , ^X^D
.Xc
Moves the cursor backward
.Ar n
@@ -4682,6 +4694,11 @@ Moves the cursor to the beginning of the edited input line.
Uppercase the first character in the next
.Ar n
words, leaving the cursor past the end of the last word.
+.It clear-screen: ^L
+Clears the screen if the
+.Ev TERM
+parameter is set and the terminal supports clearing the screen, then
+reprints the prompt string and the current input line.
.It comment: ^[#
If the current line does not begin with a comment character, one is added at
the beginning of the line and the line is entered (as if return had been
@@ -4749,7 +4766,7 @@ Deletes
characters after the cursor.
.It Xo delete-word-backward:
.Op Ar n
-.No ERASE , ^[^? , ^[^H , ^[h
+.No WERASE , ^[ERASE , ^W, ^[^? , ^[^H , ^[h
.Xc
Deletes
.Ar n
@@ -4758,9 +4775,9 @@ words before the cursor.
.Op Ar n
.No ^[d
.Xc
-Deletes characters after the cursor up to the end of
+Deletes
.Ar n
-words.
+words after the cursor.
.It Xo down-history:
.Op Ar n
.No ^N , ^XB
@@ -4830,8 +4847,6 @@ Goes to history number
.Ar n .
.It kill-line: KILL
Deletes the entire input line.
-.It kill-region: ^W
-Deletes the input between the cursor and the mark.
.It Xo kill-to-eol:
.Op Ar n
.No ^K
@@ -4876,7 +4891,7 @@ The last
word of the previous command is inserted at the cursor.
.It quote: ^^
The following character is taken literally rather than as an editing command.
-.It redraw: ^L
+.It redraw:
Reprints the prompt string and the current input line.
.It Xo search-character-backward:
.Op Ar n
@@ -4938,6 +4953,14 @@ Immediately after a
.Ic yank ,
replaces the inserted text string with the next previously killed text string.
.El
+.Pp
+The following editing commands lack default bindings but can be used with the
+.Ic bind
+command:
+.Bl -tag -width Ds
+.It kill-region
+Deletes the input between the cursor and the mark.
+.El
.Ss Vi editing mode
The vi command-line editor in
.Nm