News for hackers. Stuff that matters.
Re:Fish 2.0 shell beta by ridiculous_fish on Thursday April 18, 2013 @02:18AM (#5569153)
Lead dev here. Reading the comments is thrilling and makes me even more excited for the official fish 2.0 release, which will be in a few weeks.

For me, the as-you-type suggestions and syntax highlighting make fish feel active and responsive, providing instant feedback. I've also had a great response from casual command line users, who love that features like git tab completions just work, with nothing to configure.

It's going to be a fantastic option for command line users. Meanwhile the action is on the github page at http://github.com/fish-shell/fish-shell/

Re:Fish 2.0 shell beta by IanCal on Thursday April 18, 2013 @10:22AM (#5570718)
Checked out, compiled and installed in minutes, looks fantastic. I really love the completions based on manpages, which I've already found useful for a tar command (insert relevant xkcd here).

Once I get my shells .rc file converted (I think it's just a few variables & calls to other scripts I'm missing) I'll switch over completely.

Looking forward to the future releases, but looking brilliant so far :)

Re:Fish 2.0 shell beta by thelittlelisper on Thursday April 18, 2013 @07:59AM (#5570038)
As a zsh user, fish looks fantastic thanks to its lightness, responsiveness and default settings.

I'm only slightly unhappy about fish requiring python (actually python2 in Arch Linux). AFAIK, this is needed for the web server configuration interface. It'd be much better if fish could be built with this as an addon or optional dependency.

Re:Fish 2.0 shell beta by StavrosK on Thursday April 18, 2013 @04:56AM (#5569551)
Man, I've been using fish as my primary shell for years now, and I just love it. I'm terribly excited about this release. Are there going to be debs for x86/amd64, or maybe even a ppa?
Re:Fish 2.0 shell beta by izietto on Thursday April 18, 2013 @06:21AM (#5569753)
fish 2 pacakges (including debs) are already available: http://download.opensuse.org/repositories/home:/siteshwar/ but I would prefer to have an APT conf line too :-)
Re:Fish 2.0 shell beta by siteshwar on Thursday April 18, 2013 @11:54AM (#5571297)
APT conf line has following format :

deb http://download.opensuse.org/repositories/home:/siteshwar/Ub... ./

So for e.g. if you're on Ubuntu 12.10 use :

deb http://download.opensuse.org/repositories/home:/siteshwar/Ub... ./

Re:Fish 2.0 shell beta by izietto on Friday April 19, 2013 @01:47PM (#5577828)
(for importing the key: curl -sL http://download.opensuse.org/repositories/home:/siteshwar/Ub... | apt-key add - )
Re:Fish 2.0 shell beta by izietto on Friday April 19, 2013 @01:31PM (#5577760)
thank you a lot!
Re:Fish 2.0 shell beta by StavrosK on Thursday April 18, 2013 @06:45AM (#5569812)
Fantastic, thank you. Are these legit/official?
Re:Fish 2.0 shell beta by izietto on Thursday April 18, 2013 @08:05AM (#5570076)
The repository is linked in the official readme https://github.com/fish-shell/fish-shell/blob/master/README.... , so I guess they are
Re:Fish 2.0 shell beta by StavrosK on Thursday April 18, 2013 @08:59AM (#5570320)
Oh, great, I'll install now then. Thank you.
Re:Fish 2.0 shell beta by GhotiFish on Wednesday April 17, 2013 @09:34PM (#5568453)
Something about this shell interests me. I just CANT put my finger on it.

edit: Jokes aside, this is a nice shell, there are no videos of youtube for it though, I should go through the doc's and record one.

edit2: OK I just tried playing around with the shell. It's got some really nice features, but then I said to myself "hey, lets try doing some work with this, I'd like to get rid of fedora 18's neutered package management GUI and replace it with yumex."

ok easy enough, whoops I forgot to use sudo.

sudo !!

   ghoti@localhost ~/Videos> sudo !!
   [sudo] password for ghoti: 
   sudo: !!: command not found
   ghoti@localhost ~/Videos [1]> 
oh... ok... docs?

here it is, right at the very end of the documentation.

  "Because history substitution is an awkward interface that was invented 
   before interactive line editing was even possible. Fish drops it in favor of 
   perfecting the interactive history recall interface. Switching requires a small 
   change of habits: if you want to modify an old line/word, first recall it, then 
   edit. E.g. don't type "sudo !!" - first press Up, then Home, then type "sudo "."
.... WHAT?!

ridiculousFish, you arn't kidding around with that name are you?

Re:Fish 2.0 shell beta by Camillo on Thursday April 18, 2013 @02:27AM (#5569178)
It's perfectly reasonable. There is already an interface for recalling previous commands, and an interface for editing the command line. Combining them to issue a variation of a previous command is the logical thing to do. Having a completely wacky alternate syntax for the specific operation of "put the whole previous command in this place surrounded by new text" is a wart. It's like the irregular English syntax that you hate so much, except that in this case there's still time to fix it, because bash hasn't been around that long.
Re:Fish 2.0 shell beta by GhotiFish on Thursday April 18, 2013 @08:08AM (#5570095)
Perfect! I love regular syntax!

For example, Lojban uses a method of saying phonemes to describe words, like Hebrew, so the number 100,508,290 is just an utterance rather than a sentence.

  panono k'io munobi k'io resono
Rather than

  One hundred million, five hundred and eight thousand, two hundred and ninety.
consistent, simple, fast, unambiguous. numbers are a common occurrence, so they should be fast to speak, So when the extremely common occurrence of me forgetting to include sudo for a command that requires escalated privileges, I expect that task made easier.

As an alternative, think of it like this. the specific operation of "put the whole previous command in this place surrounded by new text" is actually a common idiom in calculation programs. Commonly called "ans". Mathmatica actually marks the results of all its computations with a tag (I think t[n]) so you can recall arbitrarily.

That's not to say I'm a stick in the mud, if "sudo !!" sucks, make it better!

How about something that turns a command into a postfix command? Or actually having a hotkey recall the previous command? Maybe a hotkey that looks at the text in the argument then searches up the history to replace? so if I type sudo rm^U it takes 'rm' and searches up history, replacing it with the first match, "sudo rm -rf ~/opt/java"? Lots of possibilities!

Re:Fish 2.0 shell beta by Camillo on Thursday April 18, 2013 @09:30PM (#5574253)
How about you just press up arrow to recall the previous command, ctrl-A to go to the beginning of the line, and then type "sudo "? It's the same number of keystrokes as typing "sudo !!". And I'm sure you can use something other than up arrow to recall the previous command if you don't want to take your fingers off the home row.
Re:Fish 2.0 shell beta by GhotiFish on Friday April 19, 2013 @12:50PM (#5577542)
the reasons are legion.

Up and ctrl A are independent key strokes. They precede typing sudo, which is a logical train of thought ("Oh I forgot sudo, i should of typed sudo and then x").

! is a commonly used key in English language, and pressing it twice is fast, where as getting two desperate keys is not.

After the proposed action, you end up here:

  sudo |something fishy
as opposed to here:

  sudo something fishy|
which prevents you from writing an addendum to that command.

This sounds small, but I was doing what you suggested before I found out I could say "sudo !!" I immediately switched when I found out, and it's now a very common idiom for me. I switched from "up home sudo space" to "sudo space bang bang" for all the reasons described above.

Re:Fish 2.0 shell beta by abrowne on Thursday April 18, 2013 @01:10PM (#5571775)
I used fish for a while -- and I think I might go back -- and I missed "sudo !!" too. I like this suggested[1] function as a replacement:

    function sudo!!
        eval sudo $history[1]
    end

[1]: https://github.com/fish-shell/fish-shell/issues/288#issuecom...
Re:Fish 2.0 shell beta by GhotiFish on Friday April 19, 2013 @01:52PM (#5577849)
I thought the hotkey was more attractive, but I can't seem to get that one to work. Thanks for the suggestion, sudo!! gets the job done.
Re:Fish 2.0 shell beta by dfc on Wednesday April 17, 2013 @10:16PM (#5568593)
Is the joke that your username contains fish? For the life of me I can't figure out what the joke is and if its the username bit its a poor joke.
Re:Fish 2.0 shell beta by GhotiFish on Wednesday April 17, 2013 @10:24PM (#5568615)
When I made the comment. I was looking at this line:

   For an overview of the features in *fishfish*, see the 
Which I took as the official name of the shell, before I later realized it was some kind of wierd typo. my name is pronounced fish-fish. I was drawing attention to this https://en.wikipedia.org/wiki/Ghoti . I hate English, you see.
Re:Fish 2.0 shell beta by eitland on Thursday April 18, 2013 @01:30AM (#5569044)
I don't hate English. In fact they got a whole lot right after they branched off. Just removing some of the stupidity from Scandinavian, German, French and other words makes a whole lot of difference (Seriously: Genders for words, who came up with that? ; )

The spelling otoh: Yes, that one is broken.

Re:Fish 2.0 shell beta by ableal on Thursday April 18, 2013 @04:16AM (#5569447)
> (Seriously: Genders for words, who came up with that? ; )

It's for entertainment purposes. Provides harmless amusement to native speakers of languages that have it, especially when English (or Chinese, or whatever underfeatured language) speakers fumble the genders of tables, forks, cars, etc.

More fun than a barrel of monkeys. Also good for poets, makes their work more difficult, thus rarer and better smelling when burnt.

Re:Fish 2.0 shell beta by StavrosK on Thursday April 18, 2013 @04:58AM (#5569555)
fishfish is not a typo, this is a maintained fork of the original fish shell, and it is called fishfish. Unless I'm mistaken, anyway.
Re:Fish 2.0 shell beta by Symmetry on Thursday April 18, 2013 @08:56AM (#5570309)
Exactly, fishfish is fish's fork of fish. Though at some point a fork becomes the mainline by default, and I sort of feel that fishfish has already passed that point.
Re:Fish 2.0 shell beta by sciurus on Wednesday April 17, 2013 @09:04PM (#5568371)
Anyone looking at fish may be interested in the design document, "a description of the design principles that have been used to design fish". The principles are

  The law of orthogonality
  The law of minimalism
  Configurability is the root of all evil
  The law of user focus
  The law of discoverability
http://ridiculousfish.com/shell/user_doc/html/design.html
Re:Fish 2.0 shell beta by ash on Thursday April 18, 2013 @06:10AM (#5569706)
"The law of minimalism" was recently changed to "law of responsiveness":

https://github.com/fish-shell/fish-shell/issues/612

Re:Fish 2.0 shell beta by mixmastamyk on Wednesday April 17, 2013 @08:11PM (#5568208)
A way to move to fish gradually is to use it on your local machine (interactively) but still write scripts in bash and stick to bash on remote hosts. This helps keep you in sync with others.

One drawback is keeping your aliases in sync, but once done it is not much work.

Re:Fish 2.0 shell beta by thomasjames on Thursday April 18, 2013 @05:11AM (#5569577)
This is what would be keeping be back I think. I spent too much of my day in remote shells on systems where I do not have root. This shell looks really cool, but I am afraid that I would come to depend on its features and thus lose my bashfu skills in the process.
Re:Fish 2.0 shell beta by sdfjkl on Thursday April 18, 2013 @08:43AM (#5570259)
I've been using Fish for close to a year now and I can't go back. It's subtly making my shell better without getting in the way. You don't notice it very much, until you have to use a machine without it - at which point you will miss it sorely.
Re:Fish 2.0 shell beta by X4 on Wednesday April 17, 2013 @10:41PM (#5568650)
It was so much fancier than ZSH which I've been using pretty throughly for years, but I wasn't impressed until I used a oh-my-fish like "framework". Now with a bump to ><<<+> 2.0 I'll give it a go again!

https://github.com/bpinto/oh-my-fish

Re:Fish 2.0 shell beta by reledi on Wednesday April 17, 2013 @07:30PM (#5568023)
If I switch from bash to fish, will anything break (e.g. aliases, scripts, keyboard shortcuts, etc.)?
Re:Fish 2.0 shell beta by adwf on Wednesday April 17, 2013 @07:44PM (#5568090)
Scripts will still work as long as they have the standard #!/bin/bash at the top.

Aliases - in .bashrc - unfortunately will need to be replaced by Fish functions; defined in the "~/.config/fish/config.fish" file by default.

The only real thing that keeps tripping me up with Fish is that it doesn't support shortcuts like "!$ ". I keep on typing that in, but due to the nature of Fish, it can't (or won't) recognise it. But the excellent history functionality does make up for this a fair bit.

Having said that, Fish is by far the best shell I've tried. I gave zsh a go for about half a year and got fed up with the autocompletion and general slowness. As a shell, Fish just behaves quickly and fairly naturally, with few exceptions (!$ ...).

I highly recommend it as an improvement over bash.

Re:Fish 2.0 shell beta by kbd on Wednesday April 17, 2013 @08:37PM (#5568285)
> I keep on typing that in, but due to the nature of Fish, it can't (or won't) recognise it. But the excellent history functionality does make up for this a fair bit.

I was interested in this comment so I looked into the documentation to find out why this is. Here's a link to the FAQ for anyone else interested:

http://ridiculousfish.com/shell/user_doc/html/faq.html#faq-h... (last question)

Re:Fish 2.0 shell beta by GhotiFish on Thursday April 18, 2013 @02:50PM (#5572296)
I'm a little sore that the FAQ Listed that as an alternative. That was how I did it in bash before I realized I could do "sudo !!" which was waaaaay more convenient.

It's a step backwards. Which I'm fine with, as long as you step forward again, in some way.

Re:Fish 2.0 shell beta by nemo1618 on Wednesday April 17, 2013 @09:00PM (#5568360)
that works just as well I guess. But what if I want to make an alias for "sudo the last command"?
Re:Fish 2.0 shell beta by kbd on Wednesday April 17, 2013 @10:02PM (#5568547)
Re:Fish 2.0 shell beta by pooriaazimi on Wednesday April 17, 2013 @11:06PM (#5568716)
Wonderful!

I made a slight variation (and also posted it there):

      function .runsudo --description 'Run current command line as root'
        set cursor_pos (echo (commandline -C) + 5 | bc)
        commandline -C 0
        commandline -i 'sudo '
        commandline -C "$cursor_pos"
      end
      bind \es ".runsudo"
Instead of outright `execute`ing the command, the above would save the cursor position. You can (theoretically) bind `\cs` so control-s adds the sudo (instead of option-s), but I couldn't get it to work.
Re:Fish 2.0 shell beta by Osmium on Wednesday April 17, 2013 @07:39PM (#5568067)
Yes -- fish is not bash, so anything defined in your .bash_profile etc. will break, though there's usually an easy alternative way to do it in fish. Scripts should be fine though, since they usually explicitly call bash when you run them, so will still run using bash.

I switched to fish about six months ago and have been very happy with it. I spend a lot of my working day in the command line, though not doing anything exotic, and find it very pleasant to use.

[deleted]
Re:Fish 2.0 shell beta by Thrall on Wednesday April 17, 2013 @08:09PM (#5568204)
It wouldn't read your .bash_profile, because it cannot. Any variables that are set by your .bash_profile will therefore not be set, and anything that depends on them being set may break.
Re:Fish 2.0 shell beta by qznc on Thursday April 18, 2013 @02:33AM (#5569193)
Fish is not a POSIX shell and does not try to be one. In contrast, bash, zsh, and others are supersets of the original sh and backwards-compatible. Fish is not.

For example the exit code of the previous command, instead of POSIX $?, you can get it as $status.

Re:Fish 2.0 shell beta by dmit on Thursday April 18, 2013 @07:47AM (#5569993)
Look out for errors with third-party applications that shell out and expect to find bash or something compatible. I had to explicitly set shell=/bin/bash in .vimrc before any plugin initialization in order to avoid breakage after changing my login shell to fish.
Re:Fish 2.0 shell beta by Symmetry on Thursday April 18, 2013 @09:04AM (#5570339)
I've found that leaving your login shell as bash but making fish the default executable for any terminal emulators you use will pretty much prevent any breakage.
Re:Fish 2.0 shell beta by apricot13 on Thursday April 18, 2013 @04:42AM (#5569518)
Don't you mean "Fish 2.0 shell betta"?
Re:Fish 2.0 shell beta by sdfjkl on Thursday April 18, 2013 @11:47AM (#5571257)
Huh? Oh.

"Betta (pron.: /ˈbɛtə/) is a large genus of small, often colorful, freshwater ray-finned fishes"

Re:Fish 2.0 shell beta by qznc on Thursday April 18, 2013 @02:26AM (#5569174)
I would like to have UndistractMe [0] for fish. However, I am not sure if it is possible to hook into or wrap command execution. You know a command has finished, when a new prompt is shown. However, how do you start the clock?

Tried posting this to the fish mailinglist, but moderation pending for weeks now.

[0] http://mumak.net/undistract-me/

Re:Fish 2.0 shell beta by qznc on Thursday April 18, 2013 @04:58AM (#5569554)
Re:Fish 2.0 shell beta by naranja on Friday April 19, 2013 @02:21AM (#5575181)
I once tried fish 1 year ago by "accidient". Got instantly addicted. Why do other shells have to be so akward? It totaly clear to me, that bash & co frightens people from using CLI.

Instantly switched to fish. Never looked back.

Re:Fish 2.0 shell beta by srijan4 on Thursday April 18, 2013 @04:59AM (#5569556)
Does anyone know how to initially import zsh's history into fish?
Re:Fish 2.0 shell beta by omaranto on Wednesday April 17, 2013 @09:31PM (#5568441)
Is this a fork of the other shell named fish? I use a shell also named fish with the same syntax as this one, but whose development stopped a few years ago.
Re:Fish 2.0 shell beta by mixmastamyk on Wednesday April 17, 2013 @09:42PM (#5568476)
Yes, the one packaged in Linux distro's is 1.23.X. Last I heard on the mailing list, the original author was jazzed someone new picked it up.
Re:Fish 2.0 shell beta by orefalo on Wednesday April 17, 2013 @08:58PM (#5568351)
Where is the feature list? do you have screenshots?

I know it's hard with a CLI, but still if it's colorful better show the baby...

Re:Fish 2.0 shell beta by scotth on Wednesday April 17, 2013 @09:04PM (#5568373)
Re:Fish 2.0 shell beta by emdagon on Wednesday April 17, 2013 @07:59PM (#5568165)
This looks awesome!, I'll definitely try it! (the color configuration approach is very clever)
Re:Fish 2.0 shell beta by X4 on Wednesday April 17, 2013 @10:49PM (#5568677)
Can't find 2.0 in the Gentoo repos.. anyone like to share his ebuild?
Re:Fish 2.0 shell beta by siteshwar on Thursday April 18, 2013 @12:09AM (#5568849)
http://download.opensuse.org/repositories/home:/siteshwar/Ce...

For anyone else having problems finding native packages for Linux, I am building packages for several Linux distros at http://download.opensuse.org/repositories/home:/siteshwar/

Re:Fish 2.0 shell beta by oblio on Thursday April 18, 2013 @06:53AM (#5569836)
Does it work with Cygwin?