On Apr 9, 2014, at 9:22 AM, glphvgacs <darwinsker...@gmail.com> wrote:

> On Wed, Apr 09, 2014 at 10:31:26AM +1000, Ian Munsie wrote:
>> On 9 April 2014 08:14, Kevin Ballard <ke...@sb.org> wrote:
>>>>> dangerous and surprising behavior to put into a terminal shell. For
>>>>> example, `rm f` should _never_ automatically invoke `rm f*`.
>>>>> 
>>>>> -Kevin
>> 
>> Kevin's example was that he has previously deleted all files starting
>> with an f (which I've done on many occasions) and is now attempting to
>> remove a single file called f (which I've done on many occasions), but
>> your suggestion would cause fish to delete all files starting with an
>> f again - I think that perfectly illustrates why automatically
>> accepting suggestions in the shell is a really *really* bad idea.
> 
> well, haven't we all made ruinous typo's? i think yes. so they happen
> and if you don't read what you type you're bound to do harm. but if you
> do read carefully then it is _only_ the _first_ run that calls for full
> attention. repeating the same command _less_ so. now your example is 
> good case for emphasising the 'less' is that sentence.

Just because a command is safe to run once does not in the slightest mean it is 
safe to run again in the future. This comes back to my trivial example `rm f*` 
vs `rm f`. The fact that I wanted to delete all files beginning with the letter 
"f" in the past says nothing whatsoever about how safe it is to delete all 
files beginning with the letter "f" today. Maybe last time I was deleting 
"foo.txt", but today it would delete "From Zero to Hero: A Biography That Took 
12 Years To Write And I Have No Backups.tex".

> and fish wouldn't be the first shell to enable this. zsh has it, just try
> this:
> 
> zle-line-init() {
>  zle history-incremental-search-backward
> }
> zle -N zle-line-init
> 
> i haven't had that now for over 3 years in my .zshrc. no catastrophes so
> far.

Experimentally, that appears to simply trigger a backwards-i-search on every 
new line. That's an explicit history search that can be cancelled with the 
escape key. It behaves radically different than fish's suggestions. Not only 
does it not let you enter brand new commands (as it's explicitly a search of 
history), but it's also modal. Meanwhile fish's suggestions are just that: 
suggestion. It's not an explicit search, it's not anything that can be 
cancelled, and it doesn't prevent you from typing brand new commands that have 
not been executed before.

I also question how you can stomach having that as your zle-line-init. Don't 
you get tired of canceling the search so you can enter new commands? Or is your 
Terminal usage actually restricted to just running the same commands over and 
over again?

In any case, your usage of the terminal here is extremely non-standard. I've 
never in my life heard of anyone else who wants to prioritize history search 
over the ability to execute new commands. The vast majority of people have to 
press a keybinding to even initiate history search. And the people who are 
using shells like Fish that can auto-suggest still press a keybinding to accept 
the suggestion.

-Kevin
------------------------------------------------------------------------------
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment 
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees
_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to