Skip to content

Fix exec for heredoc commands #139

@deathbyknowledge

Description

@deathbyknowledge

Currently any command that uses heredoc format will hang when using exec because of the line here:

script += `  { ${command}; } > >(while IFS= read -r line || [[ -n "$line" ]]; do printf '\\x01\\x01\\x01%s\\n' "$line"; done >> "$log") 2> >(while IFS= read -r line || [[ -n "$line" ]]; do printf '\\x02\\x02\\x02%s\\n' "$line"; done >> "$log")\n`;

I think it's because bash expects the heredoc terminator to be alone on its line and we're putting the user command in a single physical line. So I think a simple fix would be to format the commands to make sure they start/end with new lines?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions