summaryrefslogtreecommitdiff
path: root/src/mksh.faq
diff options
context:
space:
mode:
Diffstat (limited to 'src/mksh.faq')
-rw-r--r--src/mksh.faq36
1 files changed, 34 insertions, 2 deletions
diff --git a/src/mksh.faq b/src/mksh.faq
index 83e0191..6634d60 100644
--- a/src/mksh.faq
+++ b/src/mksh.faq
@@ -1,4 +1,4 @@
-RCSID: $MirOS: src/bin/mksh/mksh.faq,v 1.7 2020/04/25 12:09:55 tg Exp $
+RCSID: $MirOS: src/bin/mksh/mksh.faq,v 1.10 2020/10/01 22:59:12 tg Exp $
ToC: spelling
Title: How do you spell <tt>mksh</tt>? How do you pronounce it?
@@ -207,7 +207,7 @@ Title: Why doesn’t this use a Makefile to build?
ToC: oldbsd
Title: Why do other BSDs and QNX still use pdksh instead of mksh?
-<p>Some systems are resistent to change, mostly due to bikeshedding
+<p>Some systems are resistant to change, mostly due to bikeshedding
(some people would, for example, rather see all shells banned to
ports/pkgsrc®) and hysterial raisins (historical reasons ☻). Most
BSDs have mksh packages available, and it works on all of them and
@@ -297,6 +297,29 @@ pdksh derivative); <tt>$SH_VERSION</tt> (“PD KSH” as sh), <tt>$YASH_VERSION<
(yash), <tt>$ZSH_VERSION</tt> (or if <tt>$VERSION</tt> begins with “zsh”); a <a
href="@@RELPATH@@ksh-chan.htm#which-shell">list of more approaches</a> exists.
----
+ToC: ctrl-x-e
+Title: Multiline command editing
+
+<p>mksh is very independent of the terminal and external libraries and
+ databases, such as termcap, and therefore is conservative in which ANSI
+ control codes are sent to the terminal.</p>
+<p>For this reason, mksh’s input line editing uses a “windowed one-line”
+ concept: the line the cursor is on is a “window” into the whole input,
+ horizontally scrolled. Some other shells (that are much larger and have
+ more dependencies on external tooling) use a “multi-line” editing mode,
+ and users occasionally wish for this. It is on the long-term TODO, but
+ (due to the aforementioned implications) this is not trivial.</p>
+<p>One way to achieve multi-line editing is to <em>dis</em>able input
+ line editing: <tt>set +o emacs +o vi</tt><br />This will, however, lose
+ you all editing features: tab completion, cursor keys, history, etc.</p>
+<p>Another way, if you don’t need it all the time, is to use a function
+ that spawns your editor on the input line: press <tt>^Xe</tt> in the
+ default emacs mode or <tt>Esc + v</tt> in vi mode. Once you exit the
+ editor, whatever was written there is run; this includes the original
+ command line if you quit without saving, so request the editor to exit
+ nōn-zero (e.g. using jupp’s “abendjoe” command) to prevent execution.
+ This is <em>really</em> useful to write ad-hōc scripts as well.</p>
+----
ToC: ctrl-l-cls
Title: ^L (Ctrl-L) does not clear the screen
@@ -439,6 +462,15 @@ Title: I get an error in this regex comparison
… becomes…<br />
<tt>[[ foo = *@(foo|bar)*baz* ]]</tt></p>
----
+ToC: trim-vector
+Title: ${@?}: bad substitution
+
+<p>In mksh, you cannot assign to or trim a vector (yet). For most
+ cases it is possible to write the affected code in a way avoiding
+ this extension; for example, trimming <tt>${@#foo}</tt> could be
+ applied to <tt>$1</tt> only and <tt>${@?}</tt> can be replaced
+ with a test whether <tt>$# -eq 0</tt>.</p>
+----
ToC: extensions-to-avoid
Title: Are there any extensions to avoid?