We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 963f4d0 commit 77d94aeCopy full SHA for 77d94ae
site/src/pages/TerminalPage/TerminalPage.tsx
@@ -152,11 +152,12 @@ const TerminalPage: FC = () => {
152
// typically take this to mean to insert a literal newline. There is no way
153
// to remove this handler, so we must attach it once and rely on a ref to
154
// send it to the current socket.
155
+ const escapedCarriageReturn = "\x1b\r";
156
terminal.attachCustomKeyEventHandler((ev) => {
157
if (ev.shiftKey && ev.key === "Enter") {
158
if (ev.type === "keydown") {
159
websocketRef.current?.send(
- new TextEncoder().encode(JSON.stringify({ data: "\x1b\r" })),
160
+ new TextEncoder().encode(JSON.stringify({ data: escapedCarriageReturn })),
161
);
162
}
163
return false;
0 commit comments