@@ -241,7 +241,7 @@ func (s *Shell) execPOSIX(ctx context.Context, command string) (string, string,
241 interp.Interactive(false),
241 interp.Interactive(false),
242 interp.Env(expand.ListEnviron(s.env...)),
242 interp.Env(expand.ListEnviron(s.env...)),
243 interp.Dir(s.cwd),
243 interp.Dir(s.cwd),
244− interp.ExecHandlers(s.blockHandler(), coreutils.ExecHandler),
244+ interp.ExecHandlers(s.execHandlers()...),
246 if err != nil {
246 if err != nil {
247 return "", "", fmt.Errorf("could not run command: %w", err)
247 return "", "", fmt.Errorf("could not run command: %w", err)
@@ -257,6 +257,16 @@ func (s *Shell) execPOSIX(ctx context.Context, command string) (string, string,
257 return stdout.String(), stderr.String(), err
257 return stdout.String(), stderr.String(), err
260+func (s *Shell) execHandlers() []func(next interp.ExecHandlerFunc) interp.ExecHandlerFunc {
261+ handlers := []func(next interp.ExecHandlerFunc) interp.ExecHandlerFunc{
265+ handlers = append(handlers, coreutils.ExecHandler)
260// IsInterrupt checks if an error is due to interruption
270// IsInterrupt checks if an error is due to interruption
261func IsInterrupt(err error) bool {
271func IsInterrupt(err error) bool {
262 return errors.Is(err, context.Canceled) ||
272 return errors.Is(err, context.Canceled) ||