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

use remote cli when in remote terminal #150372

Merged
merged 1 commit into from
May 25, 2022
Merged

use remote cli when in remote terminal #150372

merged 1 commit into from
May 25, 2022

Conversation

aeschli
Copy link
Contributor

@aeschli aeschli commented May 25, 2022

Fixes microsoft/vscode-remote-release#6625

Replaces #150131

This fix is for Linux/Mac only. On Linux, the shell login script adds /usr/local/bin to the front of the path. The Mac reorders the PATH segments, see #99878. On remote systems that also have desktop code installed, this causes the desktop code shell script to be found before the remote cli code script.

The fix is to have the Desktop code / code-insiders shell script detect if it is invoked in a remote terminal and forward he call the remote cli command

  • To detect if we are in a remote terminal we use the VSCODE_IPC_HOOK_CLI env variable.
  • To find the remote cli, we look in the PATH if a second code command is found under a path remote-cli

On Windows, the remote code command is always first.

@aeschli aeschli self-assigned this May 25, 2022
@aeschli aeschli requested a review from alexdima May 25, 2022 13:25
@aeschli aeschli added this to the May 2022 milestone May 25, 2022
@aeschli
Copy link
Contributor Author

aeschli commented May 25, 2022

I also update the code command for linux to use @@APPNAME@@ instead of @@NAME@@. That makes clear what name really stands for product.applicationName. That is also consistent with the naming in the scripts for the other platforms

@aeschli aeschli merged commit 07655f3 into main May 25, 2022
@aeschli aeschli deleted the aeschli/useRemoteCli2 branch May 25, 2022 14:21
@github-actions github-actions bot locked and limited conversation to collaborators Jul 9, 2022
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.

[cli] desktop code is opened when running 'code' in remote terminal
2 participants