[environment] Use setopt NO_FOO instead of unsetopt FOO
As used in other modules. Also easier to document in the comments and README. Replace table by bulleted list so it's possible to use `|` in the text without breaking the Markdown rendering.
This commit is contained in:
parent
e7275a9758
commit
3b7eeda8f7
2 changed files with 24 additions and 29 deletions
|
@ -1,21 +1,19 @@
|
||||||
Environment
|
environment
|
||||||
===========
|
===========
|
||||||
|
|
||||||
Sets generic Zsh built-in environment options.
|
Sets generic zsh built-in environment options.
|
||||||
|
|
||||||
Also enables smart URL-pasting. This prevents the user from having to manually escape URLs.
|
Also enables smart URL-pasting. This prevents the user from having to manually escape URLs.
|
||||||
|
|
||||||
Uses `.zimrc` defined `${ztermtitle}` variable to set the terminal title, if defined.
|
Uses `.zimrc` defined `${ztermtitle}` variable to set the terminal title, if defined.
|
||||||
|
|
||||||
ZSH Options
|
zsh options
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
| Option | Effect |
|
* `AUTO_RESUME` resumes an existing job before creating a new one.
|
||||||
| ------ | ------ |
|
* `INTERACTIVE_COMMENTS` allows comments starting with `#` in the shell.
|
||||||
| AUTO_RESUME | Resume existing jobs before creating a new job |
|
* `LONG_LIST_JOBS` lists jobs in verbose format by default.
|
||||||
| LONG_LIST_JOBS | Use the verbose list format by default |
|
* `NOTIFY` reports job status immediately instead of waiting for the prompt.
|
||||||
| NOTIFY | Report job status immediately instead of waiting for new prompt |
|
* `NO_BG_NICE` prevents background jobs being given a lower priority.
|
||||||
| INTERACTIVE_COMMENTS | Recognize comments starting with `#` |
|
* `NO_CHECK_JOBS` prevents status report of jobs on shell exit.
|
||||||
| BG_NICE | Disabled to prevent jobs being given a lower priority |
|
* `NO_HUP` prevents SIGHUP to jobs on shell exit.
|
||||||
| HUP | Disabed to prevent SIGHUP to jobs on shell close |
|
|
||||||
| CHECK_JOBS | Disabled to prevent job report on shell close |
|
|
||||||
|
|
|
@ -2,34 +2,31 @@
|
||||||
# generic options and environment settings
|
# generic options and environment settings
|
||||||
#
|
#
|
||||||
|
|
||||||
# use smart URL pasting and escaping
|
# Use smart URL pasting and escaping.
|
||||||
autoload -Uz bracketed-paste-url-magic
|
autoload -Uz bracketed-paste-url-magic && zle -N bracketed-paste bracketed-paste-url-magic
|
||||||
zle -N bracketed-paste bracketed-paste-url-magic
|
autoload -Uz url-quote-magic && zle -N self-insert url-quote-magic
|
||||||
autoload -Uz url-quote-magic
|
|
||||||
zle -N self-insert url-quote-magic
|
|
||||||
|
|
||||||
# Treat single word simple commands without redirection as candidates for resumption of an existing job.
|
# Treat single word simple commands without redirection as candidates for resumption of an existing job.
|
||||||
setopt AUTO_RESUME
|
setopt AUTO_RESUME
|
||||||
|
|
||||||
|
# Allow comments starting with `#` even in interactive shells.
|
||||||
|
setopt INTERACTIVE_COMMENTS
|
||||||
|
|
||||||
# List jobs in the long format by default.
|
# List jobs in the long format by default.
|
||||||
setopt LONG_LIST_JOBS
|
setopt LONG_LIST_JOBS
|
||||||
|
|
||||||
# Report the status of background jobs immediately, rather than waiting until just before printing a prompt.
|
# Report the status of background jobs immediately, rather than waiting until just before printing a prompt.
|
||||||
setopt NOTIFY
|
setopt NOTIFY
|
||||||
|
|
||||||
# Recognize comments starting with `#`.
|
# Prevent runing all background jobs at a lower priority.
|
||||||
setopt INTERACTIVE_COMMENTS
|
setopt NO_BG_NICE
|
||||||
|
|
||||||
# Run all background jobs at a lower priority. This option is set by default.
|
# Prevent reporting the status of background and suspended jobs before exiting a shell with job control.
|
||||||
unsetopt BG_NICE
|
|
||||||
|
|
||||||
# Send the HUP signal to running jobs when the shell exits.
|
|
||||||
unsetopt HUP
|
|
||||||
|
|
||||||
# Report the status of background and suspended jobs before exiting a shell with job control;
|
|
||||||
# a second attempt to exit the shell will succeed.
|
|
||||||
# NO_CHECK_JOBS is best used only in combination with NO_HUP, else such jobs will be killed automatically.
|
# NO_CHECK_JOBS is best used only in combination with NO_HUP, else such jobs will be killed automatically.
|
||||||
unsetopt CHECK_JOBS
|
setopt NO_CHECK_JOBS
|
||||||
|
|
||||||
|
# Prevent sending the HUP signal to running jobs when the shell exits.
|
||||||
|
setopt NO_HUP
|
||||||
|
|
||||||
# Remove path separtor from WORDCHARS.
|
# Remove path separtor from WORDCHARS.
|
||||||
WORDCHARS=${WORDCHARS//[\/]}
|
WORDCHARS=${WORDCHARS//[\/]}
|
||||||
|
@ -45,7 +42,7 @@ fi
|
||||||
|
|
||||||
# sets the window title and updates upon directory change
|
# sets the window title and updates upon directory change
|
||||||
# more work probably needs to be done here to support multiplexers
|
# more work probably needs to be done here to support multiplexers
|
||||||
if (($+ztermtitle)); then
|
if (( ${+ztermtitle} )); then
|
||||||
case ${TERM} in
|
case ${TERM} in
|
||||||
xterm*|*rxvt)
|
xterm*|*rxvt)
|
||||||
precmd() { print -Pn "\e]0;${ztermtitle}\a" }
|
precmd() { print -Pn "\e]0;${ztermtitle}\a" }
|
||||||
|
|
Loading…
Reference in a new issue