Skip to content

Commit

Permalink
Disable SHOPT_EDPREDICT compile-time option by default
Browse files Browse the repository at this point in the history
It's experimental, undocumented, at least somewhat broken, and gets
in the way if you type a comment. Should not be enabled by default,
at least not until someone steps up to fix it properly.

This commit also updates the descriptions of the option to clarify
that this provides a pattern-based history search menu. "Predictive
editing" is a misnomer as this does not predict anything.

Note that Solaris already disables it by default:
https://github.com/oracle/solaris-userland/blob/master/components/ksh93/patches/165-CR7186440_ksh93_disable_predictive_editing.patch

Discussion: #233
  • Loading branch information
McDutchie committed Apr 22, 2021
1 parent 32d1abb commit 9530f09
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/cmd/ksh93/README
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,13 @@ The options have the following defaults and meanings:
process substitutions. On by default on OSs with /dev/fd.
DYNAMIC on Dynamic loading of builtins. (Requires dlopen() interface.)
ECHOPRINT off Make echo equivalent to print.
EDPREDICT on Enables predictive editing. As you type a line beginning
EDPREDICT off Enables history pattern search menu. As you begin a line
with a #, the following characters are treated as a shell
pattern and cause matching lines from the history file to
be displayed as a numbered list as you type. You can
scroll up and down this list or you can use <ESC>nTAB to
make this the current line (n defaults to 1 if omitted).
Experimental. Bugs: https://github.com/ksh93/ksh/issues/233
ESH on Compile with emacs command line editing. The original
emacs line editor code was provided by Mike Veach at IH.
FILESCAN on Experimental option that allows fast reading of files
Expand Down
4 changes: 3 additions & 1 deletion src/cmd/ksh93/SHOPT.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# Compile-time SHOPT_* options for ksh93.
# 1 to enable, 0 to disable, empty value to probe.
#
# For a more complete description of the options, see src/cmd/ksh93/README.
#

SHOPT 2DMATCH=1 # two dimensional ${.sh.match} for ${var//pat/str}
SHOPT ACCT= # accounting
Expand All @@ -16,7 +18,7 @@ SHOPT CRNL= # accept MS Windows newlines (<cr><nl>) for <nl>
SHOPT DEVFD= # use /dev/fd instead of FIFOs for process substitutions
SHOPT DYNAMIC=1 # dynamic loading for builtins
SHOPT ECHOPRINT= # make echo equivalent to print
SHOPT EDPREDICT=1 # predictive editing
SHOPT EDPREDICT=0 # History pattern search menu (type #<pattern>, then ESC <number> TAB). Experimental.
SHOPT ESH=1 # emacs/gmacs edit mode
SHOPT FILESCAN=1 # fast file scan
SHOPT FIXEDARRAY=1 # fixed dimension indexed array
Expand Down

0 comments on commit 9530f09

Please sign in to comment.