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

[cli] desktop code is opened when running 'code' in remote terminal #6625

Closed
callwyat opened this issue Apr 18, 2022 · 12 comments · Fixed by microsoft/vscode#150372
Closed
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug on-testplan ssh Issue in vscode-remote SSH verified Verification succeeded
Milestone

Comments

@callwyat
Copy link

  • VSCode Version: 1.66.0
  • Local OS Version: macOS 11.6.4
  • Remote OS Version: macOS 12.2.1
  • Remote Extension/Connection Type: SSH
  • Logs:

Steps to Reproduce:

  1. Install VSCode normally on the remote machine
  2. Set "code --wait" as the default editor for git on remote machine
    a. git config --global core.editor "code --wait"
  3. Connect to the remote machine via "Remote - SSH" into a folder with git SCM
  4. Use a git command that will invoke the default editor
    a. git rebase -i
    b. git config --global -e
  5. Notice that VSCode opened on the remote machine and not the local machine and be sad

If VSCode has not been installed on the remote machine, then the "code --wait" works as expected.

Does this issue occur when you try this locally?: No
Does this issue occur when you try this locally and all extensions are disabled?: No

@github-actions github-actions bot added the ssh Issue in vscode-remote SSH label Apr 18, 2022
@bamurtaugh
Copy link
Member

Notice that VSCode opened on the remote machine and not the local machine and be sad

Did you run the commands from 4 on the local or remote machine? I'd anticipate that if running on your remote machine, it would make sense to open VS Code on your remote (i.e. as when running other commands, they run against the remote, whether it's checking the version of a toolset or running code).

@bamurtaugh bamurtaugh added the info-needed Issue requires more information from poster label Apr 18, 2022
@callwyat
Copy link
Author

Step 4 should be executed from the VSCode terminal on the local machine, which is connected to the remote machine by “Remote - SSH”

On my other remote machine (Ubuntu Server 20.04), where I have not installed VSCode but instead connect with “Remote - SSH” exclusively, the editor opens in the local VSCode as expected.

@bamurtaugh
Copy link
Member

bamurtaugh commented Apr 19, 2022

cc @tanhakabir the original behavior sounds reasonable to me, but perhaps there are other considerations here that you could think of.

@github-actions
Copy link

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

@tanhakabir tanhakabir reopened this Apr 27, 2022
@tanhakabir
Copy link

I agree with @callwyat that the behavior he expects is what should be happening. I'm wondering if @aeschli knows what else needs to be done to ensure that the PATHs work for this scenario too?

@github-actions
Copy link

github-actions bot commented May 5, 2022

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

@github-actions github-actions bot closed this as completed May 5, 2022
@callwyat
Copy link
Author

callwyat commented May 5, 2022

What information is needed? I thought I answered so the questions? Was the “need more info tag just not removed?

@bamurtaugh bamurtaugh removed the info-needed Issue requires more information from poster label May 6, 2022
@bamurtaugh
Copy link
Member

Reopening as it looks like the info was provided - cc @tanhakabir

@bamurtaugh bamurtaugh reopened this May 6, 2022
@tanhakabir
Copy link

pinging @aeschli again for ideas

@tanhakabir tanhakabir added the bug Issue identified by VS Code Team member as probable bug label May 9, 2022
@aeschli aeschli self-assigned this May 9, 2022
@aeschli
Copy link
Contributor

aeschli commented May 11, 2022

I'll look at this for the May release.

The problem us that the login shell adds the path of the desktop vscode to the PATH environment variable first. So the remote one is shadowed by the desktop one.

The idea is to improve the desktop cli to detect that we are in a remote terminal.

@callwyat
Copy link
Author

Thanks everyone for fixing this for me!

@joyceerhl joyceerhl added the verified Verification succeeded label Jun 3, 2022
@joyceerhl
Copy link

Marking verified since this was also on-testplan.

@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
bug Issue identified by VS Code Team member as probable bug on-testplan ssh Issue in vscode-remote SSH verified Verification succeeded
Projects
None yet
5 participants