11 ms·
Fish shell 2.0
- krat0sprakhar 13y agoI've been a zsh user for a long time and I have to say that fish is great! Its super fast and starts almost instantaneously. On zsh, I would always use fasd[0] to help jump directories, but on fish I dont feel the need. The auto-completion is just fantastic. If I were you, I'd give it a try just for the awesome tab completions. For the 'oh-my-zsh' lovers out there, there's 'oh-my-fish' as well - https://github.com/bpinto/oh-my-fish https://github.com/bpinto/oh-my-fish [0] - https://github.com/clvv/fasd https://github.com/clvv/fasd
- orta 13y agoAgreed. I've been using fish now as my default shell, it took a bit of time to get used to but it's definitely been worth the time porting my zsh functions/aliases over to fish and adding inline documentation. Very cool.
- easytiger 13y agoi didn't think zsh startup time was an issue $ time zsh -c "echo foo" foo real 0m0.005s user 0m0.002s
- aerique 13y agoMight be an OS X thing. At work on Debian zsh starts up instantly, at home on OS X it takes a good couple of seconds.
- plorkyeran 13y agoIt's an oh-my-zsh thing, mostly. Turns out that running a lot of scripts on startup makes startup take a while.
- fusiongyro 13y agoMight want to check this out: https://news.ycombinator.com/item?id=3880280 https://news.ycombinator.com/item?id=3880280 path_helper turned out to be boning me pretty hard at home, these instructions were very helpful.
- donri 13y agoI think `-c` skips loading configuration. Launching a prompt will be much slower. In fish almost everything is a function and functions are loaded lazily.
- liotier 13y agoCompletion better than zsh ? Really ?
- aerique 13y agoI'm playing around with fish since a couple of minutes and one zsh completion thing I am missing is "fuzzy" completion. In zsh with the following files in a directory: log-20120103 log-20120104 log-20120503 log-20120603 log-20120604 I can do: "$ less 603<tab>" And it will complete to: "$ less log-20120603" I cannot recall whether I had to specifically enable this in zsh.
- jamie_ca 13y agoThe variant that I most miss is the partial completion on paths. With zsh I got into a habit of `cd c/s/b/<tab>` and having it expand to `cd code/sites/blog` so long as the tabbed path is unambiguous.
- oneandoneis2 13y agoGreat.. here I am all ready to try switching to zsh and now here's a new fish.. Which to go for..?
- krat0sprakhar 13y agoIf you're just jumping off bash and don't have a long .zshrc with aliases (which might make the migration a bit painful), then without a doubt try fish!
- porker 13y agoMy situation exactly oneandoneis2! I've used Bash for 12 years, tried zsh for the last few months and not really noticed the difference tbh. Will see if fish gives me an 'aha' moment
- mathrawka 13y agoI used to use fish for a long time... eventually I switched back to zsh because of too many incompatibilities with running shell scripts.
- haarts 13y agoCouldn't you just switch shell in the (presumably) rare case when you want to run a bash shell script?
- omaranto 13y agoNo need, just run bash with the script: bash script-name. Or better yet, start the script with #!/bin/bash
- omaranto 13y agoSeveral purple have mentioned 'incompatibilities' and I don't understand the problem: sure fish syntax is different and fish cannot be used to run a sh script, so just don't try to run sh scripts with fish. Every script I've run across starts with #!/bin/sh and I can use it from fish with no difficulty (it starts up a sh). The only issue I had is that Vim assumes that your shell is sh compatible, so I put a set shell=sh in my .vimrc and now all the shell stuff in vim runs fine. What problems did you mean?
- gdonelli 13y agoNice work. Please consider to code-signing the package so that it works nicely with Mountain Lion gatekeeper.
- duaneb 13y agoIronically I believe Mr Fish is an Apple employee.
- casr 13y agoIf it's useful to anyone else, you can get around the gatekeeper by right clicking the app package and choosing Open. It will then present the option to "Open" as part of the dialogue box (as well as telling you how dangerous it is).
- andy_boot 13y agoCan anyone tell me if fishshell 2.0 works with RVM and Virtualenvwrapper?
- krat0sprakhar 13y agoI have both RVM and Venvwrapper setup in zsh. After installing fish everything worked right out of the box - without making any changes to the config files.
- deleted 13y ago[deleted]
- mjs 13y agoI don't know, but https://github.com/kvs/rubies-fish https://github.com/kvs/rubies-fish does work for switching rubies on a .ruby-version file. It works by getting notification when the PWD environment variable changes, which seems like an elegant way of managing this.
- thinkdo 13y agoI had to install oh-my-fish[0] and enable the RVM plugin to get RVM to work. [0]https://github.com/bpinto/oh-my-fish https://github.com/bpinto/oh-my-fish
- manojlds 13y agoThe author of that could have been more innovative with the name. The word fish gives a lot of room to play :)
- zackkitzmiller 13y agoOut of the box, no. I've since switch to rbenv, which I actually like much better, and https://github.com/adambrenecki/virtualfish https://github.com/adambrenecki/virtualfish is a very nice port of virtualenvwrapper to fish.
- berdario 13y agoI'm writing a clone/rewrite of virtualenvwrapper in pure python, I'll announce it on the fish mailing list, since the main reason I created it is that I felt this pain as a fish user myself
- c-oreills 13y agoAre there still compatibility issues with using fish 2.0 as your default shell? The Arch Wiki [0] advises against it because it's non bash compliant. I'm going to give it a go regardless but wanted to know if there were pitfalls and what people have done to alleviate them. [0] https://wiki.archlinux.org/index.php/Fish#Troubleshooting https://wiki.archlinux.org/index.php/Fish#Troubleshooting
- lunixbochs 13y agoI've been using it comfortably for a while as my primary shell with no issues. Pretty much all scripts I've had to run use a shebang line to manually invoke /bin/sh or /bin/bash which still works fine.
- chalst 13y agoThere are several simplifications of POSIX syntax; the syntax feels a bit like Tcl as a result. The most annoying differences are the missing/changed special variables: POSIX has special $@/$* to return parameters: you have to use arrays for these in fish. POSIX puts exit status in $? and fish in $status; also $$ becomes %self, and there is no convenient way to expand to the PPID. Also annoying is the absence of "||" and "&&" operators.
- jfb 13y agoYeah, it maintains just enough compatibility to be confusing. I'm not impressed; I'd like something more radical.
- jodrellblank 13y agoPowerShell for OS X/Linux? http://sourceforge.net/projects/pash/ http://sourceforge.net/projects/pash/
- oblio 13y agoExcept for the fact that it was last updated in 2008 :(
- rob22 13y agoIts Very Nice shell & better than bash...
- moystard 13y agoLike many, I have switched to zsh a few months back and have enjoyed the experience thanks to Oh-My-Zsh. I will give it a go, but I don't know if I can really appreciate the difference.
- haarts 13y agoI think you will. Perhaps not so much when using oh-my-zsh but when you want to tweak your prompt I find fish's syntax far more sane.
- moystard 13y agoHaving played with it for the last 30 minutes or so, I think I will stick on Fish Shell. Surprised (and amazed) by how simple it was to get started and set up my traditional startup scripts. And the auto-completion is just amazing.
- vtempest 13y agoInteresting idea with potential, but poor implementation. I tried to type sudo apt-get and it didn't even autofill my most used commands. I also use the guake shell client, I would want it integrated in that
- StavrosK 13y agoOf course it autofills your most-used commands. It does it for me, anyway.
- Vieira 13y agoIt also works for some commands even if you never run them before. For instance curl --i<nsecure> (and I never ran curl --insecure). Also pressing tab will display all curl flags starting with i and a one line description from the man page. Pretty neat.
- Vieira 13y agoI'm not sure if this is the problem but maybe running fish_update_completions is worth a try.
- delinka 13y agoAFAIK, it tracks its own history separately from other shells. It's not going to read .bash_history (or whatever) to discover your usage patterns - you'll have to use fish for awhile and build some history.
- ridiculous_fish 13y agoIn fact, fish 2.0 will import from .bash_history if it has no history of its own. https://github.com/fish-shell/fish-shell/issues/66 https://github.com/fish-shell/fish-shell/issues/66
- donri 13y ago2.0 is not in distributions yet, you probably got the version from 2009. Find your distribution here: http://fishshell.com/files/2.0.0/linux/ http://fishshell.com/files/2.0.0/linux/ And as others have also said, fish knows nothing of your bash history. It'll work fine with quake; use chsh to change shell for your user.
- acron0 13y agoWhy is no one putting in any time to replace the Windows shell (cmd.exe)? The stock offering is abysmal and Cygwin isn't much better. We could really use something with a bit of panache like this... Hmmm..
- spindritf 13y agoI'm guessing that people who cared about the terminal, and CLI in general, moved to other OSes a long time ago. And it's not just a glib answer, that's actually why I first gave Linux a real shot as my main system -- to replace Putty with a pretty, transparent terminal window and have all the GNU tools that go with it.
- mutewinter 13y agoI've often wondered that too. Console2[1] is the best alternative I've found for cmd.exe. Mintty[2] is a decent alternative to Cygwin. [1]: http://www.hanselman.com/blog/Console2ABetterWindowsCommandPrompt.aspx http://www.hanselman.com/blog/Console2ABetterWindowsCommandP... [2]: https://code.google.com/p/mintty/ https://code.google.com/p/mintty/
- andrewaylett 13y agoMintty isn't an alternative to Cygwin, it's a part of Cygwin: an alternative to the standard windows terminal that Cygwin used to launch by default. Recent Cygwin installers actually set up Mintty by default. You seem to be confusing terminals (programs that provide a text environment) and shells (usually text-based, often run inside a terminal). Mintty is a terminal. cmd.exe is a shell, but will spawn Windows' own ANSI terminal when asked. Cygwin's bash will also spawn Windows' own terminal when run without one. Fish is a shell, and needs to be run inside a terminal. Console2 is different again. As I understand it, it wraps Windows' terminal, providing some extra features.
- gecko 13y agoWhy does PowerShell not qualify? Or are you merging cmd.exe with the Windows console subsystem?
- adito 13y agoIF YOU READ THIS, YOU MUST TRY fish NOW!!! Really, this 100x better than bash. 1. download and install[0] 2. read the tutorial[1] 3. ... 4. profit [0]: http://fishshell.com/#platform_tabs http://fishshell.com/#platform_tabs [1]: http://fishshell.com/tutorial.html http://fishshell.com/tutorial.html
- netmute 13y agoI've tried fish a few years ago and wasn't all that impressed with the features. That said, the new version is just ace! I gave it 30 minutes and it basically does everything I do with zsh right now. All that with about 5% of the configuration effort I put into zsh. Plus, it's so much faster than zsh. I'll give fish a go as my main shell. Let's see were this goes.
- RBerenguel 13y agoFelt the same. Fish worked out of the box, but left me unimpressed about its abilities compared to zsh (well, I'd give it the same score as to zsh) until I realised I hadn't configured anything beyond generating man-completion files. I'll leave fish lying around so I can alt-tab to it and check it from time to time
- hebz0rl 13y agoI wonder if keychain now works with fish (didn't with the last version) or is there an alternative to get fish working with the ssh-agent?
- SnowLprd 13y agoI've been using fish with ssh-agent for the last year without any problems.
- leejoramo 13y agoHow long does it take for something to show up in brew? I see that Fish has a pull request issued a five hours ago, but I see quite a number of other items have pull requests going back months.
- micampe 13y agoyou can install directly from the pull request, without waiting for it to be merged: https://github.com/mxcl/homebrew/wiki/Tips-N%27-Tricks https://github.com/mxcl/homebrew/wiki/Tips-N%27-Tricks use this URL: https://raw.github.com/ridiculousfish/homebrew/9a481458491b654457707a75d98ad770ad248d88/Library/Formula/fish.rb https://raw.github.com/ridiculousfish/homebrew/9a481458491b6...
- owenjones 13y agoIt was available just now in brew for me.
- SnowLprd 13y agoThat's probably the old 1.23.1 version. Run "brew info fish" and that's most likely what you'll see. Homebrew maintainers, as noted above, have not yet merged the pull request: https://github.com/mxcl/homebrew/pull/19887 https://github.com/mxcl/homebrew/pull/19887
- andrethegiant 13y agoThere's the package fishfish whose version is stable OpenBeta_r2.
- SnowLprd 13y agoThat version is nearly a year old; the fishfish formula was temporary and will be removed from Homebrew as soon as the canonical fish formula has been updated to 2.0. Hopefully the Homebrew maintainers will merge this soon (not sure what the hold-up is): https://github.com/mxcl/homebrew/pull/19887 https://github.com/mxcl/homebrew/pull/19887
- barrkel 13y agoThe documentation needs a lot of work. Every 'help' command I've tried just pops up a web page using xdg-open, which (a) won't work well in a headless SSH session, never mind a plane, and (b) doesn't make it easy to search for specifics. I also don't like the implementation of the prompt text as a function. It's the first thing I wanted to customize, and it looks like I need to copy and paste the existing definition of fish_prompt and hack it into shape. There's no built-in equivalent of \$, so you need to find out if you're root and do it yourself. And the existing check just does it with a string compare of $USER with 'root', rather than euid==0. Hacking preferences in like this isn't a problem to begin with. The real problem comes down the road, when the defaults change and improve, and you now have to be concerned with merging your customizations with the new and improved stuff.
- micampe 13y agothe documentation is in a local file, so it works on the plane. to edit the default prompt (or any function): funced fish_prompt will launch your editor. then: funcsave fish_prompt to persist a copy in your user's configuration. all shell instances will pick it up right away, no need to close, relaunch or source anything.
- barrkel 13y agoDo you know the equivalent to Alt+. in readline? And how to incrementally search the history (i.e. anywhere in the command, not just the start of the line like the autocomplete)? And does fish really need to separate out its subshell from text substitution? E.g. I'd write 'echo "my host is $(hostname)."' in bash, but in fish I seem to need to use 'echo "my host is " (hostname) "."', which is a lot more fiddly, noisy, ugly etc. And do you know the equivalent of <() in bash? I use that with fgrep -f a lot. And (<todo.txt)? That's another one I use in workflows, though (cat todo.txt) would be a verbose alternative.
- micampe 13y ago(I actually don't use fish full time, been experimenting once in a while) I believe Alt+. (or any kind of history substitution) hasn't been implemented by design. I don't have references handy but they should be easy to find. Incremental history search is just type something and then up arrow. The rest of your questions I don't know the answers but it wouldn't surprise me if there were none. Fish prefers to have a simple and coherent syntax to a concise one (though I agree the text substitution is annoying – it seems they usually put the subshell result in a variable and expand that in the string). This helps understanding their design goals http://ridiculousfish.com/shell/user_doc/html/design.html http://ridiculousfish.com/shell/user_doc/html/design.html
- sepeth 13y agoAs a long time bash user, I thought I can give a chance to fish. But after 30m later, when I see this [1] I went back to bash. [1] http://serverfault.com/questions/164305/how-can-i-set-environment-variable-for-just-one-command-in-fish-shell http://serverfault.com/questions/164305/how-can-i-set-enviro...
- andrewvc 13y agoWhat's so hard about typing 'env' in front of the line? `env EDITOR=vim crontab -e` Also, why are you changing your EDITOR on a one-off basis, that shit should be permanent.
- sepeth 13y agoAh! you are right. That didn't occur to me, when I was trying fish. BTW, My point is not specific the EDITOR variable.
- owenjones 13y agoThat question was asked 2 years ago. From the current docs: A universal variable is a variable whose value is shared across all instances of fish, now and in the future - even after a reboot. You can make a variable universal with set -U: > set -U EDITOR vim Now in another shell: > echo $EDITOR vim
- sepeth 13y agoMy problem is not specific to EDITOR variable. E.g. sometimes I need to set PYTHONPATH per specific command. What irritates me is that the syntax to do that. I am not asking for a way to make a variable universal, I am looking for a way to specify variable per command.
- zach 13y agoThis is very nearly a deal-breaker for me, and the current response is typically "yeah, it's verbose, deal with it": https://github.com/fish-shell/fish-shell/issues/587 https://github.com/fish-shell/fish-shell/issues/587 I use Rails with rbenv, a common package which adds shell commands to control which version of Ruby is used. There is a fish port of it, so when you run the very common command "rake" it invokes a fish function which sets up the right environment. And when you do run rake, you often need to set environment variables to set one-time options for the procedure you're invoking. Now the trap is set for the would-be fish user. Because you're actually using the fish shell to customize a command, you can't just punt to env with "env VERSION=20130411222645 rake db:migrate:down" because you actually want to run the fish function, not an executable. So for now, I'm setting environment variables at the command line and unsetting them afterwards. It's really getting old, especially because it loses context in my command history. I think I'll probably ditch fish if I can't find a workaround for this, so any suggestions are appreciated.
- olalonde 13y agoSomewhat tangential but is there any reason why the IRC chatroom is on OFTC rather than Freenode? I think it's the first time I see an open source project using OFTC.
- thealistra 13y agoexcept LLVM and Clang
- yoklov 13y agoLLVM (#llvm) uses oftc as well, which I've always wondered about.
- donri 13y agoPossibly a historical artifact; fish was created in a time when the controversies surrounding lilo were fresh in memory and lilo was still boss. Actually there is a channel on freenode now, but it's about a third in size. Other examples of projects officially on OFTC include: debian, tor, open street map, libvirt/qemu and related tech, ceph, awesomewm, gcc, smuxi... So fish isn't all alone there. There are also projects that operate their own networks, such as GNOME and Mozilla.
- SnowLprd 13y ago🐟 Fish rocks. I've been using it exclusively for the last year, and I can't imagine giving it up. There seem to be a number of misconceptions, which I will endeavor to address. The first is: "Fish isn't POSIX/bash-compliant, so there are compatibility problems." POSIX non-compliance is a feature, not a disadvantage, of the fish shell. It means there is less legacy baggage and syntactical inconsistency. I can count the number of POSIX/bash compliance-related issues I've had with fish on one hand, all of which were easily dealt with. For example, Vim assumes that your shell is sh compatible, but adding set shell=sh in your .vimrc solves that. The only other significant one for me was virtualenvwrapper, which doesn't support fish. Not a problem: Virtualfish solves that handily: https://github.com/adambrenecki/virtualfish https://github.com/adambrenecki/virtualfish Want to run a bash script? Just run bash fooshnizzle.sh. Want to switch to bash for a moment? Run bash and then exit when you want to switch back to fish. This POSIX-compatibility topic is, in my opinion, much ado about nothing. Another misunderstanding seems to be, "I can do XYZ in bash, but fish doesn't support that." Fish purposefully limits the number of "builtins" -- commands that fish includes by default -- in order to maintain simplicity. For me, that's a feature. When I find that there's something I want to be easier to do in fish, I whip up a tiny function to do it. Not only is that extremely easy to do in fish, but then that command performs precisely the way I want it to. I haven't pushed many of those to my dotfile repository yet, but you can check out some of my fish functions there: https://github.com/justinmayer/dotfiles/tree/master/fish https://github.com/justinmayer/dotfiles/tree/master/fish Fish is fast, the auto-completion is amazingly helpful, and it's intuitive to use without too much configuration. Give it a try. 🐟
- mixmastamyk 13y agoI use fish. I write short scripts in bash and longer ones in Python for portability. Everyone's happy... posix has never come up.
- jlgreco 13y ago> Want to run a bash script? Just run bash fooshnizzle.sh Why not just #!/usr/bin/env bash ? In zsh I never worry about running bash scripts because they run by the kernel with the shell/interpreter specified after the hashbag.
- AlexMax 13y agoI used fishshell for the better part of a year and enjoyed the experience. However, a few things bugged me: - Anything that shells out using your default shell seems to assume a bourne-compatible shell. I remember this biting me when using various emacs commands that assumed all the world is a bourne shell. - Copypasting commands is annoying too, but I've been evaluating zsh for the past few months and i've been bitten there too...seems like anything that isn't bash will run into that issue, and you can always just use bash for those instances. - Virtualenv comes with a fish shell script, but last I checked it didn't actually work. - Does fish still throw a hissy fit every time you try and tab-complete a command and your $PATH has a non-existant path in it?
- deleted 13y ago[deleted]
- izietto 13y agoThanks for all the Fish!!! _J""-. .-""L_ /o ) \ ,'; ;`, / ( o\ \ ,' ; / \ ; `, / "-.__.'"\_; ;_/"`.__.-"
- Osiris 13y agoI just found out the other day that in fish you don't need to use the 'cd' command. You can just type out a path and it'll change to the folder.
- Watabou 13y agoYou get the same in bash and zsh, it's not exclusive to fish. Bash: shopt -s autocd Zsh: setopt autocd
- danbmil99 13y agofish awesome
- joem86 13y agoI would severely miss the history completion. I can't count how many times I type !vi to return to the last file I was editing while goofing around in between editing sessions, or !scp to re-upload a fixed package. I understand the need for simplicity, but hitting the up arrow an undefined number of times until I see the command I need seems less efficient. Other than that fish looks really polished and I plan on devoting a few days to it to give it a fair shake.
- ridiculous_fish 13y agoI think you will really like the autosuggestions then. Just begin typing 'vi' and it will suggest the rest of the last command you typed, like doing a history search for free. See http://fishshell.com/assets/img/screenshots/autosuggestion.png http://fishshell.com/assets/img/screenshots/autosuggestion.p... . One of the nice features of autosuggestions is that they remember which arguments were files, and which ones were not. So if you have changed directories, !vi will edit a file that does not exist - probably not what you meant to do. The fish autosuggestion won't suggest it at all.