diff --git a/doc_src/language.rst b/doc_src/language.rst index f5d343d5d..7228a49ed 100644 --- a/doc_src/language.rst +++ b/doc_src/language.rst @@ -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 ` command, and do not have to be defined before. The names just need to match. For example:: function handler --on-event imdone diff --git a/share/completions/function.fish b/share/completions/function.fish index 18d648e3c..8b941e607 100644 --- a/share/completions/function.fish +++ b/share/completions/function.fish @@ -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