Live data from Hacker News

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

ridiculousfish.com

131–140 of 155 posts

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

#131

Earlier quoted context omitted.

zsh used to do this for me (back when I used it; switched back to bash about a year ago now), and it was the most _annoying_ thing it ever did. My typical workflow (when working on a software project) involves a pair of terminals for compiling and execution, an editor window (whether gvim or kate/kile/kdevelop etc.), and a documentation terminal for manpages. Oftentimes my execution lines are somewhat long -- enablin…

You could have simply turned history sharing off...

I prefer a middle ground, in which entries from multiple sessions are interleaved in the history file, but individual in-memory histories don't reflect what happened in other sessions in the meantime.

For future reference, I use the following Zsh history options:

  setopt incappendhistory
  setopt extendedhistory
  setopt histignorespace
  setopt histignoredups

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

#132
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...

Thanks for the pointer. I can't say how much I wish more people would include pointers to code fragments or specific commits on a site called hacker news.

Tangential question: is gitorious's syntax highlighting usually this awful? The first thing I need from syntax highlighting is distinguishing comments from code.

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

#133
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...

[deleted]

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

#134
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...

[deleted]

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

#136
post #77

Man, I used to use fish. It was great. It was like all the things people eventually make zsh do but in one convenient binary. I think my favorite feature was that history was instantly shared among all your open fish instances.

What do you use now? And why did you switch?

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

#137
post #119

Earlier quoted context omitted.

Is it abuse? It hasn't slowed anything down yet. Also, in the blog post I linked to the link you mention.

I don't know whether it's abuse. I just don't trust bash's history enough. Yeah, I now noticed that you already put that link in the blog.

And to be clear, what's described in that link doesn't work, at least not on my OS X machine. Thus the code in my blog post.

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

#138

Under the known bugs and issues: History file should apply some kind of maximum history length Fine, but the default needs to be large, like 100MB. Disks are big now. I hope ridiculousfish agrees.

Hi, ridi here! This bug is actually fixed with my changes (see the release notes at http://ridiculousfish.com/shell/release_notes.html ). The maximum history length is now 250k unique items, with an LRU discard policy. A full history would be around 15 MB. Processing time is one concern. fish doesn't do anything as clumsy as keeping the entire file in memory, but scanning a large history file can still add up. But th…

Thanks for the reply and for picking up this project. So far I'm loving the extra interactivity of fish.

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

#139

Why does xargs under fish not accept {} as a replstr like it does with bash? find . | xargs -I {} grep pat {} On OS X fish this gives "xargs: replstr may not be empty" and on Linux fish I get "xargs: command too long". Using % as the replstr for example does work though.

The beauty of fish is that it handles lists much better than bash - it kind of has xargs "baked in". If I understand the example correctly, it finds every file under the current directory and greps for "pat" in each file. In fish you could do this: grep pat (find .) ... or this: for i in (find .) grep pat $i end The first example would work correctly in fish, but AFAIK it wouldn't work in bash. The is because every l…

Yep, you understood it fine. ('pat' was short for 'pattern'. It was just an example)

Wow, that 'autoescaping the commands in parens' syntax is great. But it doesn't seem to be list related. For example: grep pattern (echo "foo.txt") just passes the result from the echo to grep. It's grep which is doing the right thing with a list, right? Still this is interesting. So fish stuff isn't necessarily written left to right and joined with pipes, instead it's written in nested form like in a more modern langauge.

Alas you still need to use the "find | grep" technique in fish because of the argument size limit. For example:

    grep pattern (find .)
results in:

Failed to execute process '/usr/bin/grep'. Reason: The total size of the argument and environment lists 34kB exceeds the operating system limit of 34kB. Try running the command again with fewer arguments.

The equivalent in bash gives you:

-bash: /usr/bin/grep: Argument list too long

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

#140

Earlier quoted context omitted.

You could have simply turned history sharing off...

I prefer a middle ground, in which entries from multiple sessions are interleaved in the history file, but individual in-memory histories don't reflect what happened in other sessions in the meantime. For future reference, I use the following Zsh history options: setopt incappendhistory setopt extendedhistory setopt histignorespace setopt histignoredups

I think what would be slickest is if up-arrow and down-arrow navigate local history, but history-search would navigate all history... I wonder if I can make it do that.
Post reply on HN