-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Configurable behavior on expression (not command) input | Unnamed alias #2411
Comments
There are two other possibilities:
We've definitely been thinking about hooks (option #2), but haven't designed anything for that yet, since our scripting support isn't top notch. #1 would be a good solution for now, and I would prefer it over a specially named alias / flag on alias because I think it's a bit easier to discover. What do you think? |
I agree. $path --> cd into path
$math-expression --> drop me in a python shell and let python evaluate the expression
$column-path --> echo the value pointed to by column-path in the last table, which has been printed to the screen This proposed idea has the shortcoming of not being able to determine between: $ ./file --> execute file
$ path --> cd into path As file and path are both of SyntaxShape::Path. Therefore a special rule needs to be encoded in nushell for this use case. |
Thanks for expanding. That helps clarify your request. I think that this is a fairly significant feature that would be good to explore in an RFC. I'd love to see us get rid of our hardcoded behaviour for "auto cd when directory" 🙂 |
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. |
This issue has been marked stale for more than 10 days without activity. Closing this issue, but if you find that the issue is still valid, please reopen. |
Currently:
Would cd into the directory /etc
I want this behavior configurable. I would rather like the shell to ls /etc here.
As nushell is Syntax aware a mapping from
SyntaxShape1 -> alias
is possible as soon as aliases have signatures with meaning.
Describe the solution you'd like
nushell will now automatically deduct the type of path, check if one such mapping for this syntactical type exists already, and warn me if so. Otherwise typing "/etc" has the same result as "ls /etc" :)
The text was updated successfully, but these errors were encountered: