Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Name the escaped carriage return
  • Loading branch information
code-asher committed Jul 24, 2025
commit 77d94ae103802d024dc4f6992888709ec93c3d95
3 changes: 2 additions & 1 deletion site/src/pages/TerminalPage/TerminalPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,12 @@ const TerminalPage: FC = () => {
// typically take this to mean to insert a literal newline. There is no way
// to remove this handler, so we must attach it once and rely on a ref to
// send it to the current socket.
const escapedCarriageReturn = "\x1b\r";
terminal.attachCustomKeyEventHandler((ev) => {
if (ev.shiftKey && ev.key === "Enter") {
if (ev.type === "keydown") {
websocketRef.current?.send(
new TextEncoder().encode(JSON.stringify({ data: "\x1b\r" })),
new TextEncoder().encode(JSON.stringify({ data: escapedCarriageReturn })),
);
}
return false;
Expand Down
Loading