Base: Document the Shell's new termios allow-list

Also add `stty` to that list by default.
This commit is contained in:
Ali Mohammad Pur 2021-05-24 16:57:27 +04:30 committed by Ali Mohammad Pur
parent b2ef18d538
commit 27572c9d34
Notes: sideshowbarker 2024-07-18 17:27:12 +09:00
2 changed files with 11 additions and 0 deletions

View File

@ -40,3 +40,5 @@ if [ "$(id -u)" = "0" ] {
export PROMPT="\\X\\u@\\h:\\w\\a\\e[$prompt_color;1m\\h\\e[0m:\\e[34;1m\\w\\e[0m \\p "
export HISTORY_AUTOSAVE_TIME_MS=10000
PROGRAMS_ALLOWED_TO_MODIFY_DEFAULT_TERMIOS=(stty)

View File

@ -40,6 +40,15 @@ If `t` is not a non-negative integer, zero will be assumed.
Note that multiple shell instances will not interfere with each other if they are to save to the same history file, instead, the entries will all be merged together chronologically.
The default value for this option is set in `/etc/shellrc`.
3. Terminal settings
`PROGRAMS_ALLOWED_TO_MODIFY_DEFAULT_TERMIOS` (local)
The list value stored in this variable is used as an allow-list to filter programs that may modify the current terminal settings (i.e. default termios configuration) of the current shell session.
By default, this list includes `stty`, making it possible for the user to modify the terminal settings from within the shell.
Note that the shell will revert any termios changes if the running program is not in this list, or if it failed to run successfully (exited with an exit code other than zero).
Also note that the line editor will re-evaluate the keybindings and sync them when such a change occurs.
## Visual
1. Prompting