Skip to content

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

Merged
merged 2 commits into from
Jul 15, 2022

Conversation

code-asher
Copy link
Member

@code-asher code-asher commented Jul 14, 2022

Fixes #5339

More info can be found in the patch notes.

@codecov
Copy link

codecov bot commented Jul 14, 2022

Codecov Report

Merging #5340 (6684417) into main (e189435) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e189435...6684417. Read the comment docs.

@code-asher code-asher marked this pull request as ready for review July 15, 2022 15:03
@code-asher code-asher requested a review from a team July 15, 2022 15:03
Copy link
Contributor

@jsjoeio jsjoeio left a comment

Choose a reason for hiding this comment

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

Go team!

Comment on lines +5 to +14
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.
Copy link
Contributor

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!

Comment on lines +24 to +34
- 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)
Copy link
Contributor

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!

@code-asher code-asher enabled auto-merge (squash) July 15, 2022 16:25
@code-asher code-asher merged commit 97af08b into coder:main Jul 15, 2022
@code-asher code-asher deleted the cli-window-open branch July 15, 2022 17:24
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.

[Bug]: multiple code-server windows opened with code-server
2 participants