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

Merged
merged 3 commits into from
Jul 29, 2025
Merged

feat: support shift+enter in terminal #19021

merged 3 commits into from
Jul 29, 2025

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?

@code-asher code-asher merged commit 558e25d into main Jul 29, 2025
32 checks passed
@code-asher code-asher deleted the asher/shift+enter branch July 29, 2025 17:27
@github-actions github-actions bot locked and limited conversation to collaborators Jul 29, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy