mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-17 16:11:15 -03:00
Thread pgroups into command substitutions
Give string expansion an (optional) parent pgroup. This is threaded all the way into eval(). This ensures that in a mixed pipeline like: cmd | begin ; something (cmd2) ; end that cmd2 and cmd have the same pgroup. Add a test to ensure that command substitutions inherit pgroups properly. Fixes #6624
This commit is contained in:
@@ -282,19 +282,20 @@ class parser_t : public std::enable_shared_from_this<parser_t> {
|
||||
///
|
||||
/// \param cmd the string to evaluate
|
||||
/// \param io io redirections to perform on all started jobs
|
||||
/// \param parent_pgid if set, the pgid to give to spawned jobs
|
||||
/// \param block_type The type of block to push on the block stack, which must be either 'top'
|
||||
/// or 'subst'.
|
||||
/// \param break_expand If not null, return by reference whether the error ought to be an expand
|
||||
/// error. This includes nested expand errors, and command-not-found.
|
||||
///
|
||||
/// \return the result of evaluation.
|
||||
eval_res_t eval(const wcstring &cmd, const io_chain_t &io,
|
||||
eval_res_t eval(const wcstring &cmd, const io_chain_t &io, maybe_t<pid_t> parent_pgid = {},
|
||||
block_type_t block_type = block_type_t::top);
|
||||
|
||||
/// Evaluate the parsed source ps.
|
||||
/// Because the source has been parsed, a syntax error is impossible.
|
||||
eval_res_t eval(const parsed_source_ref_t &ps, const io_chain_t &io,
|
||||
block_type_t block_type = block_type_t::top);
|
||||
maybe_t<pid_t> parent_pgid = {}, block_type_t block_type = block_type_t::top);
|
||||
|
||||
/// Evaluates a node.
|
||||
/// The node type must be grammar::statement or grammar::job_list.
|
||||
|
||||
Reference in New Issue
Block a user