You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A:aliasIssues around support for command aliases, touches parser and name resolutioncategory:inconsistent-behaviorBehavior between different commands or types inconsistent/unexpected
It would be nice if the same extension syntax worked for external as well as internal commands, so, for example, I could do this:
alias ls = SomeMagic(ls -a)
alias grep = SomeMagic(grep -i)
It has always bugged me that (most) shells allow the old_alias syntax: how do they know to stop recursion? Putting some explicit syntax in the expansion would be a good thing, I think.
I do think we need some solution here, otherwise Nushell will never be able to deprecate old-alias.
Error: nu::parser::unknown_state
×Unknown state.
╭─[zoxide.nu:32:1]
32│ }
33│ cd $path
· ─┬
· ╰──Alias does not point to internal call.
34│ }
╰────
This error is in follow functions:
# Jump to a directory using only keywords.def-env__zoxide_z [...rest:string] {
# `z -` does not work yet, see https://github.com/nushell/nushell/issues/4769letarg0= ($rest|append'~').0letpath=if (($rest|length) <=1) and ($arg0=='-'or ($arg0|pathexpand|pathtype) ==dir) {
$arg0
} else {
(zoxidequery--exclude $env.PWD-- $rest|strtrim-r-c"\n")
}
cd $path#^^^^^^^
}
# Jump to a directory using interactive search.def-env__zoxide_zi [...rest:string] {
cd $'(zoxide query -i -- $rest | str trim -r -c "\n")'#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
}
...
aliascd=__zoxide_zaliascdi=__zoxide_zi
A:aliasIssues around support for command aliases, touches parser and name resolutioncategory:inconsistent-behaviorBehavior between different commands or types inconsistent/unexpected
Activity
fdncred commentedon Feb 27, 2023
As a work-around, does it help to create a custom command?
MangoIV commentedon Feb 27, 2023
no, it tells me "unknown flags
-Lv"fdncred commentedon Feb 27, 2023
oh, it's redefining the same name. You might be able to get away with changing
nix -Lvto^$"nix -Lv"or^$"(nix -Lv)"but I'm not sure.MangoIV commentedon Feb 27, 2023
btw; the error message is also (slightly) misleading:
At least for me it wasn't immediately obvious before reading the actual code that this means that I used the same name twice...
(I don't think you should change the error message if this behavior will get fixed anyway but perhaps if it doesn't, this should be changed...)
amtoine commentedon Feb 27, 2023
i have the same issue and used to define
cp,rmandmvto their--verboseversions 😢would love to see that back 😋
fdncred commentedon Feb 27, 2023
I kind of wonder what would happen if we had a
run_internalcommand and then did something likeIt may not work either because I can't even get this to work
amtoine commentedon Feb 27, 2023
mm why not 🤔
but the former
alias cmd = cmd --some-option-you-want-as-the-defaultlooks really clear and neat to me 😮MangoIV commentedon Feb 27, 2023
I think it's kinda obvious that this should be possible. For now we can use old_alias though.
amtoine commentedon Feb 27, 2023
oh wow, how did you find that? 😮
MangoIV commentedon Feb 27, 2023
See the mentioned PR :3
amtoine commentedon Feb 28, 2023
jeez i searched old_alias...
really did not want to read anything yesterday, terrific 😆
thanks 👍
bobhy commentedon Mar 1, 2023
It would be nice if the same extension syntax worked for external as well as internal commands, so, for example, I could do this:
It has always bugged me that (most) shells allow the old_alias syntax: how do they know to stop recursion? Putting some explicit syntax in the expansion would be a good thing, I think.
I do think we need some solution here, otherwise Nushell will never be able to deprecate
old-alias.Disable alias recursion (#8397)
Miuler commentedon Mar 15, 2023
My script in nushell has a error:
This error is in follow functions:
ajeetdsouza/zoxide#542
fdncred commentedon Mar 15, 2023
I posted this to the zoxide issue as well. We're still working on this as documented here https://www.nushell.sh/blog/2023-03-14-nushell_0_77.html#reworked-aliases-breaking-changes-kubouch