Live data from Hacker News

Fish: Finally, a command line shell for the 90s

ridiculousfish.com

151–155 of 155 posts

Re: Fish: Finally, a command line shell for the 90s

#151

Earlier quoted context omitted.

Please elaborate on point 1b. I certainly see ways ctrl-r can be improved, but orders of magnitude (while obviously subjective in something like this) would surprise me. That said, I hope to be surprised!

Sure. There's no single feature improvement that is much better, but when considering the improvements together the difference is striking. 1. The search term is highlighted. 2. The search is far more discoverable, its key binding means you can stumble across it. 3. The up cursor key is a better key binding choice. Pressing up without a search term may be considered as searching for commands that match "", namely eve…

Thanks! 1, 4, and 5 in particular do seem useful. Having up search and down cancel is a win for orthogonality, but loses a touch in flexibility (if I'm searching, find something, and then realize I want to run the command before or after it, for instance). On balance, I think fish is doing it right for new users but I don't see anything there that's worth the shift for those of us who have the muscle memory for the other.

One thing I've missed from ctrl-r is the ability to drop in (an implicit or explicit) .* in my search - often, I start my search and hit a line, and I know what will disambiguate but it's a ways down the line.

Re: Fish: Finally, a command line shell for the 90s

#152
post #80

Earlier quoted context omitted.

That's being explicit, the problem is with wrapper scripts that omit that, assuming a sh compatible shell. Still running fish on one of my systems, excited to see new development work as it was getting past the point where I was comfortable using it on anything new.

An old trick for convincing (some) shells that your script is an sh-compatibile shell is to use a colon on the first line. Support for this trick was added to fish back in 2007: https://gitorious.org/~ridiculousfish/fish-shell/fishfish/bl...

I'm not sure how to use it. Can you give an example of where it works, and what changes if this is not done?

Re: Fish: Finally, a command line shell for the 90s

#153
post #13
post #9

Earlier quoted context omitted.

I stopped using fish a while ago, when it would crash whenever I opened a console session (so I couldn't do anything when X didn't start). I switched to zsh with fish emulation, but lately I realized I have a shell that takes much longer to start up and basically does everything fish does, and nothing more. If fishfish is more stable, I'll switch in a heartbeat.

I'd been using fish for a year or two before switching to zsh too. The main reason for me to give it up is because I could not get it to work smoothly with rvm. I've gotten quite used to zsh by now, and I have to say, I don't feel much for having another go at fish just to run into the same limitations again.

Just add those two files listed here (https://github.com/eventualbuddha/fish-nuggets/commit/186775...) to ~/.config/fish/functions, and everything should work out just fine.

Re: Fish: Finally, a command line shell for the 90s

#154
post #148
post #86

Earlier quoted context omitted.

> I stopped using fish a while ago, when it would crash whenever I opened a console session (so I couldn't do anything when X didn't start) This is why I launch my interactive shell from a failsafe /bin/sh instead of using chsh. If zsh ever messes up horribly, I end up back in a good old bog standard shell prompt.

I was just wondering how you accomplish that.

I put this at the end of my ~/.profile:

    REALSHELLS="/usr/local/bin/zsh /usr/bin/zsh"
    for REALSHELL in $REALSHELLS; do
    	if [ -e $REALSHELL ]; then
    		if ! $REALSHELL -l; then
    			echo "$REALSHELL exit $?"
    		fi
    		echo "$SHELL exit in 1s, Ctrl-C to abort"
    		sleep 1 && exit
    	fi
    done
    echo "No shells in [$REALSHELLS] found, falling back to $SHELL"

Re: Fish: Finally, a command line shell for the 90s

#155

Earlier quoted context omitted.

Please elaborate on point 1b. I certainly see ways ctrl-r can be improved, but orders of magnitude (while obviously subjective in something like this) would surprise me. That said, I hope to be surprised!

Sure. There's no single feature improvement that is much better, but when considering the improvements together the difference is striking. 1. The search term is highlighted. 2. The search is far more discoverable, its key binding means you can stumble across it. 3. The up cursor key is a better key binding choice. Pressing up without a search term may be considered as searching for commands that match "", namely eve…

> if you press "Ctrl-r foo Ctrl-r", you will get the second item in your history that matches foo. There's no way to get back to your first search result without repeating the search.

Actually, ctrl-shift-r goes backwards.

Post reply on HN