Document focus events

This commit is contained in:
Johannes Altmanninger 2024-04-06 18:14:08 +02:00
parent 8a7c3ceec3
commit 444cda20bc
2 changed files with 7 additions and 1 deletions

View file

@ -2078,6 +2078,10 @@ Fish already has the following named events for the ``--on-event`` switch:
- ``fish_cancel`` is emitted when a commandline is cleared.
- ``fish_focus_in`` is emitted when fish's terminal gains focus.
- ``fish_focus_out`` is emitted when fish's terminal loses focus.
Events can be fired with the :doc:`emit <cmds/emit>` command, and do not have to be defined before. The names just need to match. For example::
function handler --on-event imdone

View file

@ -20,7 +20,9 @@ function __fish_complete_function_event_handlers
fish_postexec "After executing an interactive command" \
fish_exit "Right before fish exits" \
fish_cancel "When commandline is cleared" \
fish_posterror "After executing command with syntax errors"
fish_posterror "After executing command with syntax errors" \
fish_focus_in "When fish's terminal gains focus" \
fish_focus_out "When fish's terminal loses focus"
printf "%s\t%s\n" $handlers
end