set originates from the bourne shell (sh) and is part of the POSIX standard;
shopt is bourne-again shell (bash) specific
$set|grep-eSHELLOPTS-eBASHOPTS# for shoptBASHOPTS=cdspell:checkwinsize:cmdhist:complete_fullquote:expand_aliases:extglob:extquote:force_fignore:globasciiranges:histappend:interactive_comments:login_shell:progcomp:promptvars:sourcepath
# for setSHELLOPTS=braceexpand:emacs:hashall:histexpand:history:interactive-comments:monitor$set-o|column-t|grep-voffbraceexpandonemacsonhashallonhistexpandonhistoryoninteractive-commentsonmonitoron$shopt|column-t|grep-voffcdspelloncheckwinsizeoncmdhistoncomplete_fullquoteonexpand_aliasesonextglobonextquoteonforce_fignoreonglobasciirangesonhistappendoninteractive_commentsonlogin_shellonprogcomponpromptvarsonsourcepathon
setshow-mode-in-prompton# string settings cursor shape# +------------------------------++--------+# color begin color end# +------------+ +---+setemacs-mode-string"\1\e[38;5;240;1m\2╰╶ ᓆ \1\e[0m\2\1\e[3 q\2"# string settings cursor shape# +------------------------------------------++--------+# color begin color begin color end# +------------+ +------+ +---+setvi-ins-mode-string"\1\e[38;5;240;1m\2╰╶ \1\e[33;1m\2ᓎ \1\e[0m\2\1\e[5 q\2"setvi-cmd-mode-string"\1\e[38;5;240;1m\2╰╶ \1\e[34;1m\2ᓏ \1\e[0m\2\1\e[4 q\2"setkeymapemacs"\ee":vi-editing-modesetkeymapvi-command"\ee":emacs-editing-modesetkeymapvi-insert"\ee":vi-movement-mode
#################### VIM ##################### FOR MORE INFORMATION CHECK:# https://wiki.archlinux.org/index.php/Readline# TURN ON VIM (E.G. FOR READLINE)setediting-modevi# SHOW THE VIM MODE IN THE PROMPT (COMMAND OR INSERT)setshow-mode-in-prompton# SET THE MODE STRING AND CURSOR TO INDICATE THE VIM MODE# FOR THE NUMBER AFTER `\e[`:# 0: blinking block# 1: blinking block (default)# 2: steady block# 3: blinking underline# 4: steady underline# 5: blinking bar (xterm)# 6: steady bar (xterm)setvi-ins-mode-string (ins)\1\e[5 q\2set vi-cmd-mode-string (cmd)\1\e[1 q\2
# Set the default readline mode as visetediting-modevi# Show the vi mode indicatorssetshow-mode-in-prompton# The following is a little hard to understand# a full example omiting the wrapping \1 and \2## \e[ (open sequence: ESC CSI)# 48;5; (specifies 256 bg)# 2 (bg color)# m (end)# 1; (bold)# 38;5; (specifies 256 fg)# 0 (fg color)# m (end)# COMMAND (some text to display)# \e[ (open sequence)# 0 (reset)# m (end)# \e[ (open sequence)# 0 (cursor type)# q (end)# Configures the cmd mode displaysetvi-cmd-mode-string"\1\e[48;5;2m\2\1\e[1;38;5;0m\2 N \1\e[0m\2 \1\e[0 q\2"# Configures the ins mode displaysetvi-ins-mode-string"\1\e[48;5;4m\2\1\e[1;38;5;0m\2 I \1\e[0m\2 \1\e[6 q\2"
show options
# display readline variable names and values can be used as input or in a Readline initialization file$bind-v# list current readline variable names and values$bind-vsetbind-tty-special-charsonsetblink-matching-parenoffsetbyte-orientedoffsetcolored-completion-prefixoffsetcolored-statsonsetcompletion-ignore-caseonsetcompletion-map-caseoffsetconvert-metaoffsetdisable-completionoffsetecho-control-charactersonsetenable-active-regionoffsetenable-bracketed-pasteoffsetenable-keypadoffsetenable-meta-keyonsetexpand-tildeoffsethistory-preserve-pointoffsethorizontal-scroll-modeoffsetinput-metaonsetmark-directoriesonsetmark-modified-linesoffsetmark-symlinked-directoriesonsetmatch-hidden-filesonsetmenu-complete-display-prefixoffsetmeta-flagonsetoutput-metaonsetpage-completionsonsetprefer-visible-bellonsetprint-completions-horizontallyonsetrevert-all-at-newlineoffsetshow-all-if-ambiguousonsetshow-all-if-unmodifiedonsetshow-mode-in-promptonsetskip-completed-textonsetvisible-statsonsetbell-styleaudiblesetcomment-begin#setcompletion-display-width-1setcompletion-prefix-display-length0setcompletion-query-items100setediting-modeemacssetemacs-mode-string╰╶ᓆsethistory-size5000setkeymapemacssetkeyseq-timeout500setvi-cmd-mode-string╰╶ᓏsetvi-ins-mode-string╰╶ᓎ
options
active-region-start-color
active-region-end-color
bell-style
bind-tty-special-chars
blink-matching-paren
colored-completion-prefix
colored-stats
comment-begin
completion-display-width
completion-ignore-case
completion-map-case
completion-prefix-display-length
completion-query-items
convert-meta
disable-completion
echo-control-characters
editing-mode
emacs-mode-string
enable-active-region
enable-bracketed-paste
enable-keypad
enable-meta-key
expand-tilde
history-preserve-point
history-size
horizontal-scroll-mode
input-meta
isearch-terminators
keymap
keyseq-timeout
mark-directories
mark-modified-lines
mark-symlinked-directories
match-hidden-files
menu-complete-display-prefix
output-meta
page-completions
print-completions-horizontally
revert-all-at-newline
show-all-if-ambiguous
show-all-if-unmodified
show-mode-in-prompt
skip-completed-text
vi-cmd-mode-string
vi-ins-mode-string
visible-stats
key bindings
# display readline function names and bindings can be used as input or in a readline initialization file$bind-p# list current readline function names and bindings$bind-P## query$bind-p..."\e&":tilde-expand# vi-tilde-expand (not bound)....$bind-qtilde-expandtilde-expandcanbeinvokedvia"\e&".
list all names
$bind-l
inputrc
# https://www.gnu.org/software/bash/manual/bash.html#index-show_002dmode_002din_002dpromptsetshow-mode-in-prompton# SET THE MODE STRING AND CURSOR TO INDICATE THE VIM MODE# FOR THE NUMBER AFTER `\e[`:# 0: blinking block# 1: blinking block (default)# 2: steady block# 3: blinking underline# 4: steady underline# 5: blinking bar (xterm)# 6: steady bar (xterm)setemacs-mode-string╰╶ᓆsetvi-ins-mode-string╰╶ᓎsetvi-cmd-mode-string╰╶ᓏsetemacs-mode-string \1\e[38;5;240;1m\2╰╶ᓆ \1\e[0m\2setvi-ins-mode-string \1\e[38;5;240;1m\2╰╶ \1\e[33;1m\2ᓎ \1\e[0m\2setvi-cmd-mode-string \1\e[38;5;240;1m\2╰╶ \1\e[34;1m\2ᓏ \1\e[0m\2# allow iso-latin1 characters to be insertedsetconvert-metaoff# don't strip characters to 7 bits when readingsetinput-metaonsetcompletion-ignore-caseonsetshow-all-if-ambiguousonsetshow-all-if-unmodifiedonsetmark-symlinked-directoriesonsetprint-completions-horizontallyon# https://github.com/scop/bash-completionsetvisible-statson# https://groups.google.com/g/iterm2-discuss/c/K6YazwKUvjQ/m/7eqeT-AvBgAJsetenable-bracketed-pasteoff# TAB: menu-complete# set colored-completion-prefix onsetcolored-statsonsetskip-completed-texton# ask if more than 100 candidates# set completion-query-items 100setkeymapemacs"\ee":vi-editing-modesetkeymapvi-command"\ee":emacs-editing-mode"dw":kill-word"dd":kill-whole-line"db":backward-kill-word"D":kill-line"v":''"\C-_":undo"\C-a":beginning-of-line"\C-b":backward-char"\C-d":delete-char"\C-e":end-of-line"\C-f":forward-char"\C-g":abort"\C-k":kill-line"\C-l":clear-screen"\C-p":previous-history"\C-n":next-history"\C-w":unix-word-rubout"\C-q":quoted-insert"\C-x\C-r":re-read-init-file"\e#":insert-comment"\e.":insert-last-argument"\e.":yank-last-arg# key bindings to get out of vi-editing-modesetkeymapvi-insert"\ee":emacs-editing-mode"\C-_":undo"\C-a":beginning-of-line"\C-b":backward-char"\C-d":delete-char"\C-e":end-of-line"\C-f":forward-char"\C-g":abort"\C-k":kill-line"\C-l":clear-screen"\C-p":previous-history"\C-n":next-history"\C-w":unix-word-rubout"\C-q":quoted-insert"\C-x\C-r":re-read-init-file"\e#":insert-comment"\e.":insert-last-argument"\e.":yank-last-arg
# https://www.gnu.org/software/bash/manual/bash.html#index-show_002dmode_002din_002dpromptsetshow-mode-in-prompton# SET THE MODE STRING AND CURSOR TO INDICATE THE VIM MODE# FOR THE NUMBER AFTER `\e[`:# 0: blinking block# 1: blinking block (default)# 2: steady block# 3: blinking underline# 4: steady underline# 5: blinking bar (xterm)# 6: steady bar (xterm)setemacs-mode-string╰╶ᓆsetvi-ins-mode-string╰╶ᓎsetvi-cmd-mode-string╰╶ᓏsetemacs-mode-string \1\e[38;5;240;1m\2╰╶ᓆ \1\e[0m\2setvi-ins-mode-string \1\e[38;5;240;1m\2╰╶ \1\e[33;1m\2ᓎ \1\e[0m\2setvi-cmd-mode-string \1\e[38;5;240;1m\2╰╶ \1\e[34;1m\2ᓏ \1\e[0m\2##################### \e : Meta ## \C : Control ###################### allow iso-latin1 characters to be insertedsetconvert-metaoff# don't strip characters to 7 bits when readingsetinput-metaonsetcompletion-ignore-caseonsetshow-all-if-ambiguousonsetshow-all-if-unmodifiedonsetmark-symlinked-directoriesonsetprint-completions-horizontallyon# https://github.com/scop/bash-completionsetvisible-statson# https://groups.google.com/g/iterm2-discuss/c/K6YazwKUvjQ/m/7eqeT-AvBgAJsetenable-bracketed-pasteoff# TAB: menu-complete# set colored-completion-prefix onsetcolored-statsonsetskip-completed-texton# ask if more than 100 candidates# set completion-query-items 100setkeymapemacs"\ee":vi-editing-modesetkeymapvi-command"\ee":emacs-editing-mode# key bindings to get out of vi-editing-modesetkeymapvi-insert"\ee":vi-movement-mode##### emacs #####$if mode=emacs"\ee":vi-editing-mode# `Esc-e`:vi-insert. https://unix.stackexchange.com/a/409866/29178# "\e\e": vi-movement-mode"\e~":complete-username"\e_":yank-last-arg"\e?":possible-completionsMeta-Control-h:backward-kill-word$endif##### vi #####$if mode=vi"\ee":emacs-editing-mode$endif##### command mode #####$if mode=vi-command"\ee":emacs-editing-modev:""Control-a:beginning-of-lineControl-b:backward-charControl-d:delete-charControl-e:end-of-lineControl-f:forward-charControl-k:kill-lineControl-n:next-historyControl-p:previous-history$endif##### insert mode #####$if mode=vi-insert"\ee":emacs-editing-mode"\C-k":kill-line"\C-u":unix-line-discard"\C-p":previous-history"\C-n":next-history"\C-a":beginning-of-line"\C-e":end-of-line"\C-f":forward-char"\C-b":backward-char"\C-l":clear-screen"\C-d":delete-char"\C-h":backward-delete-char"\C-w":unix-word-rubout"\et":transpose-words"\ef":forward-word"\eb":backward-word"\ed":kill-word"\e.":yank-last-arg"\e_":yank-last-arg"\C-_":undo$endif$if Bash# edit the path"\C-xp":"PATH=${PATH}\e\C-e\C-a\ef\C-f"# Quote the current or previous word"\C-xq":"\eb\"\ef\""$endif
$cat~/.inputrcsetconvert-metaoff# allow iso-latin1 characters to be insertedsetinput-metaon# don't strip characters to 7 bits when readingsetcompletion-ignore-caseonsetshow-all-if-ambiguousonsetshow-all-if-unmodifiedonsetmark-symlinked-directoriesonsetprint-completions-horizontallyonsetenable-bracketed-pasteoff# https://groups.google.com/g/iterm2-discuss/c/K6YazwKUvjQ/m/7eqeT-AvBgAJ# set show-mode-in-prompt on# TAB: menu-complete# set colored-completion-prefix on# set colored-stats onsetskip-completed-texton# set completion-query-items 100 # ask if more than 100 candidates# https://unix.stackexchange.com/a/409866/29178setkeymapemacs$if mode=emacs"\ee":vi-editing-mode$endifsetkeymapvi-insert$if mode=vi-insert"\e":vi-movement-mode# "jk": vi-movement-mode# "kj": vi-movement-mode$endif# set editing-mode vi# command modesetkeymapvi-command$if mode=vi-command"\ee":emacs-editing-modev:""Control-a:beginning-of-lineControl-b:backward-charControl-d:delete-charControl-e:end-of-lineControl-f:forward-charControl-k:kill-lineControl-n:next-historyControl-p:previous-history$endif# insert modesetkeymapvi-insert$if mode=vi-insert"\C-k":kill-line"\C-u":unix-line-discard"\C-p":previous-history"\C-n":next-history"\C-a":beginning-of-line"\C-e":end-of-line"\C-f":forward-char"\C-b":backward-char"\C-l":clear-screen"\C-d":delete-char"\C-h":backward-delete-char"\C-w":unix-word-rubout"\et":transpose-words"\ef":forward-word"\eb":backward-word"\ed":kill-word"\e.":yank-last-arg"\e_":yank-last-arg"\C-_":undo$endif
$cat/etc/inputrc# do not bell on tab-completion#set bell-style nonesetmeta-flagonsetinput-metaonsetconvert-metaoffsetoutput-metaon# Completed names which are symbolic links to# directories have a slash appended.setmark-symlinked-directorieson$if mode=emacs# for linux console and RH/Debian xterm"\e[1~":beginning-of-line"\e[4~":end-of-line# commented out keymappings for pgup/pgdown to reach begin/end of history#"\e[5~": beginning-of-history#"\e[6~": end-of-history"\e[5~":history-search-backward"\e[6~":history-search-forward"\e[3~":delete-char"\e[2~":quoted-insert"\e[5C":forward-word"\e[5D":backward-word"\e[1;5C":forward-word"\e[1;5D":backward-word# for rxvt"\e[8~":end-of-line"\eOc":forward-word"\eOd":backward-word# for non RH/Debian xterm, can't hurt for RH/DEbian xterm"\eOH":beginning-of-line"\eOF":end-of-line# for freebsd console"\e[H":beginning-of-line"\e[F":end-of-line$endif
setediting-modevisetshow-mode-in-promptonsetvi-ins-mode-string \1\e[6q\2setvi-cmd-mode-string \1\e[2q\2# optionally:# switch to block cursor before executing a commandsetkeymapvi-insertRETURN:"\e\n"
[!NOTE|label] This is a patched version of bash 4.3.48 that adds support for custom prompt mode indicators.
It also adds support for a \m prompt escape to specify where in the prompt the indicator should occur.
NUMBER
CURSOR SHAPE
-a
-o allexport
-b
cause the status of terminated background jobs to be reported immediately
-e
-o errexit
Exit immediately if a pipeline returns a non-zero status
-o privileged
the $BASH_ENV and $ENV files are not processed
-t
-o onecmd
-u
-o unset
treat unset variables and parameters other than the special parameters '@' or '*' as an error
-v
verbose.
print shell input lines as they are read
-x
-o xtrace
[debug] print commands and their arguments as they are executed
-B
-o braceexpand
shell will perform brace expansion
-c
-o noclobber
prevent output redirection using '>', '>&', and '<>' from overwriting existing files.
-E
-o errtrace
-H
-o histexpand
-P
do not resolve symbolic links
-T
-o functrace
any trap on DEBUG and RETURN are inherited by shell functions
--
if no arguments follow this option, then the positional parameters are unset
-
signal the end of options, cause all remaining arguments to be assigned to the positional parameters
allexport
Same as -a.
braceexpand
Same as -B.
emacs
Use an emacs-style line editing interface.
This also affects the editing interface used for read -e.
errexit
Same as -e.
errtrace
Same as -E.
functrace
Same as -T.
hashall
Same as -h.
histexpand
Same as -H.
history
Enable command history, as described in Bash History Facilities. This option is on by default in interactive shells.
ignoreeof
An interactive shell will not exit upon reading EOF.
keyword
Same as -k.
monitor
Same as -m.
noclobber
Same as -C.
noexec
Same as -n.
noglob
Same as -f.
nolog
Currently ignored.
notify
Same as -b.
nounset
Same as -u.
onecmd
Same as -t.
physical
Same as -P.
pipefail
If set, the return value of a pipeline is the value of the last (rightmost) command to exit with a non-zero status, or zero if all commands in the pipeline exit successfully. This option is disabled by default.
posix
Change the behavior of Bash where the default operation differs from the POSIX standard to match the standard (see Bash POSIX Mode). This is intended to make Bash behave as a strict superset of that standard.
privileged
Same as -p.
verbose
Same as -v.
vi
Use a vi-style line editing interface. This also affects the editing interface used for read -e.
xtrace
Same as -x.
-s
enable ( [s]et )
-u
disable ( [u]nset )
-q
suppresses normal output
-o
set -o
\C-
control prefix
\M-
meta prefix
\e
an escape character
\\
backslash
\"
", a double quotation mark
\'
', a single quote or apostrophe
\a
alert (bell)
\b
backspace
\d
delete
\f
form feed
newline
carriage return
horizontal tab
\v
vertical tab
\nnn
octal value
\xHH
hexadecimal value
alt-.
-
last arg from previous command
alt-d
^[dw
delete the next word on the line
alt-backspace
^[db
delete backwards one word
ctrl-w
^[dT
delete backwards a whole word until white space/punctuation