Skip to content

PATH is parsed incorrectly when using fish with vi keybindings #236

@arrangabriel

Description

@arrangabriel

Version 0.1.0-0ff78f1 of expert fails to start, with this error log:

Couldn't find an elixir executable for project at <project root>. Using shell at /opt/homebrew/bin/fish with PATH=\27[2 q

The PATH only contains an escape sequence, so obviosuly no elixir executable is found, even though I have it installed and in my PATH.

Looking at the code, this line is to blame. As the output looks like:

iex> System.cmd("/opt/homebrew/bin/fish", ["-i", "-l", "-c", "echo $PATH"])
{"\e[6 q/<space separated path entries>\n\e[2 q", 0}

Removing the -i flag results in the more reasonable:

iex> System.cmd("/opt/homebrew/bin/fish", ["-i", "-l", "-c", "echo $PATH"])
{"<space separated path entries>\n", 0}

The escape characters are inserted by the following lines in my fish config

if status is-interactive
    fish_vi_key_bindings
end

I'm not sure if just removing the flag is the best solution, or if something more robust is required.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions