Skip to content

make the "External command failed" error more descriptive #8313

@amtoine

Description

@amtoine

Related problem

i often use the fzf fuzzy finder in nushell pipelines but i have a problem when not piping its output to str trim

according to @fdncred, the behaviour in https://asciinema.org/a/564496 is expected 👌

Note
code:

>_ let var = ("yes\nno" | to text | fzf | str trim); $var
yes
>_ let var = ("yes\no" | to text | fzf); $var
Error: nu::shell::external_command

  × External command failed
   ╭─[entry #4:1:1]
 1 │ let var = ("yes\no" | to text | fzf); $var
   ·                                 ─┬─
   ·                                  ╰── External command failed
   ╰────
  help:

however, i find the error in itself not very descriptive 🤔
because, in the end, fzf does not fail at all here! 😮

Describe the solution you'd like

i'm not sure what the issue with fzf without str trim here is, so i do not know what the message should be 🤔

however, i'm pretty sure the fzf external command did NOT fail, so the error message should probably NOT be "External command failed" 😋

Describe alternatives you've considered

No response

Additional context and details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    A:error-unhelpfulThe error message you observe is not helpful to identify the problemA:external-commandsIssues related to external commandscategory:enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions