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

User-defined PATH no longer sourced in remote ssh session after 1.87.1 release #207117

Closed
JtMotoX opened this issue Mar 7, 2024 · 3 comments
Closed
Assignees
Labels
info-needed Issue requires more information from poster

Comments

@JtMotoX
Copy link

JtMotoX commented Mar 7, 2024

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.87.1
  • OS Version (local): Windows 11
  • OS Version (remote ssh): AlmaLinux 8.9

Steps to Reproduce:

Server Steps (Linux):

  1. Make sure git is not installed
  2. Install git in a non-standard path (git installed via nix in my case)
  3. Update your profile file (.zshrc, .bashrc, .bash_profile, etc..) and update your PATH to include the non-standard directory where you installed git.
  4. Clone any git repo

Client Steps (Windows):

  1. Install code 1.87.1
  2. Remote SSH to the linux server
  3. Open the git repo you cloned earlier
  4. VSC will not detect that it is a git repo and complains that git is not installed.

I have not run into this issue until updating to 1.87.1

image

@JtMotoX JtMotoX changed the title Git no longer working in serve-web session after 1.87.1 release User-defined PATH no longer sourced in remote ssh session after 1.87.1 release Mar 8, 2024
@lszomoru
Copy link
Member

Could you please share the contents of the git output window?

@lszomoru lszomoru added the info-needed Issue requires more information from poster label Mar 20, 2024
@JtMotoX
Copy link
Author

JtMotoX commented Mar 21, 2024

image

2024-03-20 17:56:43.766 [info] Log level: Info
2024-03-20 17:56:43.766 [info] Validating found git in: "git"
2024-03-20 17:56:43.766 [warning] Unable to find git. Error: spawn git ENOENT
2024-03-20 17:56:43.766 [warning] Git installation not found.

@JtMotoX
Copy link
Author

JtMotoX commented May 17, 2024

I finally found the issue. My custom systemd service script was executing the code serve-web command in a non-interactive shell (without login). I added the -l flag for a non-interactive login shell.

Before:

COMMAND="${CODE_CLI} serve-web . . ."
${COMMAND}

After:

COMMAND="${CODE_CLI} serve-web . . ."
${SHELL} -l -c "${COMMAND}"

Now that the process is "logging in" and loading my zsh profile, my ~/nix-profile/bin directory is now included in my PATH and all my user-defined environment variables are loaded.

@JtMotoX JtMotoX closed this as completed May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

3 participants