Differences between revisions 9 and 10
Revision 9 as of 2023-01-27 18:15:24
Size: 1135
Comment:
Revision 10 as of 2023-01-27 18:26:54
Size: 1485
Comment:
Deletions are marked like this. Additions are marked like this.
Line 43: Line 43:
----



== Window Size ==

If `checkwinsize` is enabled, `bash(1)` checks the window size after every (non-builtin) command. This triggers updates to the `$LINES` and `$COLUMNS` [[Bash/ShellVariables#Not_Useful|shell variables]].

This is a sensible default for all interactive shells.

{{{
[[ $DISPLAY ]] && shopt -s checkwinsize
}}}

Bash Shell Options

A POSIX compliant shell can be configured with the set and unset builtins. To inspect the enabled options, use the $SHELLOPTS shell variable.

bash(1) expands on the set of configuration options. These options are set with the shopt builtins. To inspect the enabled options, use the $BASHOPTS shell variable.


Compatibility Levels

bash(1) 4 introduced compatibility levels, wherein the behavior of the shell are modified.

shopt -e compat31

The modes available through the shopt builtin are:

  • compat31

  • compat32

  • compat40

  • compat41

  • compat42

  • compat43

  • compat44

A shell only has one compatibility level, so each mode is mutually exclusive.

From bash(1) 4.3+, use of the $BASH_COMPAT shell variable is preferred.


Extended Debugging Mode

extdebug


Window Size

If checkwinsize is enabled, bash(1) checks the window size after every (non-builtin) command. This triggers updates to the $LINES and $COLUMNS shell variables.

This is a sensible default for all interactive shells.

[[ $DISPLAY ]] && shopt -s checkwinsize


CategoryRicottone

Bash/ShellOptions (last edited 2023-04-03 03:07:16 by DominicRicottone)