-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Command expansions based on the history like !!
#601
Comments
Can you talk a bit more about this feature and how it will work with nu? |
https://stackoverflow.com/questions/15137461/what-is-sudo-bang-bang Bang bang is a placeholder for the last command typed. Mostly used to prepend sudo in front of the last command. |
What if we made |
Would say that we do bought. Bang bang has been around for a long time. Although if we add strict aliases (aka aliases that cant be added on to) so you can make an strict alias Regardless i say its not an alternative, more an addition. |
Are there common use-cases for |
Well its just a placeholder for the last command typed. We are humans and make mistakes. I just found it strange working in a linux shell that does not have the option. bash and zsh have them by default, and fish has an extention for it. |
I use this one all the time. There are a few more commands that are explained here: http:https://craig-russell.co.uk/2011/09/28/bang-bang-command-recall-in-linux.html I reach for the parameters fetching and substitution regularly. |
Just started using nushell a few days ago as my primary driver after playing with it for a few months. I have run into this a couple times. I am fine if the name changes could even be like "lastline" or something but ran into it with sudo and rm when I forgot --recurse |
I would like to share some of the experience with bash and using nushell all time recently. I also often rely much on
I would love to have some type of shortcut similar to how zsh and bash have, but with a more memorable alias that would fit the nushell philosophy. |
Totally agree. I'd love to have all the ! commands implemented in NuShell. The ones I've used most are !!, !$, and !<history_index>. Although, this may be a rustyline thing. Not sure. |
I use |
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. |
Just saw this went stale. How about a “papercut” label for this so it stays open but keeps in mind it is a small thing. I will say I am a daily driver on Nushell at this point. LOVE that it has let me standardize on one shell given I work on Mac, Linux and Windows machines daily (Windows Terminal+nushell is amazing). This feature is the only thing that bites me daily at this point. Thanks for such great work! |
I agree. I was thinking there must be some way to do |
This issue is being marked stale because it has been open for 90 days without activity. If you feel that this is in error, please comment below and we will keep it marked as active. |
seems like since #3611 has been merged, it could be implemented now (also commenting to remove stale label) |
hmmm how would this be implemented using #3611 ? I'm trying |
@danjenson i think it only works with externals like how the PR shows. I can't get it to work with your example either. |
I don't ever mean to be a nag but it has been a year and I am/have been a daily driver with nushell on Mac, Linux and Windows for longer than that. I run into this issue at least every other day. I also still recommend zsh+oh-my-zsh to others due to only this one papercut. I know it seams small and I am a sample size of one, but it is the one thing both annoying me on almost a daily basis and is the only reason I don't tell everybody know to use nushell |
ya, i agree. it's been way too long. sorry about that. @corbinu what are the specific bang commands you're looking for that you would then feel comfortable recommending nushell. btw - this kind of works |
There might be two ways to go about the bash last command builtins:
Apart from |
!!
@corbinu @meltinglava @elferherrera This issue seems can be closed by this PR: #4735 on the latest main branch? |
Aside from
Then e.g. Also each history item is numbered, so if the command you want to recall is 456, then !456 will recall it, and you can e.g. type
to make a single line executing the three previous commands. This is very useful once you're used to it. I'm currently trying to find out how to recall lines from the history in nushell. |
Feature request:
Implement bang bang:
sudo !!
The text was updated successfully, but these errors were encountered: