mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-09 03:51:20 -03:00
Fix up --on-job-exit caller
The `function --on-job-exit caller` feature allows a command substitution to observe when the parent job exits. This has never worked very well - in particular it is based on job IDs, so a function that observes this will run multiple times. Implement it properly. Do this by having a not-recycled "internal job id". This is only used by psub, but ensure it works properly none-the-less.
This commit is contained in:
@@ -148,9 +148,9 @@ struct library_data_t {
|
||||
/// Whether we are currently cleaning processes.
|
||||
bool is_cleaning_procs{false};
|
||||
|
||||
/// The job id of the job being populated.
|
||||
/// The internal job id of the job being populated, or 0 if none.
|
||||
/// This supports the '--on-job-exit caller' feature.
|
||||
job_id_t caller_job_id{-1};
|
||||
internal_job_id_t caller_id{0};
|
||||
|
||||
/// Whether we are running a subshell command.
|
||||
bool is_subshell{false};
|
||||
|
||||
Reference in New Issue
Block a user