### Describe the bug This is a blocker for nix users. `#` is used to indicate comments in nushell but some commands use it. For example with nix-commands you might want to: ```shell nix run nixpkgs#cowsay "I'm a cow!" ``` Or: ```shell nix profile install nixpkgs#cowsay ``` But nushell renders this useless as everything after `#` is a comment. ### How to reproduce 1. Be using nushell 2. Have nix installed 3. Have nix-commands enabled 4. `nix run nixpkgs#<somePackage>` ### Expected behavior I expected nu to interpret `#` as part of the command if there is not whitespace in front. ### Screenshots  ### Configuration | key | value | | ------------------ | ----------------------------------------------- | | version | 0.65.0 | | branch | | | commit_hash | | | build_os | linux-x86_64 | | build_target | x86_64-unknown-linux-gnu | | rust_version | rustc 1.62.1 | | cargo_version | cargo 1.62.0 | | pkg_version | 0.65.0 | | build_time | 1980-01-01 00:00:00 +00:00 | | build_rust_channel | release | | features | database, dataframe, default, trash, which, zip | | installed_plugins | | ### Additional context _No response_
Activity
jmoore34 commentedon Aug 15, 2022
Does
nix run 'nixpkgs#cowsay' "I'm a cow"ornix profile install 'nixpkgs#cowsay'work?kubouch commentedon Aug 15, 2022
You should be able to call external commands with
#like this:but this shouldn't be necessary. What @jmoore34 suggested should work.
As a side note, you can create a custom command with
#but this shouldn't be possible, we need to fix the parser to not allow it when checking the command name.
Lord-Valen commentedon Aug 15, 2022
Ah yes, it does. Thanks! But there's still a question of whether the default behaviour should change anyway.
tighter restrictions on `alias` and `def` names (#7392)
fix: fix lexing of comments, such that a#b becomes a coherent Item (#…
sholderbach commentedon Feb 22, 2023
Resolved by #8151