Skip to content

feat: support shift+enter in terminal #19021

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

code-asher
Copy link
Member

@code-asher code-asher commented Jul 23, 2025

It acts the same alt+enter, but is more familiar to users.

Closes #18864

@code-asher code-asher changed the title feat: shift+enter in terminal for inserting newlines feat: support shift+enter in terminal Jul 23, 2025
@code-asher code-asher force-pushed the asher/shift+enter branch 2 times, most recently from 5fd3af9 to 1ad508f Compare July 24, 2025 00:20
It acts the same alt+enter, but is more familiar to users.
Copy link
Collaborator

@BrunoQuaresma BrunoQuaresma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good. Just a few comments.

@@ -270,6 +287,7 @@ const TerminalPage: FC = () => {
.withBackoff(new ExponentialBackoff(1000, 6))
.build();
websocket.binaryType = "arraybuffer";
websocketRef.current = websocket;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need to do this? It looks strange to me.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

attachCustomKeyEventHandler has no disposer, so we can only add it once, which means I have to do it when we create the terminal (if I did it here we would create additional handlers on every reconnect). But that means I need a stable reference to the websocket.

Is there another way of doing this maybe?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for Shift+Enter in web terminal
2 participants