mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-30 06:03:49 +08:00
19 lines
543 B
Fish
19 lines
543 B
Fish
|
# If the user hasn't set it, make sure our test level has a value
|
||
|
if not set -q suspend_minimum_SHLVL
|
||
|
set -g suspend_minimum_SHLVL 3
|
||
|
end
|
||
|
|
||
|
|
||
|
function suspend -d "Suspend the current shell."
|
||
|
if begin contains -- $argv --force
|
||
|
or not status --is-interactive
|
||
|
or begin test $SHLVL -ge $suspend_minimum_SHLVL
|
||
|
and not status --is-login
|
||
|
end
|
||
|
end
|
||
|
kill -STOP %self
|
||
|
else
|
||
|
echo 2>&1 Cannot suspend login shell or SHLVL to low, use --force to force.
|
||
|
end
|
||
|
end
|