nushell/crates
Devyn Cairns 0e1553026e
Restore tilde expansion on external command names (#13001)
# Description

Fix a regression introduced by #12921, where tilde expansion was no
longer done on the external command name, breaking things like

```nushell
> ~/.cargo/bin/exa
```

This properly handles quoted strings, so they don't expand:

```nushell
> ^"~/.cargo/bin/exa"
Error: nu:🐚:external_command

  × External command failed
   ╭─[entry #1:1:2]
 1 │ ^"~/.cargo/bin/exa"
   ·  ─────────┬────────
   ·           ╰── Command `~/.cargo/bin/exa` not found
   ╰────
  help: `~/.cargo/bin/exa` is neither a Nushell built-in or a known external command

```

This required a change to the parser, so the command name is also parsed
in the same way the arguments are - i.e. the quotes on the outside
remain in the expression. Hopefully that doesn't break anything else. 🤞

Fixes #13000. Should include in patch release 0.94.1

cc @YizhePKU

# User-Facing Changes
- Tilde expansion now works again for external commands
- The `command` of `run-external` will now have its quotes removed like
the other arguments if it is a literal string
- The parser is changed to include quotes in the command expression of
`ExternalCall` if they were present

# Tests + Formatting
I would like to add a regression test for this, but it's complicated
because we need a well-known binary within the home directory, which
just isn't a thing. We could drop one there, but that's kind of a bad
behavior for a test to do. I also considered changing the home directory
for the test, but that's so platform-specific - potentially could get it
working on specific platforms though. Changing `HOME` env on Linux
definitely works as far as tilde expansion works.

- 🟢 `toolkit fmt`
- 🟢 `toolkit clippy`
- 🟢 `toolkit test`
- 🟢 `toolkit test stdlib`
2024-05-29 18:48:29 -07:00
..
nu_plugin_custom_values Bump version to 0.94.1 (#12988) 2024-05-28 22:41:23 +00:00
nu_plugin_example Bump version to 0.94.1 (#12988) 2024-05-28 22:41:23 +00:00
nu_plugin_formats Bump version to 0.94.1 (#12988) 2024-05-28 22:41:23 +00:00
nu_plugin_gstat Bump version to 0.94.1 (#12988) 2024-05-28 22:41:23 +00:00
nu_plugin_inc Bump version to 0.94.1 (#12988) 2024-05-28 22:41:23 +00:00
nu_plugin_nu_example Bump version to 0.94.1 (#12988) 2024-05-28 22:41:23 +00:00
nu_plugin_polars Bump version to 0.94.1 (#12988) 2024-05-28 22:41:23 +00:00
nu_plugin_python Bump version to 0.94.1 (#12988) 2024-05-28 22:41:23 +00:00
nu_plugin_query Bump version to 0.94.1 (#12988) 2024-05-28 22:41:23 +00:00
nu_plugin_stress_internals Bump version to 0.94.1 (#12988) 2024-05-28 22:41:23 +00:00
nu-cli fixes a bug in OSC9;9 execution (#12994) 2024-05-29 18:06:47 -05:00
nu-cmd-base Bump version to 0.94.1 (#12988) 2024-05-28 22:41:23 +00:00
nu-cmd-extra Bump version to 0.94.1 (#12988) 2024-05-28 22:41:23 +00:00
nu-cmd-lang Bump version to 0.94.1 (#12988) 2024-05-28 22:41:23 +00:00
nu-cmd-plugin Bump version to 0.94.1 (#12988) 2024-05-28 22:41:23 +00:00
nu-color-config Bump version to 0.94.1 (#12988) 2024-05-28 22:41:23 +00:00
nu-command Restore tilde expansion on external command names (#13001) 2024-05-29 18:48:29 -07:00
nu-engine Bump version to 0.94.1 (#12988) 2024-05-28 22:41:23 +00:00
nu-explore Bump version to 0.94.1 (#12988) 2024-05-28 22:41:23 +00:00
nu-glob Bump version to 0.94.1 (#12988) 2024-05-28 22:41:23 +00:00
nu-json Bump version to 0.94.1 (#12988) 2024-05-28 22:41:23 +00:00
nu-lsp Bump version to 0.94.1 (#12988) 2024-05-28 22:41:23 +00:00
nu-parser Restore tilde expansion on external command names (#13001) 2024-05-29 18:48:29 -07:00
nu-path Bump version to 0.94.1 (#12988) 2024-05-28 22:41:23 +00:00
nu-plugin Bump version to 0.94.1 (#12988) 2024-05-28 22:41:23 +00:00
nu-plugin-core Bump version to 0.94.1 (#12988) 2024-05-28 22:41:23 +00:00
nu-plugin-engine Bump version to 0.94.1 (#12988) 2024-05-28 22:41:23 +00:00
nu-plugin-protocol Bump version to 0.94.1 (#12988) 2024-05-28 22:41:23 +00:00
nu-plugin-test-support Bump version to 0.94.1 (#12988) 2024-05-28 22:41:23 +00:00
nu-pretty-hex Bump version to 0.94.1 (#12988) 2024-05-28 22:41:23 +00:00
nu-protocol Bump version to 0.94.1 (#12988) 2024-05-28 22:41:23 +00:00
nu-std Bump version to 0.94.1 (#12988) 2024-05-28 22:41:23 +00:00
nu-system Bump version to 0.94.1 (#12988) 2024-05-28 22:41:23 +00:00
nu-table Bump version to 0.94.1 (#12988) 2024-05-28 22:41:23 +00:00
nu-term-grid Bump version to 0.94.1 (#12988) 2024-05-28 22:41:23 +00:00
nu-test-support Bump version to 0.94.1 (#12988) 2024-05-28 22:41:23 +00:00
nu-utils Bump version to 0.94.1 (#12988) 2024-05-28 22:41:23 +00:00
nuon Bump version to 0.94.1 (#12988) 2024-05-28 22:41:23 +00:00
README.md Remove old nushell/merge engine-q 2022-02-07 14:54:06 -05:00

Nushell core libraries and plugins

These sub-crates form both the foundation for Nu and a set of plugins which extend Nu with additional functionality.

Foundational libraries are split into two kinds of crates:

  • Core crates - those crates that work together to build the Nushell language engine
  • Support crates - a set of crates that support the engine with additional features like JSON support, ANSI support, and more.

Plugins are likewise also split into two types:

  • Core plugins - plugins that provide part of the default experience of Nu, including access to the system properties, processes, and web-connectivity features.
  • Extra plugins - these plugins run a wide range of different capabilities like working with different file types, charting, viewing binary data, and more.