Skip to content

Commit 77d94ae

Browse files
committed
Name the escaped carriage return
1 parent 963f4d0 commit 77d94ae

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

site/src/pages/TerminalPage/TerminalPage.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,12 @@ const TerminalPage: FC = () => {
152152
// typically take this to mean to insert a literal newline. There is no way
153153
// to remove this handler, so we must attach it once and rely on a ref to
154154
// send it to the current socket.
155+
const escapedCarriageReturn = "\x1b\r";
155156
terminal.attachCustomKeyEventHandler((ev) => {
156157
if (ev.shiftKey && ev.key === "Enter") {
157158
if (ev.type === "keydown") {
158159
websocketRef.current?.send(
159-
new TextEncoder().encode(JSON.stringify({ data: "\x1b\r" })),
160+
new TextEncoder().encode(JSON.stringify({ data: escapedCarriageReturn })),
160161
);
161162
}
162163
return false;

0 commit comments

Comments
 (0)