mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00: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
1 changed files with 1 additions and 0 deletions
|
@ -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…
Reference in a new issue