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
Feature: Nushell support #152
Comments
|
A simple solution would be to put |
|
I have a question... Actually two. 1. Shell elevationWhen someone calls 2. command elevationHow gsudo should elevate commands when invoked from This is different for every shell. For example In
Then, how to properly escape quoting... |
|
right now, there is no way to disable the banner from the command line. I thought this may work but it appears that the check for the banner config may happen in the wrong order to make this command useful. not sure about your second question |
|
Thanks for looking at this @gerardog I've set I'm not quite sure about question 2 - I hadn't thought about it very deeply :) If I run a command like So Or It seems like an alias like @jmoore34 suggests could do it, but I'm not sure how to create an alias like this:
I've asked on Discord. :) |
|
I posted this to discord. but you still have to wrap the command in quotes like The problem is that the nushell see's the pipe and stops collecting the rest because it thinks that's a new command which I think is why this doesn't work |
|
Thanks. That didn't work, but this slight modification does: def sudo [...rest] { gsudo nu -c $"'($rest | str collect ' ')'" }Shame it doesn't work without the quotes, but can live with this solution. |
|
Ya, that's what I meant. 🤣 |
From what I can tell, $rest doesn't support passing over flags. E.g. I think you'll get an error from |
|
@jmoore34 Ah yes, good spot, you're right. Your suggestion of a |
|
Can a Nu function receive an anonymous method/block as a parameter? Like |
|
Finally!
You can test it in the v2.0.0-preview release. |
|
Closing as implemented in v2.0.0 |



It would be great if gsudo could support Nushell.
It currently works fine if running a command like
gsudo notepad.However, if I run just
gsudoon its own to elevate the session, it starts an elevatedcmdsession rather than natively elevating Nushell.If I run
gsudo nuthat works, and Starship picks up that I am running elevated. So hopefully a fix for this issue could be fairly easy?The text was updated successfully, but these errors were encountered: