Skip to content
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

Fixing webshell multiline paste issue #313

Merged
merged 1 commit into from
Jun 30, 2024
Merged

Conversation

notthetup
Copy link
Collaborator

So it seems the multiline paste issue (#311) was caused by how we multiplexed the WebSocket connections.

Since the WebShell is multiplexed over all the WebSocket connections, we can't have the terminal (xterm.js) reset the shell when it connects to the shell. This could cause someone in another instance of the terminal to lose state.

But that does mean that sometimes (likely a jline bug), jline doesn't send a newly connected terminal the fact that xterm's bracketed paste mode is enabled. This usually happens when the shell is reset (like when a newline or clear commands are given). When this happens xterm.js thinks that bracketed paste mode is disabled and trying to send the entire string as is without the bracketed paste mode delimiters.

To fix this, we manually send the code for enabling bracketed paste mode when a new WebSocket connects. Since enabling the mode is idempotent this doesn't affect the other terminals.

@notthetup notthetup requested a review from mchitre June 29, 2024 08:57
@notthetup notthetup self-assigned this Jun 29, 2024
@notthetup notthetup changed the title Fixing webshell multiline paste issue. Fixing webshell multiline paste issue Jun 29, 2024
@notthetup notthetup merged commit c9caa15 into master Jun 30, 2024
2 checks passed
@notthetup notthetup deleted the webshell-bracketed-mode branch June 30, 2024 22:18
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.

2 participants