-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Support integrated terminal #6508
Merged
+15
−11
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@akosyakov This part is causing us issues, but it is also a bad thing to do to send un-escaped commands to a shell like this. IIUC, the idea is that we want to reuse a shell widget to display the output. But in this case it seems like we try to reuse actual shell processes, instead of reusing widgets.
Since this is broken for us, I will start trying to look at what is required to reuse shell widgets, do you have any opinions and/or pointers for me?
cc @marcdumais-work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe better to open an issue, will do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here is VS Code implementation:https://github.com/microsoft/vscode/blob/43e3581aa635406ada2d8138d7ee242ddabefc1c/src/vs/workbench/contrib/debug/node/terminals.ts#L79
We can reuse it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like this, but it may indeed be the easiest solution here. Why would we convert a nice array of arguments into one big escaped string though? We can spawn processes directly from a command + arguments. Do debug adapters expect that their clients will provide variable-expansion or other shell-specific behaviors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After looking more into it, we do want to use shells. Things like running
node
without specifying a full path wouldn't work otherwise. Not sure we want to try to always reuse the same shell process though. In VS Code they check before reusing a shell that it doesn't have child processes running, this seems sketchy. I would rather make sure the shell dies when the command is executed, and reuse the widget if process is dead. WDYT?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't get it. Here is a solution, which we can copy and fix the issue, and then focus on something else instead of spending time reinventing our solution. Plus it makes it easier to catch up later if there are some bug fixes.
Sorry, I don't know how it is related to escaping. We start a new terminal each time for now. Please file a new issue if there is a mismatch from user perspective with steps how to reproduce in Theia and VS Code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Terminals are reused when handling
runInTerminal
requests:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But apparently VS Code has the same issue when running the same command, user can pollute the shell that the extension tries to send commands to... Ok.