mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-23 16:40:24 +02:00
users/17955: new "disown" style for MIME handlers.
Makes handlers put into the background run without job control.
This commit is contained in:
parent
1a4730b8ee
commit
1c9931cc7d
3 changed files with 18 additions and 3 deletions
|
@ -74,7 +74,7 @@ if [[ $suffix != *.* ]]; then
|
|||
fi
|
||||
suffix=${suffix#*.}
|
||||
|
||||
local handler flags no_sh no_bg arg
|
||||
local handler flags no_sh no_bg arg bg_flag="&"
|
||||
integer i
|
||||
local -a exec_asis hand_nonex
|
||||
|
||||
|
@ -89,6 +89,9 @@ zsh-mime-contexts -a $suffix execute-as-is exec_asis || exec_asis=('*(*)' '*(/)'
|
|||
zsh-mime-contexts -a $suffix handle-nonexistent hand_nonex ||
|
||||
hand_nonex=('[[:alpha:]]#:/*')
|
||||
|
||||
# Set to true if the job should be disowned.
|
||||
zsh-mime-contexts -t $suffix disown && bg_flag="&!"
|
||||
|
||||
local pattern
|
||||
local -a files
|
||||
|
||||
|
@ -309,8 +312,8 @@ else
|
|||
# Otherwise it's equivalent to removing the eval and all the quotes,
|
||||
# including the (q) flags.
|
||||
if [[ -n $stdin ]]; then
|
||||
eval cat ${(q)argv} "|" ${(q)execargs} "&"
|
||||
eval cat ${(q)argv} "|" ${(q)execargs} $bg_flag
|
||||
else
|
||||
eval ${(q)execargs} "&"
|
||||
eval ${(q)execargs} $bg_flag
|
||||
fi
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue