15 ms·
Fish: A user-friendly command line shell for macOS, Linux, etc
- Afforess 9y agoI love fish shell, I love the autocomplete, but I've been forced to switch back to bash lately, because fish syntax is just different enough from bash-isms to break too much scripts / tools / commands. I know I could just invoke bash, but prefixing commands with "bash -c '" is tiring and papercuts are why I switched to fish in the first place. I wish bash had a sane auto-complete prediction like fish.
- mixmastamyk 9y agoFish doesn’t break scripts, they use whatever interpreter you specified when you wrote them. I use fish interactively and write very simple scripts in bash and the more complex in Python.
- Skunkleton 9y agoMaybe op is sourcing said scripts instead of executing them?
- deleted 9y ago[deleted]
- iheredia 9y ago+1 I gave it a try a couple years ago and I remember having issues with RVM (Ruby Version Manager). Hope is fixed though
- kilovoltaire 9y agoIt is fixed, RVM supports Fish now - https://rvm.io/integration/fish https://rvm.io/integration/fish
- sigjuice 9y agoYour scripts should begin with #!/bin/bash or similar so you can execute them from anywhere. Are there bash built-in commands or functions that you need while in fish?
- racer-v 9y agoThere's some initial pain in retrofitting your Bash startup to work under fish, but after that it's worth it. For example I had to search for how to use ssh-agent with fish, and now it works great: https://github.com/st3fan/dotfiles/blob/master/fish/ssh.fish https://github.com/st3fan/dotfiles/blob/master/fish/ssh.fish You need to learn a few idioms like: replace $[1+1] with (math "1+1"); replace > for f in $(ls); do echo $f; done with > for f in (ls); echo $f; end I should start a Rosetta Stone of Bashisms to Fishisms - I'd be interested if anyone has got Android Open Source build environment / lunch working.
- tarboreus 9y agoYou might want to try (or revisit) zsh, which is closer to bash but has some nice features. Use oh-my-zsh for some nice theming and extra features. https://github.com/robbyrussell/oh-my-zsh https://github.com/robbyrussell/oh-my-zsh
- phillco 9y agopbpaste | bash -c? :D
- cup-of-tea 9y agobash uses readline to handle user input and in readline the completion function is a parameter. Could a more clever completion function be substituted to get the same behaviour with bash?
- clux 9y agoYou can get it much of the way there by tweaking `~/.inputrc` "\e[A": history-search-backward # Up key "\e[B": history-search-forward # Down key. Allows you to get press up while you have `ssh 10.2` in the terminal to cycle through ips matching, etc. It won't display like in fish before pressing it, but I find that's a reasonable tradeoff.
- deleted 9y ago[deleted]
- chubot 9y agoFWIW I'm working on a bash-compatible shell: http://www.oilshell.org/blog/ http://www.oilshell.org/blog/ If nothing else, I have thousands of lines of my own shell scripts that I don't care to move to a different shell syntax that's not obviously better :) There are lots of posts on the blog about it, but here is an example: "OSH Runs Real Shell Programs" - http://www.oilshell.org/blog/2017/07/02.html http://www.oilshell.org/blog/2017/07/02.html Another comment: https://news.ycombinator.com/item?id=15916470 https://news.ycombinator.com/item?id=15916470 However one thing is that it's not yet a good interactive shell. It's mainly treating bash as a programming language. However I think that is a good foundation for an interactive shell. Some details here: https://www.reddit.com/r/commandline/comments/7c3f9f/osh_02_parsing_one_million_lines_of_shell/dposm7r/ https://www.reddit.com/r/commandline/comments/7c3f9f/osh_02_...
- pbackx 9y agoI've had success with bass[1]. Typically, I use it when some kind of tool requires sourcing bash scripts. [1] https://github.com/edc/bass https://github.com/edc/bass
- dllu 9y agoFish is really great for using it in your terminal. Autocompletion, fuzzy matching, and so on, are amazing. Unfortunately, although it is fully scriptable, writing scripts in Fish feels a little clunky at times. For example, I wanted to test if $dest exists, and if not, whether $src is newer than $dest. Since there are no && or ||, parentheses are used for command substitution, and the Fish version of "test" has no -nt to check if a file is newer, I have to do this: if begin; not command test -f $dest; end; or begin; command test $src -nt $dest; end # do something end
- EpicEng 9y agoYeah, wow... I would have to spend at least 15 minutes figuring out what that does.
- zackelan 9y agoI'm a very happy fish user but this is one of my pain points as well. If you want to define a function, the syntax is light-years ahead of bash, including named arguments (and closures!), but it took a fair bit of googling and eyebrow-wrinkling before I could figure out the way just to set a default argument for that function. What I ended up with was (for a shortcut for generating a password on the command line): function pw --argument length test -z $length; and set length 16 python3.6 -c "import secrets; print(secrets.token_urlsafe($length))" end
- yorwba 9y agoWhen I last needed something similar, I wrote it like not command test -f $dest if or command test $src -nt $dest # do something end It saves on the begin ... end, but is confusing to look at. Nested conditions are really not very ergonomic in fish.
- ridiculous_fish 9y agoIt's true fish is generally more verbose, as it has less magical syntax. fish is also missing some niceties like `set -e` and `set -x` which we would like to add, but the main focus is interactive use. Happily the begin/ends in ifs are no longer necessary: if not command test -f $dest or command test $src -nt $dest # stuff end In this particular case, you can simplify it further with test's operators: if command [ ! -f $dest -o $src -nt $dest ] #stuff end which is comparable in length to bash, though other cases will certainly be longer.
- eltoozero 9y agoI’ve been enjoying fish for the handy tab complete of command line options, the interactive history, and it’s pretty. I’m certainly guilty of finding one-liners online which frequently fail in fish, which puts me in the position of either actually learning what the terse statement actually does and re-implementing it in the fish “c-like” syntax, or I just drop into bash then get on with my business. Really happy with it, but I know I get sideways stares from graybeards and gurus who consider it the small-batch, fixed-gear, “Crocs” of shells.
- mocko 9y agoHappy user here. If you spend a lot of time in the shell fish is totally worth checking out. Good points: * Fish's completion sure saves a lot of typing * `brew install fish` on osx * Config in ~/.config/ rather than cluttering up the root of your homedir * Can change many settings without needing to edit config directly - eg. `set -U fish_user_paths $fish_user_paths ~/path/name` Bad / not intended for: * It's not for scripting. Just use bash for that. * I've found appending to env vars to be fiddly. Maybe I'm doing it wrong * pyvenv's bin/activate.fish was broken for a long time (not fish's fault!)
- mistersys 9y agoJust curious, since their website pretty clearly points out "sane scripting" as a high point, what makes it bad for scripting from your perspective?
- oscilloscope 9y agoBash scripts are way more portable. But for little scripts that only I will run on my computer, Fish is great.
- dgsb 9y agoBash scripts are also much more brittle. I don't do bash scripting at all anymore. I fish for personal/usage or perl/python for shared scripts.
- majewsky 9y agoCorrection: Most bash scripts are brittle. You can write rock-solid bash scripts if you know what you're doing. For example, Arch Linux is an entire distribution built mostly on bash scripts. Of course, if your scripts only run on your own machine (which is a huge if), then fish is probably better.
- dgsb 9y ago
- cat199 9y ago1) web based configuration? really? 2) list.reverse(macOS, Linux, and the rest of the family)
- djsumdog 9y agoThat is the one thing I really didn't like about Fish; that and how the help screens use to launch in a web browser. But once you get past the initial configuration, you never use that stuff again. Despite that fault, I still love Fish shell.
- ridiculous_fish 9y ago`help` opens in the browser, but fish also has excellent man pages for all of its commands.
- alphaalpha101 9y agoAs much as I hate HTML documentation, at least it's not info.
- tuvistavie 9y agoThe web based configuration is completely optional. Editing dotfiles works just as well. I have been using fish for quite a while but never use the web interface (I didn't even remember it existed)
- djsumdog 9y agoI've been using fish for 3 ~ 4 years and I love it. It's come a long was in its development and it's interesting to watch as so many of the bugs have been resolved. Today's fish is incredibly stable and solid. The history, highlighting and completion are well beyond what I've seen in other shells (at least not without adding additional plugins). I still write scripts in bash for compatibility (when I have to; I try to use Python whenever it's an option), but for my interactive shell, fish is really amazing and I'd hate to go back to anything else.
- kmm 9y agoI've been using fish for a few years now, and it has made bash feel not just outdated, but completely obsolete. I am at loss for why it hasn't taken the entire world by storm.
- charlescearl 9y agoFish is nice and I eventually learned to accept the scripting. BUT if it is the shell for the ‘90s what is the 21st century shell?
- pzone 9y agoIt's a joke. The implication is that Bash was already outdated in the 90s, so it's long past time for something new.
- charlescearl 9y agoI know, just trying to be too pithy :) But will seriously look at some of the other shells mentioned. I miss scsh.
- interfixus 9y agoFish with a plugin for ironic comprehension.
- megaman22 9y agoGah, probably node...
- Groxx 9y agoTermKit possibly fits this: https://acko.net/blog/on-termkit/ https://acko.net/blog/on-termkit/ I'm not so sold on some of the tokenizing / etc styling, but `cat image.jpg` -> see an image? yes please. Alternatively, I keep checking in on Xiki periodically, since it has some extremely interesting features: http://xiki.org/ http://xiki.org/
- thanatos_dem 9y agoUnfortunately TermKit is effectively dead, with the last commit being almost 6 years ago - https://github.com/unconed/TermKit https://github.com/unconed/TermKit
- 9y ago
- baby 9y agoI've never tried it and spent the last few years relying on oh-my-zsh, is it worth trying to switch?
- burke 9y agoI used fish twice for about a year each time, but I keep switching back to zsh, because: * The main things I like about fish are predictive history completion and syntax highlighting, both of which work about the same with a pair of zsh plugins; * The syntax occupies what is, for me, an awkward middle ground: it's a bit better than POSIX syntax if POSIX shells didn't exist, but not enough better that I care to juggle the two syntaxes; * I don't like that fish tries to be "helpful" in certain cases such as lying to you about the delimeter actually used by $PATH. I have a couple of specific gripes about the syntax, which aren't really inherent issues so much as unimplemented features. I think if I was going to deviate from a POSIX shell, the alternative would have to be more better than fish to be worth it.
- davemp 9y agoOut of curiosity, what use case do you have that makes a POSIX shell a big deal? I’ve never had issues as a somewhat heavy user.
- alphaalpha101 9y agoIt's nice to be able to simply copy-paste commands from the internet sometimes. (obligatory: yes you have to be careful when you do.)
- burke 9y agoThere's nothing major. I maintain a set of POSIX and fish scripts as part of my job and, given that I have to know both relatively well, I find I end up preferring the on-average-slightly-more-terse POSIX syntax. One thing that can be particularly annoying is that it seems to be impossible in fish to evaluate a command in a subshell and embed its output into a string without assigning it to a variable first. ARGV handling is a little weird too. I understand the impulse to get rid of $1, $2, $3, $*, $@, $#, etc., but it ends up just requiring different gymnastics, like writing `set -e argv[1]` instead of `shift.
- zeveb 9y ago> Out of curiosity, what use case do you have that makes a POSIX shell a big deal? Running on a POSIX system, there are decades' worth of shell snippets out there which don't work with fish, but do with sh, ksh, bash & zsh. Fish is just gratuitously incompatible. Having fish-users on a team is a pain, because they'll write everything in fish and either not bother producing sh equivalents, or produce insufficiently-tested sh equivalents. It's just a lot of pain and bother, and what's the benefit? Zsh does everything fish does and more, so why not just use it? Edit: I just wish that the original fish developers had chosen to implement all their cool features and be sh-compatible, or at the very least had exercised some wisdom in where they chose to break compatibility. Instead, it very much feels like a 22-year-old's project: full of ideas, some good & some bad, and needlessly without respect for the past. I've no problem with rejecting the past when the past is broken (and sh is broken in places); my problem is with the equivalent of saying, 'hey, English spelling is terrible, soh Aiv dəseidid tū dəvelup mai ohn.'
- tuvistavie 9y agoIt is also worth noting that the ecosystem around fish is quite developed, making it easy to get easy integration and completions for most well-known tools. oh-my-fish [1] plugins is a good place to see (part of) what is available [1]: https://github.com/oh-my-fish https://github.com/oh-my-fish
- ridiculous_fish 9y agoHey all, one of the fish devs here. It's awesome to see all of the comments and happy users. We are in the process of scoping a major release (fish 3.0) that can include major syntactic changes. If there's an aspect of fish you would like to see changed, now is a great time! Of course we'll read the comments here, and our issues page [1] is where discussion happens. We're also welcoming new contributors. It's easy to get started writing completions or with the issues labelled "easy-pick". The core code base is reasonably modern C++ too. http://github.com/fish-shell/fish-shell/issues/ http://github.com/fish-shell/fish-shell/issues/
- deleted 9y ago[deleted]
- techdragon 9y agoI see that https://github.com/fish-shell/fish-shell/issues/3341 https://github.com/fish-shell/fish-shell/issues/3341 is scheduled for 3.0. This is also marked as the fix for the broken/invalid YAML format that is used for storing the shell history https://github.com/fish-shell/fish-shell/issues/2258 https://github.com/fish-shell/fish-shell/issues/2258 I implore you to NOT use JSON or ProtocolBuffers, neither are appropriate formats for configuring my shell, or storing long sets of textual data. Protocol Buffers is hardly the kind of format I want to parse and read my history in, and JSON is a less than ideal configuration format for many reasons. https://github.com/vstakhov/libucl https://github.com/vstakhov/libucl UCL (Universal Configuration Language) is a much more appropriate format for configuring programs than JSON, and is has been accepted as standard for use configuring all tools included in the FreeBSD operating system. I also suggest you consider using a different language to store shell history, since shell history and shell configuration are two very different jobs with different goals and trade offs. I personally would suggest a simple safe format like TOML https://github.com/toml-lang/toml https://github.com/toml-lang/toml for storing the history. But If you do want a single format for both configuration and history, I would implore you to pick TOML not JSON or Protocol Buffers.
- ridiculous_fish 9y agoThanks for writing that up, I linked to it from the issue. FWIW I agree with you that shell history should be a simple format, and even ad-hoc parseable via Unix tools. zsh uses simple : and ; delimiters. JSON is more complex, and binary formats like protobuf are way out.
- qaute 9y agoRelated: xonsh (http://xonsh.org http://xonsh.org) It's a Python-based shell that attempts to be somewhat bash-compatible (for ease of use over, e.g., IPython). Instead of making a new scripting language (fish), go all in. Pros: scripting is amazing. ( while True: ls ~ ) Cons: can be a bit slow (because Python interpreter).
- 0xmohit 9y ago5 year old feature request [0]. [0] https://github.com/fish-shell/fish-shell/issues/438 https://github.com/fish-shell/fish-shell/issues/438
- techdragon 9y agoI just read that entire issue and it looked dire for a while, hopefully it is resolved properly in https://github.com/fish-shell/fish-shell/pull/4442 https://github.com/fish-shell/fish-shell/pull/4442
- hsson 9y agoI definitely prefer zsh. I just feel like Fish tries too hard and it's just awkward to switch between fish and bash when frequently switching between different machines.
- kharms 9y agoLoved it a few years ago, stopped using it when I started using conda and it didn’t support switching into those environments. I’ll try again hopefully that’s fixed.
- crispinb 9y agoThe great thing about fish for me is that comes so nicely set up on first install that, a few path additions aside, I don’t have to mess with it. Any time spent on shell configuration is time wasted from my perspective. This in turn means I’m willing to install it with no hesitation in all my local and remote logins, so I have a uniform simple setup everywhere.
- itsjloh 9y agoMy biggest gripe is fish (I think its Fish?) trying to do DNS lookups when I hit `ssh user@hosting-<tab><tab>` Is there a way to disable this?
- canjobear 9y agoI've used fish as my shell for over five years. Thanks to the developers! One issue is the behavior of globs. I often want to do "scp host:directory/* ." but you can't do that in fish, so I drop to bash. That's pretty much all I drop to bash for.
- rufugee 9y agoscp host:directory/\* .
- jhasse 9y agoAlso possible: scp 'host:directory/*' .
- deleted 9y ago[deleted]
- faho 9y agoNote that the reason bash works here is actually a bit ugly. Like fish, it'll interpret an unquoted asterisk (sorry HN formatting) as the glob character. So it tries to match pathnames to `host:directory/`. Only the default bash behavior (if "nullglob" and "failglob" aren't set) is to pass the literal glob expression if no match could be found. So once you `mkdir host:directory; touch host:directory/file` (which you can do - this is unix, so almost all pathnames are allowed), this will be broken. This means you _should quote the token_ in bash, which is exactly what you should do in fish. Note: This is also why you might see code like the following in bash: for file in *; do if test -e "$file" See http://mywiki.wooledge.org/BashFAQ/004 http://mywiki.wooledge.org/BashFAQ/004 and http://mywiki.wooledge.org/glob#nullglob http://mywiki.wooledge.org/glob#nullglob for more info.
- anonfunction 9y agoIf you like fish but miss the plugin ecosystem of zsh you might be interested in the fish-shell plugin manager, fisherman. I've really been enjoying fish with z and fzf. https://github.com/fisherman/fisherman https://github.com/fisherman/fisherman
- unlmtd1 9y agoThe redoxOSers are busy breaking the stupid parts of POSIX, and their shell, ion , is slowly coming in, finally, as the 'shell of the 00's'.
- xfr 9y agoCtrl-R and Ctrl-S please. Using the arrow keys for searching through history quickly (i.e. without leaving the home row) sucks.
- mixmastamyk 9y agoYou can bind and rebind most keys. Are those two not possible?
- realusername 9y ago+1. If some developer reads this, Ctrl+R is the only missing thing I can't imitate from bash.
- fallensatan 9y agoI know this might not be what you'd want, but I'm doing this with fzf[0]. I have something like this as an alias: eval (cat ~/.local/share/fish/fish_history | grep 'cmd:' | cut -c8- | fzf --tac) and then I simply bound it with `\cr`. It doesn't exactly replace Ctrl-R functionality but it suits my need. [0] https://github.com/junegunn/fzf https://github.com/junegunn/fzf
- aequitas 9y agoI've been quiet happy with https://github.com/junegunn/fzf/wiki/Examples-(fish) https://github.com/junegunn/fzf/wiki/Examples-(fish) as a ctrl-r replacement for fish. I would love this included natively in fish though so I won't have to manage remote shell configurations.
- dri_ft 9y agoIt's not the same as ctrl-R/ctrl-S, but you can use ctrl-P/ctrl-N to scroll history like with the arrows without leaving the home row.
- sarif 9y agoyou dont really need Ctrl-R in fish. Just type the command you are searching for and hit the up arrow key. Same effect
- exabrial 9y agoWow! This is great! Wait... Is whitespace significant?
- AnthonBerg 9y agoNo, not to my knowledge! It does autoindent things for you when you’re editing multiline functions inline, but whitespace is fortunately not significant.
- shmerl 9y agoGreat! It's one of the things that irritates me in Python (whitespace used as scope delimiter).
- AnthonBerg 9y agoI'd go so far as state that I cannot fathom the decision to assign deep semantic meaning to a set of invisible symbols.
- themistocle 9y agoLove fish, especially because of the easy configuration and out of the box features. No need for complicated frameworks or curated dotfiles. There are two syntax changes I’d love to see: 1. Support for last command by !!, as in `sudo !!`. 2. Ability to search history from a partial command like `git checkout`, where up arrow would step backward from the present. I wish all my tools were as friendly as fish!
- faho 9y ago>2. Ability to search history from a partial command like `git checkout`, where up arrow would step backward from the present. We have that feature, and it's enabled by default. Just type the partial commandline and press up-arrow. Or do you mean something slightly different?
- themistocle 9y agoThat's true. Sorry for my poorly-worded English. For a small example: $ ls -la foo $ ls -la bar $ ls -la / When I type `ls -l` and hit the up arrow, my first result is `ls -la bar` not `ls -la /`. This is a small problem but sometimes annoying, especially after using other shells that work differently.
- faho 9y agoIn this case, what most likely happens is that the first result is offered as the suggestion - i.e. the greyed-out part in the commandline. To accept that, press right-arrow (with the default bindings, of course).
- themistocle 9y agoThanks for the suggestion.
- lvh 9y agoI use fish as my primary shell. I've ran into a few issues where it broke existing fish scripts, and, uh, let's just say some of the developers (not 'ridiculous_fish) were less than stellar in their response. (I get it. It's open source. You don't owe anyone anything: but you also don't have to be a jerk about it, and I also don't owe you using your software.) My original reason for using fish was onboarding junior engineers. I had a pretty fancy zsh/emacs setup, and they'd ask me how to make their shell do that (reminder: on macOS you get bash3.2 by default!). So I switched to fish/spacemacs, so the answer isn't "uh sure you can rsync 50MB of accrued elisp". Result: I have a nice zplug[0] setup now: > cat /usr/local/opt/zplug/packages.zsh zplug "zsh-users/zsh-syntax-highlighting" zplug "zsh-users/zsh-history-substring-search" #zplug "zsh-users/zsh-autosuggestions" zplug "zsh-users/zsh-completions" #zplug "plugins/git", from:oh-my-zsh #zplug "plugins/github", from:oh-my-zsh #zplug "plugins/fossil", from:oh-my-zsh #zplug "plugins/docker", from:oh-my-zsh #zplug "plugins/docker-compose", from:oh-my-zsh #zplug "plugins/python", from:oh-my-zsh #zplug "plugins/pip", from:oh-my-zsh zplug "plugins/lein", from:oh-my-zsh #zplug "plugins/autojump", from:oh-my-zsh #zplug "plugins/command-not-found", from:oh-my-zsh #zplug "plugins/gpg-agent", from:oh-my-zsh #zplug "plugins/ssh-agent", from:oh-my-zsh #zplug "plugins/thefuck", from:oh-my-zsh #zplug "plugins/aws", from:oh-my-zsh #zplug "plugins/osx", from:oh-my-zsh #zplug "plugins/battery", from:oh-my-zsh zplug "tweekmonster/nanofish", as:theme Still easy to reproduce. Maybe consider some of those plugins. You don't have to give up being POSIXy. Whether or not that's good or bad, I leave up to you :) (Commented out bits are things I'm playing with: mostly to improve shell startup time.) [0]: https://github.com/zplug/zplug https://github.com/zplug/zplug
- NuSkooler 9y agoFish shell is the first thing I install on my setups. Been using it for a few years now and love - and advocate for - it.
- Exuma 9y agoHow's this compare to oh-my-zsh?
- jonathankoren 9y agoThere’s an oh-my-fish which I believe is directly comparable
- jboynyc 9y agoWhat's nice about Fish is that you don't really have to configure anything to get a lot of interactive goodies.
- k3a 9y agoI tried oh-my-zsh and it was too slow for me for some reason. Returning from a command took a second. Maybe I had some buggy plugin enabled, I don't know. Fish is almost zero configuration and has many useful functions built-in and they are quite fast. Unfortunatelly it doesn't use bash-style syntax like zsh does.
- icemelt8 9y agoI loved fish, but any commands that require Ruby get messed up in Fish
- akavel 9y agoWhenever I'm reading about some alternative shell and thinking about switching, I'm afraid of losing my proficiency in bash. For better or worse, it's the de facto standard in scripting, so I see it as an important skill. How does this work for those of you who risked and switched? Don't you feel some kind of schizophrenia, or accidental cross-polination typos/mistakes? How does it work when you login to some remote machine, do you have the alt. shell installed everywhere?
- okonomiyaki3000 9y agoI have the same problem. I mainly use zsh because it's not drastically different from bash but still offers some useful things that bash lacks. But, honestly, we should just bite the bullet and move on to something better. Yes, we will still need to write scripts in bash from time to time and maybe we'll need to look up a few points that we've forgotten but we won't forget the fundamentals and that's all you really need. Well, that and a web search.
- chubot 9y agoFWIW I'm working on a bash-compatible shell: http://www.oilshell.org/blog/ http://www.oilshell.org/blog/ If nothing else, I have thousands of lines of my own shell scripts that I don't care to move to a different shell syntax that's not obviously better :) I'm designing a new shell language which bash can be auto-converted to. This is a lot of work and the plans might change, but the beginnings of it are here: http://www.oilshell.org/blog/2017/02/05.html http://www.oilshell.org/blog/2017/02/05.html http://www.oilshell.org/blog/2017/02/06.html http://www.oilshell.org/blog/2017/02/06.html
- nowherecat 9y agoI have my dofiles script on github that I run on remote machines I frequently connect to and it installs zsh with my .zshrc, .bashrc in case I switch to bash and all the other dotfiles I got accustomed to. It has been definitely worth the extra trouble. Of course I still use bash for scripting and zsh is not really in the way.
- drinchev 9y ago
- xiaq 9y agoShameless plug: Elvish is another non-POSIX shell aiming at interactive friendliness and saner scripting: https://elvish.io/ https://elvish.io/ Some highlights: * It comes with helpful interactive features, like syntax highlighting and on-the-fly error checking; enhanced history searching with ^R; directory history and a Ranger-inspired "navigation mode" (see homepage for demos). * It supports some advanced (in shell standards) programming concepts, like lambdas, namespaces, nestable maps. It also has some pretty powerful API for interactive features. These two aspects work hand in hand and offers quite some customization possibilities. In fact, one user implemented interactive history expansion (!! !$ !1) himself: http://zzamboni.org/post/bang-bang---shell-shortcuts-in-elvish/; http://zzamboni.org/post/bang-bang---shell-shortcuts-in-elvi... his configuration file is also worth readng: http://zzamboni.org/post/my-elvish-configuration-with-commentary/ http://zzamboni.org/post/my-elvish-configuration-with-commen.... * A lightweight builtin package manager is in the work. * It is written in Go and comes as a statically linked binary. * A native Windows port is under way, in case you care :)
- meken 9y agoAnyone use either eshell or shell mode in emacs? tramp-mode alone has been a huge boost to my overall satisfaction.
- thibran 9y agoI seriously considered using eshell (I love Lisp and Emacs dired-mode), but ended up continuing with Fish. Since I use the non-graphical Emacs (emacs-nox), I can easily start dired-mode in terminal by writing: emacs .
- jboynyc 9y agoI switched to Fish about half a year ago after reading Julia Evans' essay singing its praises: https://jvns.ca/blog/2017/04/23/the-fish-shell-is-awesome/ https://jvns.ca/blog/2017/04/23/the-fish-shell-is-awesome/ I think what convinced me was the last point: if you really can't do what you're trying to do in Fish, firing up sh/csh/ksh/bash/python/xonsh costs virtually no effort.
- zeveb 9y ago> if you really can't do what you're trying to do in Fish, firing up sh/csh/ksh/bash/python/xonsh costs virtually no effort. But of course having to recall how to do something in a POSIX-compatible shell can cost if you've been using a POSIX-incompatible shell for years. Memory and experience do fade over time.
- snvzz 9y agoI remember installing it, typing 'help', having a browser pop up as a consequence, then uninstalling it. Definitely not for me.
- jhasse 9y agoIf you don't want to leave the terminal: set BROWSER lynx help
- fb03 9y agoI have fish installed because for some odd reason, the "SSH link" feature of Midnight Commander didn't work across two servers that we use. After installing it I could use the "Shell Link" feature and it was lovely to be able to exchange files between servers using a 'graphical' terminal. Specially useful with some of our devs which aren't too command line happy.
- dijit 9y agoI've been using fish on my laptop for some time now, it is an interesting project and I use it personally for purely aesthetic reasons. However I have a lot of muscle memory with bash-isms which also work in ZSH. History expansion `!$` for example, is missing. SDTIN redirects as I expect `<<<` etc; are also missing. And to get ^R to work again I had to install fzf. Now, I am fairly certain I'm doing it wrong, but I never found a good place to read how to do it the fish way... If anyone has good replacements for the things I've mentioned I'd be quite keen to hear them.
- fiatjaf 9y agoFish is great both as shell and as a scripting language. I've written both my Trello Exporter CLI tool[0] and the first version of my React/Browserify static site generator[1] on it. [0]: https://github.com/websitesfortrello/trello-exporter https://github.com/websitesfortrello/trello-exporter [1]: https://github.com/fiatjaf/sitio/tree/fish https://github.com/fiatjaf/sitio/tree/fish
- thibran 9y agoThanks for the awesome fish shell – my beloved default. For improvements here are two things I wish where possible in fish: * The ability via a flag to say that a fish-function should not interpret passed function-arguments. This would enable us to pass e.g. URLs to a function without quote them, which is somewhat anointing right now. So this change would be a nice usability improvement. * I would like to be able to write dynamic completions, containing of a key-value pair. The key should be displayed and if the user selects a completion-item, the corresponding value should be passed to a fish-function from which arbitrary actions could be triggered. Maybe supporting JSON input here would be nice too.
- faho 9y ago>* The ability via a flag to say that a fish-function should not interpret passed function-arguments. Note that functions already don't expand the passed arguments. Fish expands them _before_ executing the function, so what you are asking for is a major layering violation. E.g. you can do this: function a b $argv end function b string escape -- $argv end a 'something * with ? loads {} of $pecial char"acters' and the output will come out right. You only need to quote it once. >This would enable us to pass e.g. URLs to a function without quote them I'm assuming what you are asking for isn't _passing_ URLs to functions, but rather _pasting_ URLs into the commandline. In which case fish has a feature I like to call "magic paste". When you paste with an open single quote (`somecommand '`), it'll escape single quotes (and backslashes). So you type the closing single quote and your argument will be passed to the command you are calling as the exact text you pasted. >The key should be displayed and if the user selects a completion-item, the corresponding value should be passed to a fish-function from which arbitrary actions could be triggered. We have "descriptions" for completions, which will be displayed _alongside_ the argument (i.e. the "value"). To generate them dynamically, simply separate them with a tab character (`\t`) from the argument, and separate these pairs with newlines. So printf '%s\t%s\n' 'argument' 'description' 'argument2' 'description2' will be displayed as argument (description) argument2 (description2) We use this to great effect in numerous places. E.g. the git completions will offer commit hashes with the summary line as description, so when I type `git revert <TAB>` I get something like 0a129475 (Replace opts.stdout with opts.to_stdout) I'm not sure I like the idea of hiding the real argument from the user. >Maybe supporting JSON input here would be nice too. The best completions are those that actually call the stuff they are completing (because that makes them really reactive), and not many commandline tools actually generate JSON. Anything in particular you're thinking about here? (And now I'm hoping that HN doesn't hopelessly mangle this comment)
- hecturchi 9y agoI use fish since the first time I tried it some years ago because it upgrades your user experience. I don't understand what the fuss with not being compatible with bash is. Bash scripts run with #!/bin/bash in bash. If you need to write/copy&paste some bash code just jump to a bash shell. In the meantime, fish will save you lots of time on your daily regular shell usage.
- chrisweekly 9y agoI'm happy w/ zsh but have played a bit w/ xonsh (a POSIX-compliant shell w/ deep python integration), because my cousin is a core contributor. Curious if others here have tried xonsh and what your experiences have been. https://xonsh.org https://xonsh.org
- BeetleB 9y agoI use xonsh on my Windows machine at work (too lazy to learn Power Shell). Very happy with it, and a quick way to get a bash type shell on Windows. Not the most stable beast (e.g. yesterday I typed "pwd" and it crashed and returned me to the Windows prompt). I also use it on my home computer (on top of zsh) and am pretty happy with it. It is a bit slower in terms of response time, but that's OK. Most of the problems I had with it have been resolved after filing bug reports. The only annoyance is that when I quit Midnight Commander, I'm back in the directory I started with. But that's a MC problem, and not xonsh. Every shell out there has a special wrapper script to handle MC. I just need to understand the one zsh uses and port it over to xonsh. The two best parts about xonsh: 1. You can use the command line like you would a Python interpreter. Need to do a quick calculation? Just type it in and press Enter. 2. No more obnoxious bash/zsh scripting. Write all your shell scripts in Python!
- wooptoo 9y agoI've started using fish after seeing this post. It's an incredible shell. How come I haven't came across it in the past 10 years? I like the scripting syntax too, so much saner than bash.
- Froyoh 9y agoI'm happy with plain old bash.
- Symmetry 9y agoI like fish enough that I went and added fish support to ROS when I was doing ROS development. I still leave bash as my system shell because scripts. But all my terminals are set to start with fish instead.
- HaoZeke 9y agoZsh or death!
- msluyter 9y agoIt's been a while since I've tried it so perhaps someone can comment whether things have changed or if there was something I missed. When I last tried fish, I liked it but I couldn't get past the lack of ctrl-r (backward history search), which I rely on extensively. I found having to reach over to the up/down arrows too clumsy in comparison. An oh-my-zsh plugin also provides fuzzy searching (history-search-multi-word). Anythiing comparable now in fish land?
- 7scan 9y agoIf you use vi mode then history can be navigated with hjkl.
- qwerty456127 9y agoThis is amazing. IMHO Ubuntu, Elementary, OSX and other OSes that are trying to be practical, easy and pleasurable to use out of the box should offer this by default, together with tldr.sh.