Closed lucaswerkmeister closed 7 years ago
IMO this is a bug: dgsh should not have attempted to negotiate.
On the other hand, ou're trying to mix water with oil: having dgsh (rather than bash) execute a script where you've forced commands to be non-dgsh compatible. I assume this is an example of a more complex scenario. What are you trying to achieve?
having dgsh (rather than bash) execute a script where you've forced commands to be non-dgsh compatible.
The same bug occurs with cat
instead of /bin/cat
(and the printed garbage in that case includes dgsh-tee
, so presumably that time it’s using the dgsh version) – I just thought the version without dgsh-aware tools was the simpler one to reproduce the bug.
I assume this is an example of a more complex scenario. What are you trying to achieve?
The more complex scenario is the script (see also the comment on the gist for details) that I shared near the end of the bug (which includes a multipipe); even though the error that occurs is different, both scripts have a pipeline ending in a function, and in both cases the workaround is to append cat
to the pipeline, so I suspect it’s the same bug.
You definitely need cat or a similar gathering command at the end of the multipipe, because summarizeDescriptions
cannot accept four inputs, so the negotiation would fail.
There already is a cat
after the multipipe, but this is the buggy version of the script. The workaround is another cat
after summarizeDescriptions
.
You are right, it should be the same bug. I have tracked it down and I am working on a solution. Hopefully, I will have it tomorrow.
Does it resolve the bug?
Seems to have fixed it, thanks!
With the following content in the file
script
,dgsh script
results in the following output:The garbage at the beginning is printed immediately and looks a lot like random memory being dumped. The rest of the output is printed after the five second timeout.
In a similar script, which you can find in this gist, I’ve also encountered an assertion failure:
In both cases, there’s a simple workaround: pipe to
cat
.Might be related to or duplicate of #4.