mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-21 10:25:42 +08:00
fixes to job control changes
The job control changes need a couple of fixes for compatibility with changes I merged while @mqudsi was workin on his change.
This commit is contained in:
parent
52d739c746
commit
083224d1c0
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_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);
|
||||
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);
|
||||
}
|
||||
}
|
||||
env_set(L"SHLVL", nshlvl_str.c_str(), ENV_GLOBAL | ENV_EXPORT);
|
||||
env_set(L"SHLVL", shlvl_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(true);
|
||||
signal_unblock();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user