mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-21 08:10:24 +08:00
Implement $last_pid, taking the place of %last
Set as a global variable upon the execution of a background job.
This commit is contained in:
parent
f7e0cbc7a4
commit
26cc112096
@ -1149,6 +1149,7 @@ void exec_job(parser_t &parser, job_t *j) {
|
||||
j->set_flag(JOB_CONSTRUCTED, true);
|
||||
if (!j->get_flag(JOB_FOREGROUND)) {
|
||||
proc_last_bg_pid = j->pgid;
|
||||
env_set(L"last_pid", ENV_GLOBAL, { to_string(proc_last_bg_pid) });
|
||||
}
|
||||
|
||||
if (!exec_error) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user