On Jan 11, 2008 10:13 PM, Endolith <[EMAIL PROTECTED]> wrote: > Beni Cherniavsky <[EMAIL PROTECTED]> writes: > > <Alt+Up> appends the last word of the last command, so it won't do > > what you want in general. > > But what's wrong with "<Up><Home>sudo "? > > That's fine I guess. Both this and "!!" are kind of awkward to type. > > But just doing nothing when I type "sudo !!" is not very friendly. At the > least, it should pop up a message telling me the "fish way" to do it.
Aside from whether this is hard to implement or not, there is the question of detecting this in the first place. Fish does not treat the '!' character specially in any way. In order to detect this and report the error fish would need to start treating '!!' as a special operator, and I'm not convinced that making the user have to escape even more characters in order to report this error more accuratly is a good tradeoff. Axel > > At best, it should know which programs require sudo and tack it onto the > beginning without me needing to specify it with a message explaining the > implications. In fish it is pretty easy to add new key bindings to edit the current commandline. If you are using the darcs version of fish, try out the following: bind \es 'commandline sudo\ (echo $history[1])' The above means that when you press Alt-s, the current contents of the command line is replaced with the first item from the history, with the word 'sudo' and a space prepended to it. Axel > > > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________ > Fish-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/fish-users > ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace _______________________________________________ Fish-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/fish-users
