mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-06 00:41:15 -03: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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user