loft-sh / devpod

Codespaces but open-source, client-only and unopinionated: Works with any IDE and lets you use any cloud, kubernetes or just localhost docker.
https://devpod.sh
Mozilla Public License 2.0
8.44k stars 311 forks source link

agent not injected with fish shell #980

Closed Crocmagnon closed 3 months ago

Crocmagnon commented 3 months ago

What happened?
I created an SSH provider, using a remote machine which uses fish shell. The agent isn't properly injected.

What did you expect to happen instead?
The agent is properly injected, starts and the workspace opens in the selected IDE.

How can we reproduce the bug? (as minimally and precisely as possible)

  1. Create an SSH provider using a remote machine on which the default login shell for the SSH user is fish
  2. Create a workspace using this provider. I used https://github.com/microsoft/vscode-remote-try-go for the repo
  3. Start the workspace

Debug logs:

[11:07:54] info Workspace vscode-remote-try-go already exists
[11:07:54] debug Acquire workspace lock...
[11:07:54] debug Acquired workspace lock...
[11:07:54] info Creating devcontainer...
[11:07:54] debug Inject and run command: '/tmp/devpod/agent' helper ssh-server --stdio --debug
[11:07:54] debug Attempting to create SSH client
[11:07:54] debug execute inject script
[11:07:54] debug download agent from https://github.com/loft-sh/devpod/releases/download/v0.5.4
[11:07:54] debug Run command provider command: ${SSH_PROVIDER} command
[11:07:55] debug done exec
[11:07:55] debug done inject
[11:07:55] debug done injecting
[11:07:55] debug Inject Error: fish: Unsupported use of '='. In fish, please use 'set INSTALL_DIR "/tmp/devpod"'.
INSTALL_DIR="/tmp/devpod"
^~~~~~~~~~~~~~~~~~~~~~~~^

EOF

It tries to inject in a loop, until:

[11:11:18] error Try enabling Debug mode under Settings to see a more verbose output
[11:11:18] fatal error retrieving container status: fish: Unknown command: /tmp/devpod/agent
fish: 
'/tmp/devpod/agent' agent workspace status --workspace-info 'xxx'
^~~~~~~~~~~~~~~~~~^
exit status 127

Local Environment:

DevPod Provider:

Anything else we need to know?
A possible fix may be to send the install script as a script file using a proper bash shebang line at the beginning, so that the script is always executed how you intend it to. Use the remote devpod path to inject this script and run it?

Possible workaround before the fix: use bash as login shell.

Crocmagnon commented 3 months ago

Duplicate of #966