sapper-iq 1.3.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/sapper-ui.mjs +14 -7
package/package.json
CHANGED
package/sapper-ui.mjs
CHANGED
|
@@ -1806,14 +1806,21 @@ function sendPasteToTerm(text) {
|
|
|
1806
1806
|
showToast('Terminal not connected', 'err');
|
|
1807
1807
|
return false;
|
|
1808
1808
|
}
|
|
1809
|
-
//
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
//
|
|
1813
|
-
|
|
1809
|
+
// Sapper's readline does NOT advertise bracketed-paste mode (no ESC[?2004h),
|
|
1810
|
+
// so wrapping in ESC[200~ … ESC[201~ would leak the literal "^[[200~" into
|
|
1811
|
+
// the prompt. Only use bracket-paste when we truly need multi-line atomicity
|
|
1812
|
+
// (Ask AI feature). For single-line content, send it raw and submit with \\r.
|
|
1813
|
+
var LF = String.fromCharCode(10);
|
|
1814
|
+
var CR = String.fromCharCode(13);
|
|
1815
|
+
if (text.indexOf(LF) < 0 && text.indexOf(CR) < 0) {
|
|
1816
|
+
ws.send(text + CR);
|
|
1817
|
+
return true;
|
|
1818
|
+
}
|
|
1819
|
+
// Multi-line: bracketed paste so readline treats it as one input.
|
|
1820
|
+
ws.send('\\u001b[200~');
|
|
1814
1821
|
ws.send(text);
|
|
1815
|
-
ws.send('\\u001b[201~');
|
|
1816
|
-
ws.send(
|
|
1822
|
+
ws.send('\\u001b[201~');
|
|
1823
|
+
ws.send(CR);
|
|
1817
1824
|
return true;
|
|
1818
1825
|
}
|
|
1819
1826
|
|