def _repl_subshell()

in core/shelllib.py [0:0]


def _repl_subshell(match):
    command = match.group(1)
    p = subprocess.run(command, stdout=subprocess.PIPE, shell=True, text=True)
    if p.returncode:
        raise ShellExpansionError(f"Command '{command}' failed: status={p.returncode}")
    value = p.stdout
    while value.endswith("\n"):
        value = value[:-1]
    return value