
Fish Shell Design Principles - charlax
http://fishshell.com/docs/current/design.html
======
marrs
Every now and again I give Fish a try, think how great it is, and then try to
do something like `sudo !!` and give up in a fit of rage.

I understand the desire to avoid using the special chars but the alternative
(using the cursor keys) is just too cumbersome. It turns out that when you use
the shell for everything, efficiency is the thing that matters the most.

Not complaining - I'm not the target audience - I just find it an interesting
observation about usability.

~~~
justinmayer
As you noted, avoiding arcane magical characters is a primary design goal for
Fish. But the alternative you mention — using the cursor keys — is indeed
cumbersome and not at all what Fish users would normally do. In my case, I
added a "sdl" command (for "sudo last") as a plugin for my Tacklebox and
Tackle projects:

[https://github.com/justinmayer/tacklebox](https://github.com/justinmayer/tacklebox)

[https://github.com/justinmayer/tackle/blob/master/plugins/sd...](https://github.com/justinmayer/tackle/blob/master/plugins/sdl/sdl.fish)

Some may feel that these kinds of functions should be built-in, and if so,
that's probably where the philosophical divide lies. For me and many others,
avoiding esoteric syntax makes it easy to compose small snippets that
accomplish precisely what we want, without having to remember unintuitive
special characters or deal with their often-idiosyncratic behavior. (^_^)

~~~
chemzqm
Thanks for sharing, I do like the philosophy that avoiding esoretic syntax and
unnecessary configuration, that would prevent anyone from writing clean and
solid code.

------
Lazare
Incidentally, I've been using fish for a while, and it's really nice.
Coworkers wandering past while I'm working have been known to stop and state;
the fish autocompletion/history magic is really impressive if all you've known
before is the standard bash Ctrl-R stuff. And once you get used to it, and
huge productivity boost, especially if you work a lot with tools like HTTPie.

(And while compatibility with tools which expect bash gets brought up a lot,
I've had zero issues. YMMV.)

~~~
StavrosK
I've been using it for years and swear by it. Z is another tool that makes my
life much easier:
[https://github.com/sjl/z-fish](https://github.com/sjl/z-fish)

If you aren't using fish, you need to switch to it right now.

~~~
anbotero
Same here. One particular thing about fish is problems with OTHER people’s
scripts that don’t setup their shebangs properly, and start causing all kinds
of fuss.

We had this really old build system that worked, but man, it was riddled with
a lot of scripts that did not declare the shebang and used all trickery shell
scripting. It took almost a month to fix them and make them more portable. It
was good, because I converted three people to fish after that. :)

~~~
jeremy_wiebe
Devil's advocate here: could you have gotten away with having a shell script
(build-fish.sh?) that opened a `sh` shell and ran the build? Seems like a
month spent on making a build script work with a minority's choice of (non-
mainstream) shell is a lot. :-)

(I should note that I've been guilty of spending time on non-valuable things.
So this is most certainly a bit of the pot calling the kettle black :)

~~~
StavrosK
That's what he did. He added the shebang lines so they'd run with sh. Although
I don't know why that took months, I would have written a script to find
executable files and check if they had a shebang line.

------
yonrg

      """
      [...]
      Configurability is the root of all evil
    
      Every configuration option in a program is a place where the program is too stupid to figure out for itself what the user really wants, and should be considered a failure of both the program and the programmer who implemented it.
      [...]
      """
    

That's so wrong. Providing configurability is flexibility. No programmer will
ever know what the user really wants. The most he could do, is to define the
most reasonable default values. But there are freaks out there who love to do
stuff differently.

~~~
nvarsj
I don't think he's talking about the power user. It's geared at the pragmatic
user who wants to get work done.

However, it assumes there is always an objective better way. That's something
I'm not convinced of.

The rational that reducing choices will lead to less software bugs is
certainly true, though. That's the reason I'd pick to have less config. Config
options generally map directly to conditionals in your code base, which means
more potential code flows and multiplicative combinations of possible things
your code can do depending on what is turned on and off. There is a real
maintenance cost to having lots of configuration.

~~~
easytiger
> It's geared at the pragmatic user who wants to get work done.

So the person who would just use preinstalled bash then

------
kiproping
It breaks many bash one-liners and other commands, today I discovered I cant
`git merge HEAD@{1}` because fish shell strips the curly braces. Its good but
it can be quite annoying sometimes.

~~~
anbotero
What happens if you enclose 'HEAD@{1}' in single quotes?

~~~
ufo
Should word just fine. Double quotes too. You can also quote just the braces,
in case there is some variable expansion going on in the rest of your word:

    
    
       set foo HEAD
       git reset $foo"@{1}"

------
threatofrain
Fish is the shell I wish I could use, but I'm afraid of the tinkering I have
to do to get common tools and workflows to work.

~~~
creshal
One of my users is using fish in an otherwise zsh-only environment, so far
we've only ran into problems once: virtualenv's activate script needs to be
shell-specific to muck around with env variables. Every other tooling we use
for webdev (npm, bower, whatever the kids are using now to pretend make
doesn't exist, …) runs without problem.

~~~
dalore
There is activate.fish provided by virtualenv. In case you didn't already know
(you didn't menation, thought it might be good to let others know if they see
this).

~~~
StavrosK
I use virtualfish, which is even better:

[https://github.com/adambrenecki/virtualfish](https://github.com/adambrenecki/virtualfish)

------
rhinoceraptor
I tried fish, but their vi line editor mode was a bit broken, so I tried to
rebind some keys, which was also broken.

I really dislike the anti-customization bent they have. It has 'sensible
defaults' but it is extremely painful or impossible to change them. I went
back to ZSH.

~~~
ultramancool
Yeah, I found a lot of the default configuration was confusing or unexpected
and then I found ohmyzsh and switched, it is so much nicer by default (I just
switch the theme to gentoo and all is good). The only thing I don't like about
ohmyzsh is the constant updates.

~~~
rhinoceraptor
I switched to antigen from ohmyzsh, I like it a lot.

------
komp
I used to use Fish but switched over to zsh due to the better support. It'd be
great to see Fish get more popular in the open-source community as I'd love to
give it another try.

------
Quequau
One of the things that I found really helpful for using Fish is importing all
the variables and aliases in bash_profile into Fish the config. This way when
I go through install processes that automatically append configurations to
bash_profile they get carried over to my Fish config painlessly.

Here's a recent blog post describing this strategy:

[https://blog.gospodarets.com/fish-shell-the-missing-
config](https://blog.gospodarets.com/fish-shell-the-missing-config)

------
stewartbutler
If I were using a 'real' shell, I'd probably be using Fish. However, since I
pretty much live in emacs, I spent the time to configure eshell to do what I
need and it works well enough, and gives me the ability to manipulate the
results as text. There are a few funny edge cases and quirks to get used to,
but they are few enough that it is a viable option for my purposes.

------
bucaran
Fish sensible defaults can go a long way and the scripting language is fairly
easy to pick up. If you want more that what's provided out of the box, then
check out Fisherman: [http://fisherman.sh](http://fisherman.sh)

~~~
pesnk
I use fish for a year now. I was actually gonna give a try on fisherman. But I
found out that oh-my-fish (which I currently use) repos are down because of
one guy that maintain the fisherman and is abusing of DMCA all over oh-my-fish
repositories. [https://github.com/oh-my-fish/oh-my-
fish](https://github.com/oh-my-fish/oh-my-fish).

Not gonna give a try on a project that is primary maintained for bad people
with bad intentions.

~~~
anbotero
It seems interesting the 'wa' repositories now redirect to a Fishery account
that does, guess what? fish plugins. I’m not defending oh-my-fish, because it
looks like they didn’t give attribution, but it’s all too convenient.

In any case, it’s clear this is just a stunt to open the path for Fisherman to
become the de facto framework. Hopefully no one will really use them, but I
know some people will.

------
bucaran
Tackle/Tacklebox is rarely updated and still has open issues from up to 2
years ago.

Fisherman supports Tackle modules and functions, so if you are using Tackle,
you can migrate to Fisherman without any hassle and still reuse and enjoy
their plugins.

\+ [http://fisherman.sh](http://fisherman.sh)

~~~
justinmayer
Wait... what? This is just rude, not to mention patently untrue. My last
commit to Tackle was 8 hours ago. Why do you feel the need to denigrate
someone else's work? No wonder there are multiple comments in this thread that
refer to your unsavory reputation.

------
bucaran
Tackle/Tacklebox is rarely updated and still has open issues from up to 2
years ago.

Fisherman supports Tackle modules and functions, so if you are using Tackle,
you can migrate to Fisherman without any hassle and still reuse and enjoy
their plugins.

\+ [http://fisherman.sh](http://fisherman.sh)

~~~
SnowLprd
You have sunk to a new low, copy-pasting this same falsehood. The other
comments here that speak of your past misdeeds are now all the more clear.

~~~
bucaran
2-year old issue proof:

•
[https://github.com/justinmayer/tackle/issues/3](https://github.com/justinmayer/tackle/issues/3)

Tackle support for "modules" and "function" snippets in Fisherman proof:

•
[https://github.com/fisherman/fisherman/blob/master/functions...](https://github.com/fisherman/fisherman/blob/master/functions/__fisher_plugin_walk.fish#L2)

⁣⁣

I exhort you to demonstrate my comment was false.

⁣

 _Bonus Points_ ⁣⁣

PRs are ignored for months:

•
[https://github.com/justinmayer/tackle/pull/16](https://github.com/justinmayer/tackle/pull/16)

Issues are left unanswered for months:

•
[https://github.com/justinmayer/tackle/issues/14](https://github.com/justinmayer/tackle/issues/14)

⁣

All I am saying is, if _you_ need first-class support for your fisheries,
Fisherman is the man for the job, not Tackle. But hey, Fish is great out of
the box and you don't really need anything to get up and running :)

~~~
justinmayer
Hehe... Okay, buddy. Want proof? That "issue", which is merely a suggested
adoption of someone else's function, isn't even 18 months old.

You are unnecessarily hostile and misrepresent facts. As other commenters here
have already noted, you clearly cannot be trusted.

------
bucaran
That's not true. Oh My Fish! is down because they are still using my old Wahoo
code. I have since moved from that old code base in Fisherman, but they
haven't. Do as you please, but learn your facts.

~~~
fusiongyro
Oh My Fish! is down because you gave Github a DMCA request to take it down.
This taken with your bizarre domain redirect is about the most egregiously bad
behavior I've ever seen in open source.

Watching you two quarrel has left me with such a sour taste in my mouth that
I'm now wondering why my shell needs a plugin manager in the first place.

~~~
bucaran
You are right. Fish works beautifully out of the box and you should not bother
really.

