diff options
Diffstat (limited to 'modules/ext')
| -rw-r--r-- | modules/ext/critical-ext-bundle.js | 5 | ||||
| -rw-r--r-- | modules/ext/shell.js | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/modules/ext/critical-ext-bundle.js b/modules/ext/critical-ext-bundle.js index fb623fd..f892617 100644 --- a/modules/ext/critical-ext-bundle.js +++ b/modules/ext/critical-ext-bundle.js @@ -594,7 +594,10 @@ class ShellModule { // Commands that read from files and should use the pipe buffer file. wc is NOT here any // more: it reads terminal._pipeInput natively (v4.6.111), and injecting __pipebuf__ gave // `3 __pipebuf__` instead of a bare count. - return ['grep', 'head', 'tail', 'sort', 'cut', 'uniq', 'expand'].includes(cmd); + // grep/head/tail/wc read terminal._pipeInput themselves (v4.6.111-116). Injecting the + // __pipebuf__ file for them made `cat f | grep x` match twice (the pipe buffer AND the cwd + // file of the same name) and printed "3 __pipebuf__" from wc. + return ['sort', 'cut', 'uniq', 'expand'].includes(cmd); } // ── Variable substitution ── diff --git a/modules/ext/shell.js b/modules/ext/shell.js index 07f175b..ad66e63 100644 --- a/modules/ext/shell.js +++ b/modules/ext/shell.js @@ -458,7 +458,10 @@ class ShellModule { // Commands that read from files and should use the pipe buffer file. wc is NOT here any // more: it reads terminal._pipeInput natively (v4.6.111), and injecting __pipebuf__ gave // `3 __pipebuf__` instead of a bare count. - return ['grep', 'head', 'tail', 'sort', 'cut', 'uniq', 'expand'].includes(cmd); + // grep/head/tail/wc read terminal._pipeInput themselves (v4.6.111-116). Injecting the + // __pipebuf__ file for them made `cat f | grep x` match twice (the pipe buffer AND the cwd + // file of the same name) and printed "3 __pipebuf__" from wc. + return ['sort', 'cut', 'uniq', 'expand'].includes(cmd); } // ── Variable substitution ── |