Commit 05cfd7f
authored
fix(tui): stop /shell dropping quotes from the command it runs (#44)
/shell <cmd> re-joined the tokenized command line with spaces before handing
it to $SHELL -c, so every quote and escape the user typed was lost and the
shell re-split the result. `/shell git commit -m "two words"` ran with two
separate arguments; `/shell printf "[%s]\n" "two words"` printed
`[two]n[words]n`.
The !cmd escape already takes the raw remainder of the line for exactly this
reason. Do the same for /shell so both paths behave identically.
Adds two regression tests: one asserting a quoted argument survives, one
asserting /shell and !cmd produce identical output for the same command.
Co-authored-by: clawedassistant26 <307253840+clawedassistant26@users.noreply.github.com>1 parent 171f7bd commit 05cfd7f
2 files changed
Lines changed: 36 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
108 | 117 | | |
109 | 118 | | |
110 | 119 | | |
| |||
361 | 370 | | |
362 | 371 | | |
363 | 372 | | |
| 373 | + | |
364 | 374 | | |
365 | | - | |
| 375 | + | |
366 | 376 | | |
367 | 377 | | |
368 | 378 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
0 commit comments