mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-26 11:01:16 -03:00
Disable job control inside command substitutions
This disables job control inside command substitutions. Prior to this
change, a cmdsub might get its own process group. This caused it to fail
to cancel loops properly. For example:
while true ; echo (sleep 5) ; end
could not be control-C cancelled, because the signal would go to sleep,
and so the loop would continue on. The simplest way to fix this is to
match other shells and not use job control in cmdsubs.
Related is #1362
This commit is contained in:
committed by
David Adam
parent
d27f477ba6
commit
2ca66cff53
@@ -398,6 +398,18 @@ bool parser_t::is_breakpoint() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool parser_t::is_command_substitution() const {
|
||||
for (const auto &b : block_list) {
|
||||
if (b.type() == block_type_t::subst) {
|
||||
return true;
|
||||
} else if (b.type() == block_type_t::source) {
|
||||
// If a function sources a file, don't descend further.
|
||||
break;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
maybe_t<wcstring> parser_t::get_function_name(int level) {
|
||||
if (level == 0) {
|
||||
// Return the function name for the level preceding the most recent breakpoint. If there
|
||||
|
||||
Reference in New Issue
Block a user