mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-25 18:03:37 +08:00
functions: list caller-exit handlers correctly
`functions --handlers-type caller-exit` did not list any functions, while `functions --handlers-type process-exit` listed both process-exit and caller-exit handlers: $ echo (function foo --on-job-exit caller; end; functions --handlers-type caller-exit | grep foo) $ echo (function foo --on-job-exit caller; end; functions --handlers-type process-exit | grep foo) caller-exit foo
This commit is contained in:
parent
4a1a59c5a8
commit
ba0bfb9df7
|
@ -10,6 +10,7 @@ Notable improvements and fixes
|
||||||
|
|
||||||
can now be used to clean out all old abbreviations (:issue:`9468`).
|
can now be used to clean out all old abbreviations (:issue:`9468`).
|
||||||
- ``abbr --add --universal`` now warns about --universal being non-functional, to make it easier to detect old-style ``abbr`` calls (:issue:`9475`).
|
- ``abbr --add --universal`` now warns about --universal being non-functional, to make it easier to detect old-style ``abbr`` calls (:issue:`9475`).
|
||||||
|
- ``functions --handlers-type caller-exit`` once again lists functions defined as ``function --on-job-exit caller``, rather than them being listed by ``functions --handlers-type process-exit``.
|
||||||
|
|
||||||
Deprecations and removed features
|
Deprecations and removed features
|
||||||
---------------------------------
|
---------------------------------
|
||||||
|
|
|
@ -418,7 +418,7 @@ static bool filter_matches_event(const wcstring &filter, event_type_t type) {
|
||||||
case event_type_t::job_exit:
|
case event_type_t::job_exit:
|
||||||
return filter == L"job-exit" || filter == L"exit";
|
return filter == L"job-exit" || filter == L"exit";
|
||||||
case event_type_t::caller_exit:
|
case event_type_t::caller_exit:
|
||||||
return filter == L"process-exit" || filter == L"exit";
|
return filter == L"caller-exit" || filter == L"exit";
|
||||||
case event_type_t::generic:
|
case event_type_t::generic:
|
||||||
return filter == L"generic";
|
return filter == L"generic";
|
||||||
}
|
}
|
||||||
|
|
4
tests/checks/caller-exit.fish
Normal file
4
tests/checks/caller-exit.fish
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#RUN: %fish %s
|
||||||
|
echo (function foo1 --on-job-exit caller; end; functions --handlers-type caller-exit | grep foo)
|
||||||
|
# CHECK: caller-exit foo1
|
||||||
|
echo (function foo2 --on-job-exit caller; end; functions --handlers-type process-exit | grep foo)
|
Loading…
Reference in New Issue
Block a user