Skip to content

[Bug]: Incomplete fish support #1550

@pcrockett

Description

@pcrockett

Current Behavior (bug)

Devbox makes a good attempt at supporting fish, but it's not complete enough to work. For example, it generates a fish config in /tmp but then in the config it tries to source a traditional shell script:

# in /tmp/devbox614133565/config.fish

# Source the hooks file, which contains the project's init hooks and plugin hooks.
source /home/user/some/path/.devbox/gen/scripts/.hooks.sh

This is kind of like... a bash script trying to source a python script. You can see where this falls down when you try to use the poetry package. Devbox shows this error in fish after running devbox shell:

Starting a devbox shell...
~/some/path/.devbox/gen/scripts/.hooks.sh (line 1): $(...) is not supported. In fish, please use '(command)'.
poetry env use $(command -v python) --no-interaction
               ^
from sourcing file ~/Code/Terminus/.devbox/gen/scripts/.hooks.sh
	called on line 162 of file /tmp/devbox614133565/config.fish
from sourcing file /tmp/devbox614133565/config.fish
source: Error while reading file “/home/phil/Code/Terminus/.devbox/gen/scripts/.hooks.sh”

This also makes the shell environment incomplete at best, because the fish config is not fully executed to the end.

Expected Behavior (fix)

While fish is only partially supported, I would expect that the hooks are not sourced, with a warning printed to screen saying that init hooks aren't supported for fish yet.

Additional context

Version:     0.6.0
Platform:    linux_amd64
Commit:      fdbd72f230b3520dde60d72c57d9460922ade656
Commit Time: 2023-10-03T18:04:08Z
Go Version:  go1.21.1
Launcher:
{
  "packages": [
    "python@3.8",
    "poetry@latest"
  ],
  "shell": {
    "init_hook": [
      "poetry install"
    ],
    "scripts": {
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions