mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-07 16:09:43 +02:00
fix(mobile): use raw fallback for composed prompts
This commit is contained in:
@@ -1193,7 +1193,7 @@ const KeyboardAccessoryBar = {
|
|||||||
// Match xterm's prepareTextForTerminal(): CR keeps embedded newlines inside
|
// Match xterm's prepareTextForTerminal(): CR keeps embedded newlines inside
|
||||||
// the single-line input transport and is what terminal.paste() emitted.
|
// the single-line input transport and is what terminal.paste() emitted.
|
||||||
const pasteText = text.replace(/\r?\n/g, '\r');
|
const pasteText = text.replace(/\r?\n/g, '\r');
|
||||||
app._sendInputAsync(sessionId, `\x1b[200~${pasteText}\x1b[201~`, { useMux: true });
|
app._sendInputAsync(sessionId, `\x1b[200~${pasteText}\x1b[201~`);
|
||||||
setTimeout(() => app._sendInputAsync(sessionId, '\r', { useMux: true }), 120);
|
setTimeout(() => app._sendInputAsync(sessionId, '\r', { useMux: true }), 120);
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -217,9 +217,7 @@ describe('mobile prompt composer', () => {
|
|||||||
|
|
||||||
expect(app.terminal.paste).not.toHaveBeenCalled();
|
expect(app.terminal.paste).not.toHaveBeenCalled();
|
||||||
expect(app._sendInputAsync).toHaveBeenCalledOnce();
|
expect(app._sendInputAsync).toHaveBeenCalledOnce();
|
||||||
expect(app._sendInputAsync).toHaveBeenNthCalledWith(1, 'session-1', '\x1b[200~first line\rsecond line\x1b[201~', {
|
expect(app._sendInputAsync).toHaveBeenNthCalledWith(1, 'session-1', '\x1b[200~first line\rsecond line\x1b[201~');
|
||||||
useMux: true,
|
|
||||||
});
|
|
||||||
expect(composeButton.classList.contains('has-draft')).toBe(false);
|
expect(composeButton.classList.contains('has-draft')).toBe(false);
|
||||||
expect(timers).toContainEqual(expect.objectContaining({ delay: 120 }));
|
expect(timers).toContainEqual(expect.objectContaining({ delay: 120 }));
|
||||||
runTimers();
|
runTimers();
|
||||||
@@ -240,9 +238,7 @@ describe('mobile prompt composer', () => {
|
|||||||
(document.querySelector('.paste-send') as HTMLButtonElement).click();
|
(document.querySelector('.paste-send') as HTMLButtonElement).click();
|
||||||
|
|
||||||
expect(app.terminal.paste).not.toHaveBeenCalled();
|
expect(app.terminal.paste).not.toHaveBeenCalled();
|
||||||
expect(app._sendInputAsync).toHaveBeenCalledWith('session-1', '\x1b[200~still\rmultiline\x1b[201~', {
|
expect(app._sendInputAsync).toHaveBeenCalledWith('session-1', '\x1b[200~still\rmultiline\x1b[201~');
|
||||||
useMux: true,
|
|
||||||
});
|
|
||||||
expect(document.querySelector('.prompt-composer-overlay')).toBeNull();
|
expect(document.querySelector('.prompt-composer-overlay')).toBeNull();
|
||||||
expect(app.showToast).not.toHaveBeenCalled();
|
expect(app.showToast).not.toHaveBeenCalled();
|
||||||
runTimers();
|
runTimers();
|
||||||
|
|||||||
Reference in New Issue
Block a user