mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-03-15 15:05:27 +08:00
docs: Clarify that disowned jobs won't fire on-process/job-exit
Fixes #10381
This commit is contained in:
parent
a551432f5c
commit
c759a98b37
@ -14,6 +14,7 @@ Description
|
||||
-----------
|
||||
|
||||
``disown`` removes the specified :ref:`job <syntax-job-control>` from the list of jobs. The job itself continues to exist, but fish does not keep track of it any longer.
|
||||
This will make fish lose all knowledge of the job, so functions defined with ``--on-process-exit`` or ``--on-job-exit`` will no longer fire.
|
||||
|
||||
Jobs in the list of jobs are sent a hang-up signal when fish terminates, which usually causes the job to terminate; ``disown`` allows these processes to continue regardless.
|
||||
|
||||
|
@ -37,9 +37,11 @@ The following options are available:
|
||||
|
||||
**-j** *PID* or **--on-job-exit** *PID*
|
||||
Run this function when the job containing a child process with the given process identifier *PID* exits. Instead of a PID, the string 'caller' can be specified. This is only allowed when in a command substitution, and will result in the handler being triggered by the exit of the job which created this command substitution.
|
||||
This will not trigger for :doc:`disowned <disown>` jobs.
|
||||
|
||||
**-p** *PID* or **--on-process-exit** *PID*
|
||||
Run this function when the fish child process with process ID PID exits. Instead of a PID, for backward compatibility, "``%self``" can be specified as an alias for ``$fish_pid``, and the function will be run when the current fish instance exits.
|
||||
This will not trigger for :doc:`disowned <disown>` jobs.
|
||||
|
||||
**-s** *SIGSPEC* or **--on-signal** *SIGSPEC*
|
||||
Run this function when the signal ``SIGSPEC`` is delivered. ``SIGSPEC`` can be a signal number, or the signal name, such as ``SIGHUP`` (or just ``HUP``). Note that the signal must have been delivered to :program:`fish`; for example, :kbd:`Ctrl-C` sends ``SIGINT`` to the foreground process group, which will not be :program:`fish` if you are running another command at the time. Observing a signal will prevent fish from exiting in response to that signal.
|
||||
|
Loading…
x
Reference in New Issue
Block a user