-
-
Notifications
You must be signed in to change notification settings - Fork 772
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix nu quitcd: switched quotes #1737
Conversation
Are you sure this will work on path which contain To test quickly, do |
It doesn't work and I haven't found a fix yet. |
If you can't figure out a way to fix it then leave a FIXME comment explaining the edge case. |
This is pretty hacky, so leaving the FIXME might be preferable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small reword.
For a directory called foo'bar the NNN_TMPFILE will contain cd 'foo'\''bar'
Handles all dir names, even including single-quotes
misc/quitcd/quitcd.nu
Outdated
@@ -7,7 +7,8 @@ def-env n [...x] { | |||
^nnn ($x | str join) | |||
let newpath = ( | |||
if ($env.NNN_TMPFILE | path exists) { | |||
let newpath = (open $env.NNN_TMPFILE | parse 'cd "{nnnpath}"').0.nnnpath | |||
let rawpath = (open $env.NNN_TMPFILE | parse --regex 'cd (?P<dir>.+)').0.dir | |||
let newpath = ($rawpath | $"echo ($in)" | /bin/bash -s) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding bash dependency on another shell's config doesn't seem like a good idea.
This reverts commit c05bced.
Feel free to open another PR if you manage to fix it without requiring |
cd
on quit broken #1736