
Fish shell 2.1 - siteshwar
http://fishshell.com/?version=2.1
======
pooriaazimi
This is the biggest change:

>
> [http://fishshell.com/release_notes.html](http://fishshell.com/release_notes.html)

> When tab-completing a file, fish will first attempt prefix matches (foo
> matches foobar), then substring matches (ooba matches foobar), and lastly
> subsequence matches (fbr matches foobar). For example, in a directory with
> files foo1.txt, foo2.txt, foo3.txt…, you can type only the numeric part and
> hit tab to fill in the rest.

This is really brilliant! I always wanted that (without knowing it).

~~~
lignuist
I am looking for something that lets me type the first few letters and when I
press the arrow-up key then (maybe in combination with another key), it will
only offer those items from the history, which match my previous input.

Something like:

Type:

> ssh

press arrow-up:

> ssh larry@google.com

press arrow-up:

> ssh mark@facebook.com

~~~
cshenoy
oh-my-zsh[1] does that for me. It's a pretty great function.

1\. [https://github.com/robbyrussell/oh-my-
zsh](https://github.com/robbyrussell/oh-my-zsh)

~~~
josteink
Im using oh-my-zsh, but I cant find this one. Care to enlighten me which
option or plugin I should enable? :)

Edit: Seems ctrl-up and ctrl-down does the trick.

~~~
Spittie
I'm using [https://github.com/zsh-users/zsh-history-substring-
search](https://github.com/zsh-users/zsh-history-substring-search)

It emulates the Fish behavior (which is just awesome). I'm not sure if it
requires oh-my-zsh, but I think it doesn't.

~~~
josteink
It's actually a plugin bundled with oh-my-zsh, but I copy-pasted the default
keybindings from the github page you linked, and it's indeed pretty awesome.

------
recuter
With love: I always felt like fish and even zsh are kind of beautiful OCD-
induced bouts of counter productivity in the same vain as Dvorak keyboard
layouts and Plan 9. We can't handle things being messy and imperfect so we
solve it by building our own parallel universes.

What do you do when you have to use a computer without your customization?
Perfect is the enemy of good, worse is better, join us on the dark side, all
that jazz. :)

Is fish really really REALLY worth it?

~~~
hyperpape
Are we going to use sh and its descendants for the next 100 years? The
original shells evolved out of macro processors, and as time went on, more and
more programming language features were bolted on, but it's an uneasy fit.

Take it for a test: go write a project euler problem (or any small programming
task--doesn't have to be math) in your shell of choice. It's painful.

There are weird features of shell languages that will never go away (globs and
unquoted strings sharply limit the design space), but even given those
limitations, it's possible to design nicer languages.

I don't fault someone for saying "right now, I'd rather use the default shell
my box comes with, because the pain points of switching are too high". But
yes, we really do need something to replace it. I think both zsh and fish make
nice steps, but I don't think either really meets my hopes.

~~~
recuter
I don't think we are disagreeing. From the tutorial in the OP:

"If you have a strong understanding of other shells, and want to know what
fish does differently, search for the magic phrase _unlike other shells_ ,
which is used to call out important differences."

"stdin and stdout can be redirected via the familiar < and >. _Unlike other
shells_ , stderr is redirected with a caret ^"

That's pretty, no argument there. But I already remember to count the std's
from 0, so stderr is &2\. Not as pretty, fish is nicer, no argument. But its
not MUCH nicer, and I'm going to have to use &2 here and there in my life
anyway...

So:

\- fish has no dedicated syntax for setting variables

\- fish does not have an export command

\- fish stores the exit status of the last command in $status instead of $?.

\- fish does not use backticks ` for command substitutions. Instead, it uses
parentheses.. I'm pretty sure good bash form is $() these days, not backticks.
So you're spared the dollar sign.

'etc 'etc. I agree we need something to leapfrog what we have but these
changes, while nice improvements, seem minor. At least as far as I can see!
That's why I asked. Maybe there's some more neat stuff that makes it a
significant improvement.

~~~
anateus
I'm not sure what you mean about setting variables and export, because here's
how I do it:

    
    
        set foo bar # sets foo to bar
        set -x foo bar # sets foo to bar and exports it to the environment

------
leokun
I like the idea of fish, but I've had issues with other programs assuming
things about my shell. Like vim and I think even other programs. There's
something fish doesn't do, that other shells like bash and zsh do, that breaks
other programs. I can't remember the specifics, but fish breaks stuff for me
when I tried it, and I tried it pretty recently.

~~~
chimeracoder
There are two problems I've found that prevent me from using fish more:

1\. <strike>Fish syntax breaks virtualenv</strike> (Edit: Okay, apparently
this isn't actually a problem).

2\. Fish does not have the equivalent of 'disown' in bash. This is fine if you
exit the parent shell normally, but _not_ if you send SIGKILL, which my window
manager (wmii and i3) does.

~~~
frewsxcv

      . bin/activate.fish

~~~
reledi
Just so people know where to find this in case they forget, it's in the header
of `env/bin/activate.fish`.

 _# This file must be used with ". bin/activate.fish" from fish
([http://fishshell.org)*](http://fishshell.org\)*)

------
js2
I tried fish for a while but found it jarring switching between it and bash
when working on remote machines where fish is not installed. I was also
surprised when I first started using fish that it can't synchronize history
between shell instances, which is a killer feature for me. So after about a
month with fish I've switched to zsh.

[https://github.com/fish-shell/fish-shell/issues/825](https://github.com/fish-
shell/fish-shell/issues/825)

[http://ptspts.blogspot.com/2011/03/how-to-automatically-
sync...](http://ptspts.blogspot.com/2011/03/how-to-automatically-synchronize-
shell.html)

~~~
GhotiFish
That's not a bad idea, but the environments I work on have radically different
layouts, and the most commonly used commands on either station are different.
The filepaths don't even share a commonality, so what good is the shell
history to me? Short of remember SSH destinations.

~~~
js2
Sorry I wasn't clear. I meant sharing history between multiple shells open on
the same machine. I often have two or three terminal windows open with several
tabs each. I use them somewhat haphazardly and would like the history between
them to be shared.

------
talles
[http://fishshell.com/release_notes.html](http://fishshell.com/release_notes.html)

------
GhotiFish

      "Previously, a single % would pid-expand to either all 
       backgrounded jobs, or all jobs owned by your user. Now it 
       expands to the last job backgrounded. If no job is in the 
       background, it will fail to expand. In particular, fg % 
       can be used to put the most recent background job in the 
       foreground."
    

oh! Can fish background tasks now? I haven't being following very closely, I
really should update my shell.

~~~
lunixbochs
The major change here is that `kill -9 %` with no backgrounded tasks would
kill all of your processes (before Fish 2.1).

There's now a guarantee that `%` expands to either the last process
backgrounded or an error.

------
err4nt
I just re-installed Fish this morning. One of the first things I install when
I have a fresh install on a workstation :D

The thing I appreciate most about fish is the clever suggestions from my shell
history - the simplest things can be the biggest time-savers when it comes to
entering obscure commands a few weeks apart (I don't have to look them up each
time I do it now)

------
iagooar
I've been using Fish for a year now, it's really amazing. Not going back to
bash or even zsh.

The only problem I had was getting all vim plugins to work with it, but then I
discovered that you can set the shell vim shall use in .vimrc (I set it to sh)
and now everything works like a charm.

BTW, I'm loving the fuzzy autocompletion, it's truly a "killing feature".

------
golergka
Installing fish instead of bash was the biggest single productivity
improvement that I've ever done. Thanks for your work!

~~~
knodi
Could you give a little insight into what you liked/disliked about it?

~~~
golergka
First of all, color; it's a pretty basic thing, but tremendously helps
understanding information on screen. Then, there's scripting; I'm a newbie in
shell scripting, but being able to pass results of some commands into others
with brackets is much more intuitive and comfortable than using the pipe.

The main thing that I disliked is that all web resources give you scripts and
advice for bash/sh; I have routinely launched bash to use them, but every time
I felt like I'm going to a handicapped version of console.

------
ramigb
I just had an argument with some folks around Bash vs Fish, my argument was as
simple as "i like it", their was "you won't learn anything, fish sucks, you
can do anything it does with a modded bash" ... but that's the point, i don't
want to modify and configure, i want it to work out of the box.

~~~
reledi
Fish works great out of the box but it's also highly configurable. Their
argument about not learning anything is void - you learn more by trying new
things. Also, using fish doesn't mean you never use bash again, I still dabble
around in bash often.

------
growt
Can anyone tell me if there is a substitute for history expansions such as
"sudo !!" or "vi !$" ?

~~~
oyouareatubeo
This is the best answer I found to this question:

> [http://fishshell.com/docs/current/faq.html#faq-
> history](http://fishshell.com/docs/current/faq.html#faq-history)

> _Alt+Up recalls individual arguments, starting from the last argument in the
> last line executed. ..._

I was really missing history substitution in fish, but now I like this even
better.

------
SmileyKeith
Maybe it's just because I really like to customize my shell, but I can't stand
the philosophy of fish [1]. The relevant part: "Configurability is the root of
all evil." I can almost agree with this on many user facing consumer
applications but a shell is so far from that.

[1]:
[http://ridiculousfish.com/shell/user_doc/html/design.html#co...](http://ridiculousfish.com/shell/user_doc/html/design.html#conf)

~~~
siteshwar
Please see my reply at
[https://news.ycombinator.com/item?id=6626993](https://news.ycombinator.com/item?id=6626993)

------
Osmium
I installed 2.1 via homebrew and now, every time I open a new terminal window,
I get:

    
    
        bind: Key with name 'dc' does not have any mapping
        bind: Key with name 'ppage' does not have any mapping
        bind: Key with name 'npage' does not have any mapping
    

Does anybody have any idea what causes this / how to fix it?

~~~
siteshwar
What's the output of 'bind' and 'bind --key-names' on your system ?

~~~
Osmium
Uploaded the output here:
[http://pastebin.com/v6ZKrLcp](http://pastebin.com/v6ZKrLcp) Thanks!

~~~
siteshwar
So it looks like the keys to which fish is trying to bind the mappings are not
available on your system. I have opened an issue for you at
[https://github.com/fish-shell/fish-
shell/issues/1068](https://github.com/fish-shell/fish-shell/issues/1068) , we
will be following up on that. I would appreciate more inputs about your setup.
For e.g. version of OS X, your terminal, keyboard type etc.

~~~
Osmium
Sure. I'm basically on a fresh install of Mavericks (13A603), using
Terminal.app (unmodified from defaults apart from downloading the Solarized
theme), standard British Mac keyboard (rMBP).

~~~
siteshwar
Alright. I have updated the issue on GitHub with this information. Let's
continue discussing it there.

~~~
Osmium
Thanks for opening the issue. I'm not on github at the moment (or, rather, I
am but don't want to link my profile there to my one here), but to answer the
question my $TERM is "ansi". I'll keep checking the issue page for any updates
in future.

Edit: I can confirm that changing $TERM to "xterm-256color" removes the issue.

------
izietto
Thank you for your wonderful shell!!! I feel the lack of official distro
packages (though the fish shell repository works fine)

~~~
_delirium
Debian sid ('unstable') isn't hugely behind, at least by my standards of
software upgrading. Fish 2.0.0 ended up in there about 8 weeks after release,
and I'd expect 2.1.0 should get there in less time (2.0.0 was a change of
upstream, and the first release in 4 years, while 2.1.0 is a relatively
routine update from a distro's perspective).

~~~
izietto
I didn't know it was entered in sid, this is a good news; I hope it will enter
in jessie too, since my servers use it

~~~
_delirium
Should be in jessie (the current 'testing') too, as of July 22:
[http://packages.qa.debian.org/f/fish.html](http://packages.qa.debian.org/f/fish.html)

~~~
izietto
Great, I can start using it on the servers too! Thanks a lot

------
SnowLprd
For those who want to give fish a spin, it might be worth checking out the
guide I wrote on the topic:

[http://hackercodex.com/guide/install-fish-shell-mac-
ubuntu/](http://hackercodex.com/guide/install-fish-shell-mac-ubuntu/)

I'll soon have it updated for fish 2.1.0, Mavericks, and the new PPA
locations.

------
spindritf
They also have a PPA now[1]. I'm pretty sure I looked a few months ago, when
2.0 hit, and it wasn't available.

[1] [http://fishshell.com/files/2.1.0/linux/index.html#dl-
ubuntu1...](http://fishshell.com/files/2.1.0/linux/index.html#dl-ubuntu12.04)

~~~
siteshwar
Yes. We are introducing PPA with this release. You can read the announcement
at
[http://sourceforge.net/mailarchive/message.php?msg_id=315735...](http://sourceforge.net/mailarchive/message.php?msg_id=31573585)

------
imd23
I've been using it as my default shell. It simply rocks. It's my best hack
friend tool. :)

------
vhost-
As a systems engineer, I'm stuck using (mostly) vanilla bash. I'd love to
dabble in fish or zsh, but anytime I start it becomes a waste of time.

Upside is I know bash ins and outs :). I'm usually the one-liner wizard of the
office.

------
patrickg
I have used fish for a few months and I really liked it. I switched back to
bash eventually because of a simple fact that esc-. didn't work in fish (which
I use really often). If fish provides it, I will go back to fish.

~~~
lunixbochs
You get this with Alt-Up on an empty argument (so after pressing space).
Unlike bash, you can keep holding Alt and press Up repeatedly to cycle through
arguments and previous commands.

If you want to be more precise, typing anything in the current argument before
pressing the shortcut will do a substring search.

~~~
patrickg
Is that with the new fish? On 2.0.0 /Mac OS X, this doesn't work.

~~~
lunixbochs
You should set alt as a meta key (in the Terminal preferences under Keyboard)
if you're using Terminal.app. This also allows you to use alt+direction to
move around in text.

------
allyant
I am currently running fish version 2.0.0 (Love it btw!) - does anyone know if
there is a way to manually self update to 2.1? Or do I need to reinstall the
package.

~~~
siteshwar
What OS are you using ? If you are on Linux, you can subscribe to our
repositories from
[http://fishshell.com/files/2.1.0/linux/index.html](http://fishshell.com/files/2.1.0/linux/index.html)
and update your package.

~~~
allyant
On OSX.

~~~
siteshwar
Install it using Homebrew (brew install fish).

------
ProNihilist
Even after doing the "type this to fix weird console ouput" I still have weird
console output :(

~~~
siteshwar
Please explain your problem in detail. If possible, open an issue on GitHub
([https://github.com/fish-shell/fish-shell/issues](https://github.com/fish-
shell/fish-shell/issues))

~~~
ProNihilist
Added an issue at [https://github.com/fish-shell/fish-
shell/issues/1071](https://github.com/fish-shell/fish-shell/issues/1071)

------
yeukhon
Can you split windows in fish shell? Or is that the job of an terminal
emulator, not the job of a shell?

~~~
GlitchMr
No. It's just a shell. Just use tmux or screen for that, which is better idea
anyway, as it's a tool specificially for this purpose.

------
andrewvc
Love fish, been using it for a couple years now, haven't looked back!

------
Tarang
I really love fish, is there any way to use fish over ssh?

~~~
siteshwar
Install it on remote machine :)

------
JSno
The great thing is, author provided all platform installer. Ubuntu, Debian,
Centos, Fedora, even readhat 5,6 and so on. So great for people lazy to
compile by themselves for trying little software. Good job! I up-voted you!

------
derleth
It would be nice if I could find a non-OSX download on that page.

~~~
siteshwar
When you click on Linux tab under 'Go fish' section, it will list the Linux
packages.

~~~
derleth
Only if you have JS enabled. Which means they went to explicit trouble to make
their site not work without JS, which never ceases to amaze me.

------
JSno
can anybody tell me why this Fish shell shows some files by adding "*" at the
end of it?

~~~
siteshwar
Those files are executables. There is a function 'ls' which wraps ls command
and adds --indicator-style=classify parameter to make output more readable.

