mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 21:44:16 +00:00
Revert "fixes to job control changes"
This reverts commit 083224d1c0
.
It was meant for the major branch.
This commit is contained in:
parent
dc5d0ff22f
commit
8aca33b21f
2 changed files with 8 additions and 8 deletions
14
src/exec.cpp
14
src/exec.cpp
|
@ -374,15 +374,15 @@ void internal_exec(job_t *j, const io_chain_t &&all_ios) {
|
|||
// really make sense, so I'm not trying to fix it here.
|
||||
if (!setup_child_process(0, all_ios)) {
|
||||
// Decrement SHLVL as we're removing ourselves from the shell "stack".
|
||||
const env_var_t shlvl_var = env_get(L"SHLVL", ENV_GLOBAL | ENV_EXPORT);
|
||||
wcstring shlvl_str = L"0";
|
||||
if (!shlvl_var.missing()) {
|
||||
long shlvl = fish_wcstol(shlvl_var.c_str());
|
||||
if (!errno && shlvl > 0) {
|
||||
shlvl_str = to_string<long>(shlvl - 1);
|
||||
const env_var_t shlvl_str = env_get_string(L"SHLVL", ENV_GLOBAL | ENV_EXPORT);
|
||||
wcstring nshlvl_str = L"0";
|
||||
if (!shlvl_str.missing()) {
|
||||
long shlvl_i = fish_wcstol(shlvl_str.c_str());
|
||||
if (!errno && shlvl_i > 0) {
|
||||
nshlvl_str = to_string<long>(shlvl_i - 1);
|
||||
}
|
||||
}
|
||||
env_set(L"SHLVL", shlvl_str.c_str(), ENV_GLOBAL | ENV_EXPORT);
|
||||
env_set(L"SHLVL", nshlvl_str.c_str(), ENV_GLOBAL | ENV_EXPORT);
|
||||
|
||||
// launch_process _never_ returns.
|
||||
launch_process_nofork(j->processes.front().get());
|
||||
|
|
|
@ -845,7 +845,7 @@ bool terminal_give_to_job(job_t *j, int cont) {
|
|||
if (errno == ENOTTY) redirect_tty_output();
|
||||
debug(1, _(L"Could not send job %d ('%ls') with pgid %d to foreground"), j->job_id, j->command_wcstr(), j->pgid);
|
||||
wperror(L"tcsetpgrp");
|
||||
signal_unblock();
|
||||
signal_unblock(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue