Repository navigation
Closed
Description
Describe the bug
I am attempting to rewrite my (git-)bash alias into the startup config. The alias in bash was alias notes='code ~/Google\ Drive/Notes'. I have encountered a myriad of different failure cases, and haven't been able to get it working.
To Reproduce
Steps to reproduce the behavior:
"alias notes = code \"~/Google Drive/notes\"",doesn't escape the space and doesn't open the correct folder
"alias notes = code '~/Google Drive/notes'",doesn't escape the space
'alias notes = code "~/Google Drive/notes"',doesn't escape the space
'alias notes = code "~/Google Drive/notes/boop.txt"',doesn't escape the space (and screenshot below for what actually opens)
note:~isC:\Users\Jacob

Expected behavior
The expectation is that it opens vscode (code) at the specified folder (which happens to have a space).
Screenshots
See reproduction.
Configuration (please complete the following information):
Note, the below seems a tad misleading, as it was installed via scoop.
────┬────────────────────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────
# │ Column0 │ Column1
────┼────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────
0 │ version │ 0.30.0
1 │ short_commit │ 02d57299
2 │ commit_hash │ 02d5729941c9e5ad013889e1b9c452cc40a8e4df
3 │ commit_date │ 2021-04-21 02:31:54
4 │ build_os │ windows-x86_64
5 │ rust_version │ rustc 1.51.0 (2fd73fabe 2021-03-23)
6 │ rust_channel │ stable-x86_64-pc-windows-msvc (default)
7 │ cargo_version │ cargo 1.51.0 (43b129a20 2021-03-16)
8 │ pkg_version │ 0.30.0
9 │ build_time │ 2021-04-21 05:40:50
10 │ build_rust_channel │ release
11 │ features │ clipboard-cli, ctrlc, default, directories, dirs, ichwh, ptree, rustyline, term, trash, uuid, which, zip
────┴────────────────────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────
Reacted by Amin Ya, abatur-ms and Connor McCormick
Metadata
Metadata
Assignees
Labels
No labels


Activity
fdncred commentedon Apr 27, 2021
What happens when you don't use the tilde and you full path it? I've seen
~not work right on all platforms.jbolda commentedon Apr 27, 2021
It appears to be the exact same behavior. Note that
code ~does work and opens the expected folder. Both directly in the shell and as an alias.fdncred commentedon Apr 29, 2021
@jbolda I put this in my
config.tomlstartup = [section and it worked. It's not exactly what you're doing but similar.Can you try something similar to see if you have success? For me, the key was calling
code.cmdinstead of justcodefdncred commentedon Apr 29, 2021
I also added #3367 which seems to make
codeandcode.cmdwork now but i can't tell you why. loljbolda commentedon May 7, 2021
Thanks!
It looks like even
"alias notes = code 'C:\\Users\\Jacob\\Google Drive\\notes'",works for me. So I don't know that the.cmdis specifically required? It seems like the typical path issues that arise on windows. It doesn't seem that~works at all though here.github-actions commentedon Jun 24, 2021
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
aminya commentedon Sep 17, 2021
Is it possible to spawn paths that have spaces in them?
Currently, I can only shell out to cmd:
fdncred commentedon Sep 17, 2021
@aminya how are you using this? within a nu script or from the prompt? I was able to do this from the prompt and get the help dialog to appear.
aminya commentedon Sep 17, 2021
Yeah, my question is for not using cmd. Spawning directly from nu.
fdncred commentedon Sep 17, 2021
@aminya how about something like this
^'C:/Program Files/TortoiseGit/bin/TortoiseGitProc.exe' '--help'this also works for me with the slashes in the other direction^'C:\Program Files\TortoiseGit\bin\TortoiseGitProc.exe' '--help'aminya commentedon Sep 17, 2021
Oh, nice. I didn't know that
^is able to spawn commands! This should be documented on the first page of Nushell. This is essential for Windows users. 😄fdncred commentedon Sep 17, 2021
^tells nushell that the next thing is an external command. - hidden away here https://www.nushell.sh/book/escaping.html#escaping-to-the-systempwnorbitals commentedon Mar 20, 2022
@jbolda It looks like your issue has been resolved, can this issue be closed ?
hustcer commentedon May 10, 2022
Please try nu after v0.62, and feel free to reopen if you still have such issues