-
Notifications
You must be signed in to change notification settings - Fork 5.9k
fix: file/directory opens from terminal #5340
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
Conversation
96613e5
to
64b8a70
Compare
Codecov Report
@@ Coverage Diff @@
## main #5340 +/- ##
=======================================
Coverage 72.47% 72.47%
=======================================
Files 30 30
Lines 1671 1671
Branches 367 367
=======================================
Hits 1211 1211
Misses 397 397
Partials 63 63 Continue to review full report at Codecov.
|
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.
Go team!
To test: | ||
|
||
1. Run code-server | ||
2. Open code-server | ||
3. Open terminal | ||
4. Open another code-server window | ||
5. Run code-server with a file or directory argument | ||
|
||
The file or directory should only open from the instance attached to that | ||
terminal. |
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.
This is really well-written!
- private readonly _onExecuteCommand = this._register(new Emitter<{ reqId: number; commandId: string; commandArgs: any[] }>()); | ||
+ private readonly _onExecuteCommand = this._register(new Emitter<{ reqId: number; terminalId: number; commandId: string; commandArgs: any[] }>()); | ||
readonly onExecuteCommand = this._onExecuteCommand.event; | ||
|
||
constructor( | ||
@@ -240,20 +240,20 @@ export class RemoteTerminalChannel exten | ||
const ipcHandlePath = createRandomIPCHandle(); | ||
env.VSCODE_IPC_HOOK_CLI = ipcHandlePath; | ||
const commandsExecuter: ICommandsExecuter = { | ||
- executeCommand: <T>(id: string, ...args: any[]): Promise<T> => this._executeCommand(id, args, uriTransformer) | ||
+ executeCommand: <T>(commandId: string, ...args: any[]): Promise<T> => this._executeCommand(terminalId, commandId, args, uriTransformer) |
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.
Very happy to see this be a small change!
Fixes #5339
More info can be found in the patch notes.