21 ms·
Fish Shell Design Principles
- threatofrain 11y agoFish 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.
- qznc 11y agoWhat do you mean? The main limitation I know of is tab-completion.
- hundkex 11y agoBass might provide some help with that. https://github.com/edc/bass https://github.com/edc/bass
- cmrx64 11y agoI transitioned from zsh without any hassle, though I did need to port my environment variable config.
- flohofwoe 11y agoFish works great in everyday use, especially the 'smart completion'. I didn't encounter shell scripts that wouldn't work in fish, since they don't run though fish, but sh or bash. Naturally some bash things don't work on the command line (for instance backticks), for these I usually quickly jump into a bash session, run the bash expressions, and then go back to fish.
- oranjax 11y agofish simply replaced `backticks` with (parentheses). give it a go.
- ajsalminen 11y agoBackticks aren't recommended even in POSIX anymore, $() is the newer, preferred alternative.
- 0942v8653 11y agoHuh? Does sh have "$()"? I thought we had to use backticks for POSIX-only environments.
- cmrx64 11y agoYes, POSIX sh has $(): 2.6.3 Command Substitution (http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu...)
- jon-wood 11y agoI spent a long time feeling that way too, and then took the job one day. Turns out its generally fine - I had a bit of pain getting NVM to work, but otherwise its been really smooth.
- bucaran 11y agoTry it with Bass, it works fine for me. Although, recently I switched to tj/n, which has a nicer CLI in my opinion. + https://github.com/edc/bass#example https://github.com/edc/bass#example
- creshal 11y agoOne 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.
- justinmayer 11y agoMy Tacklebox/Tackle projects bundle Virtualfish, which addresses this very elegantly. More info: https://hackercodex.com/guide/tacklebox-fish-shell/ https://hackercodex.com/guide/tacklebox-fish-shell/
- dalore 11y agoThere 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 11y agoI use virtualfish, which is even better: https://github.com/adambrenecki/virtualfish https://github.com/adambrenecki/virtualfish
- ufo 11y ago99% of shell scripts are just executables that have a shebang line at the top. As a rule of thumb, the only time when using a posix-compatible shell as your interactive shell matters is when you are expected to "source" or "eval" a sh script that is generated by some other program (as the virtualenv example)
- spinningarrow 11y agoJust take the plunge! Support for popular tools is better than it used to be. I've been using it for a few years now and it's been quite a while since I faced any sort of issues. It's subjective of course, based on what your workflows are and how much bash-fu they involve.
- bucaran 11y agoFish 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
- mjs 11y agoFisherman has a lovely website and even docs, but what does it actually do? The list of plugins is not very impressive, many of which seem to be placeholders that don't do anything at all (see the "plugins" with numeric names): https://github.com/fishery https://github.com/fishery
- bucaran 11y agoThe Fishery was introduced very recently and Fisherman has like a month too. That should explain why there aren't a millions plugins there :) As for "What does it actually do?", it is a "plugin / snippet" manager, it says right there on the page. But don't take it from me, hear it from the lovely folks of LINUX Unplugged: * https://www.youtube.com/watch?v=tplxnE2ljWI&t=21m54s https://www.youtube.com/watch?v=tplxnE2ljWI&t=21m54s
- pesnk 11y agoI 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 11y agoIt 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.
- komp 11y agoI 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.
- yonrg 11y ago""" [...] 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 11y agoI 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 11y ago> It's geared at the pragmatic user who wants to get work done. So the person who would just use preinstalled bash then
- marrs 11y agoSurely the pragmatic user who wants to get stuff done is the power user. You take the effort to learn the advanced stuff because you want the shell to get out of your way.
- replax 11y agoYou might have misunderstood the sentence you are quoting. From my point of view, the quote and what you are saying are not different goals, just that your way of achieving that goal has to involve configuration and the quote's goal tries to do away with it. I completely agree with the quote, a program should do what the user wants it to do, without any config. However that is unfortunately not yet possible, as you are saying, but is certainly the desired end goal. If the program does what you want, >always<, then no configuration is needed because it could only defer from that goal. Therefore I believe the quote is a very good one, albeit somewhat philosophical.
- Quequau 11y agoOne 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
- Lazare 11y agoIncidentally, 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 11y agoI'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 11y agoSame 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 11y agoDevil'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 11y agoThat'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.
- rhinoceraptor 11y agoI 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 11y agoYeah, 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 11y agoI switched to antigen from ohmyzsh, I like it a lot.
- kiproping 11y agoIt 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.
- abrowne 11y agoEven '&&' to join two commands (fish uses '; and').
- anbotero 11y agoWhat happens if you enclose 'HEAD@{1}' in single quotes?
- ufo 11y agoShould 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}"
- andrelaszlo 11y agoFor me, it was the "Fish breaks flow control in child processes" bug/feature, https://github.com/fish-shell/fish-shell/issues/2315 https://github.com/fish-shell/fish-shell/issues/2315 Super annoying, to me at least.
- marrs 11y agoEvery 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.
- sdegutis 11y agoEvery now and again, I give Fish a try, and I'm definitely wow'd (usually by the automatic colors), but not enough to completely ditch Eshell.
- deleted 11y ago[deleted]
- deleted 11y ago[deleted]
- ufo 11y agoIf you really really hate cursor keys there are keybindings you can use instead. Don't remember what they are though because I personally don't mind using the cursor keys. (I do know that they add vim keybindings in the latest version, which was a commonly requested feature)
- makecheck 11y agoNot only are special characters useful but some shells went to the other extreme. In the early days of the Mac, the system’s default keybindings made it so easy to type “weird” characters that the MPW Shell had many more special characters than shells on other platforms at the time, leading to creative uses of ƒ and ∂, etc. Now that Unicode support is becoming more common, perhaps some bold shells will bravely adopt new special characters.
- justinmayer 11y agoAs 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/sdl/sdl.fish https://github.com/justinmayer/tackle/blob/master/plugins/sd... 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. (^_^)
- bucaran 11y agoThat'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.
- oranjax 11y agoDo as you please, but learn your free-software licenses. https://opensource.org/licenses/MIT https://opensource.org/licenses/MIT Who actually submitted each line of code is visible in the commit history. The copyright is attributed to the Oh-My-Fish! group as a whole. You pushed the Wahoo code and you were part of the group until you started trolling, moving and deleting the repository, creating fake users, sending annoying DMCA claims, etc etc... Much of the Wahoo code was removed, changed, or about to be phased out. If it was any good you wouldn't start your new framework from scratch. And if attribution was really all you wanted, you could have simply asked for it. Why would anyone deny that from you? Anyway, I'm tired of chasing you to put a counter to your spread of skewed truth and your generous omission of facts.
- bucaran 11y agoAll rubbish. 1 year late to the party and you talk like you knew what happened. By the way, are you chasing me? This is creepy.
- fusiongyro 11y agoOh 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 11y agoYou are right. Fish works beautifully out of the box and you should not bother really.
- 11y ago
- carlleen 11y agoPeople migrate to Fish don't wait until you are too old and weak to gather courage to rewrite your configuration. One thing I love about Fish is the community is just wonderful. Lots of folks hang out here: https://gitter.im/fish-shell/fish-shell https://gitter.im/fish-shell/fish-shell and there are a lot of interesting projects going on too.
- user_no_2 11y agoPunctuation would be nice. I had to read the sentence so many times to get it.
- stewartbutler 11y agoIf 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 11y agoAnd to make Fish even more awesome than it already is, check out Fisherman. • Home Page (http://fisherman.sh http://fisherman.sh) • Why Fisherman? (http://why.fisherman.sh http://why.fisherman.sh) • LINUX Unplugged (https://www.youtube.com/watch?v=tplxnE2ljWI&t=21m54s https://www.youtube.com/watch?v=tplxnE2ljWI&t=21m54s)
- bucaran 11y agoTackle/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 11y agoWait... 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 11y agoI am not denigrating Tackle, in fact, I support it in Fisherman! ;) When was the last time you improved the documentation or added a new plugin, or answered to issues...? Now, on to the facts. 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/__fisher_plugin_walk.fish#L2 https://github.com/fisherman/fisherman/blob/master/functions... Also 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.
- dang 11y agoWe detached this subthread from https://news.ycombinator.com/item?id=11111846 https://news.ycombinator.com/item?id=11111846 and marked it off-topic.
- bucaran 11y ago Fish works great out of the box and you can go a long way with its default configuration.
- bucaran 11y agoTackle/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 11y agoYou 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 11y ago2-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/__fisher_plugin_walk.fish#L2 https://github.com/fisherman/fisherman/blob/master/functions... 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 11y agoHehe... 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.
- dang 11y agoWe detached this subthread from https://news.ycombinator.com/item?id=11111884 https://news.ycombinator.com/item?id=11111884 and marked it off-topic.
- bucaran 11y agoTackle/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
- kamiroquai 11y ago https://news.ycombinator.com/item?id=11102941 https://news.ycombinator.com/item?id=11102941
- kamiroquai 11y ago
- clavicordia 11y agoFISH ROCKS!