Commit 293d661
Fix shellv2 multi-line code paste parsing (#2092)
* fix: properly handle multiline block pasting in shellv2
When users pasted multiline string blocks (e.g. from Python code),
the BrowserRepl was evaluating each line individually with `\n` mapped to Enter.
Consequently, double newlines representing empty lines within blocks prematurely triggered
the REPL to end execution contexts, preventing entire copy-paste sequences from loading correctly.
This commit updates the `BrowserWasmAdapter` to process pasted blocks via a single method
(`paste_input`), sequentially submitting and managing completion buffers.
In the frontend hook, paste multi-character sequences containing linebreaks are now captured
and passed as a solid chunk, while simple append logic remains unmodified.
Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>
* fix: correctly handle multiline python code paste blocks in shellv2
Pasting multi-line Python snippets containing empty lines caused the
frontend `BrowserRepl` loop to misinterpret the empty lines as end-of-block signals when processed line-by-line. This caused premature submission and subsequently threw errors or split logic into disconnected blocks.
This fix modifies `BrowserWasmAdapter`'s `paste_input()` handler to send the entire clipboard payload buffer straight to `BrowserRepl.input(textToInput)` in one piece, correctly preserving the block logic without prematurely submitting execution on intermediate blank lines.
Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>
* file cleanup and rebuild
---------
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com>1 parent 79f1d98 commit 293d661
File tree
9 files changed
+102
-12
lines changed- tavern/internal/www
- build
- static/js
- wasm
- public/wasm
- src
- lib
- pages/shellv2/hooks
9 files changed
+102
-12
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.
Binary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
144 | 185 | | |
145 | 186 | | |
146 | 187 | | |
| |||
Lines changed: 53 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
892 | 892 | | |
893 | 893 | | |
894 | 894 | | |
895 | | - | |
896 | | - | |
897 | | - | |
898 | | - | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
899 | 948 | | |
900 | 949 | | |
901 | 950 | | |
| |||
0 commit comments