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

runme open fails to install code-server when executing in fish shell #647

Open
nikita-vanyasin opened this issue Aug 6, 2024 · 6 comments
Assignees

Comments

@nikita-vanyasin
Copy link

I have a macos+fish environment.
Next command fails (executed in fish shell):

> runme open

No code-server installation found. Do you want to install coder's code-server?

fish: command substitutions not allowed here
__cleanup() {
         ^^
could not execute command: installation command failed: failed to run command: exit code: 127

Next command works fine (also executed in fish shell):

> SHELL=zsh runme open
@adambabik
Copy link
Collaborator

This error indicates that the problem is likely related to the code used to collect environment variables in the session. It's not well-tested across various shells.

Does it happen only for runme open or for runme run <cmd> as well?

@nikita-vanyasin
Copy link
Author

Does it happen only for runme open or for runme run <cmd> as well?

Yes, it is the same error for runme run FILE_LIST for example repo:

> git clone --depth=1 https://github.com/stateful/docs.runme.dev.git
> runme run FILE_LIST
fish: command substitutions not allowed here
__cleanup() {
         ^^
could not execute command: failed to run command "FILE_LIST": exit code: 127

@adambabik adambabik self-assigned this Aug 8, 2024
@adambabik
Copy link
Collaborator

Thanks for checking! I think bash, zsh and fish in fairly new versions should work well. We can run tests in a Docker container so we should be able to cover all shells easily. @sourishkrout wdyt?

@sourishkrout
Copy link
Member

sourishkrout commented Aug 8, 2024

Thanks for checking! I think bash, zsh and fish in fairly new versions should work well. We can run tests in a Docker container so we should be able to cover all shells easily. @sourishkrout wdyt?

Sure thing. zsh works for sure. fish used to not but with the latest upgrades might. We are working on a warning notification inside the extension to flag unsupported PowerShell etc right now. Would be great if we could move fish to supported but not a high priority.

@rawkode
Copy link

rawkode commented Aug 30, 2024

I've ran into this problem too. I tried setting the interpretor, but I assume this is ignored when running interactively in a shell.

It would be good if this was respected.

\```shell {"id":"01J6HHJDW3A84XPHVHSWC3DC6W","interpreter":"/usr/bin/env bash","name":"deploy"}
sudo nixos-rebuild switch --fast --flake .#(hostname)
\```

@sourishkrout
Copy link
Member

sourishkrout commented Sep 3, 2024

Thanks for the feedback, @rawkode! The way you'd enforce bash is by using frontmatter in the document as per https://docs.runme.dev/Reference/configuration#document-options

So what you'd want to do is use that instead of interpreter, e.g.:

---
shell: bash
---

# Documentation
This is my doc

It's also possible to do this per cell but I'd recommend setting it per document instead.

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

No branches or pull requests

4 participants