Skip to content

Autocomplete paths properly #5683

@charleschege

Description

@charleschege

Related problem

The new releases of nu with engine-q doesn't handle directory commands as conveniently as previous version like 0.41.

For example, using version 0.41.0 to handle a directory called FooBar , on Ubuntu 20.04

  1. Using autocomplete adds a ./ prefix when you press tab to autocomplete Foo into full directory name FooBar but when using version 0.60+ only the FooBar full name is autocompleted with no ./ added prefix thereby on pressing enter an error occurs since nushell thinks it's executing a binary
Error: nu::shell::external_command (link)

  × External command
   ╭─[entry #2:1:1]
 1 │ FooBar/
   · ────────┬────────
   ·         ╰── can't run executable
   ╰────
  help: Permission denied (os error 13)
  1. Version before engine-q like 0.41.0 are able to understand what constitutes a directory so just typing FooBar or FooBar/ nushell will switch to the directory but on version 0.60+ this will return an error since it thinks binary execution is happening
Error: nu::shell::external_command (link)

  × External command
   ╭─[entry #3:1:1]
 1 │ FooBar
   · ────────┬───────
   ·         ╰── can't run executable
   ╰────
  help: No such file or directory (os error 2)

Describe the solution you'd like

With new versions of nushell, reintroduce this convenience like:

  1. Add a ./ prefix on autocompleting a directory
  2. Nushell should be able to detect a directory and switch to it on pressing enter even if the directory name does not have a ./ prefix or / suffix on the directory name

Describe alternatives you've considered

No response

Additional context and details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    A:completionsIssues related to tab completionpolishthis problem makes nu feel unpolished

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions