holzschu / holzschu/a-shell

Shell script containing cat with a long heredoc hangs and breaks further commands

Open
#920 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Perl
Stars
3.9k
Forks
213
Avg merge
1m
Merged PRs (30d)
1

Description

To reproduce, create a test.sh with this content:

```sh
#!/bin/sh

cat << EOF
0123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef
0123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef
0123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef
0123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef
0123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef
0123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef
0123456789abcdef 123456789abcdef 123456789abcdef 123456789abcdef
0123456789abcdef 123456789abcdef 123456789abcdef 1234567
EOF
```

Running `dash test.sh` outputs the heredoc text, as expected.

Now edit test.sh to make the heredoc text one character longer, and run `dash test.sh` again. This produces no output and hangs. The actual content of the heredoc doesn't seem to matter - any heredoc text with more than 512 characters seems to trigger the bug.

Pressing ^D twice appears to return to the a-Shell shell, but any commands started after this point will *also* hang and produce no ouput. The only solution seems to be force-restarting the app.

Tested with a-Shell 1.16.0.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.