docs: Clarify that disowned jobs won't fire on-process/job-exit

Fixes #10381
This commit is contained in:
Fabian Boehm 2024-03-19 16:39:37 +01:00
parent a551432f5c
commit c759a98b37
2 changed files with 3 additions and 0 deletions

View File

@ -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.

View File

@ -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.