8 ms·
Fish Shell 3.5.0
- nikivi 4y agoBeen meaning to move fully to Fish, was just dreading the amount of zsh functions I'd have to rewrite. Is there any reason to use Zsh at this point over Fish?
- cmer 4y agoI was in a similar situation 2 years ago and I took the plunge. Turns out, the amount I had to rewrite was fairly minimal, and the benefits of Fish are just incredible. I'd say: go for it, you won't regret it!
- smoldesu 4y agozsh tends to actually run scripts when you feed them. As long as you can resist the urge to run all of your POSIX scripts in fish, I think I much prefer fish as an interactive shell.
- cmer 4y agoExactly. Falling back to Bash to run scripts makes life easier. Just add a Bash shebang at the top and you're good to go.
- moondev 4y agoprocess substitution? fish: Invalid redirection target: yq3 r <(kubectl get nodes -o yaml)
- Tmpod 4y agoYou can do process substitution by piping into the psub command ;)
- moondev 4y agojuice is not worth the squeeze
- inyourtenement 4y ago<(blah) vs (blah | psub)
- medler 4y agoI used fish for a long time, but lost patience with the incompatibility with other shells. It’s nice to be able to just paste and run someone else’s command, and I eventually tired of having to rewrite every command to use fish syntax. For example, replacing FOO= with set - x … The reverse is even worse—if I need to send someone a command to run, I have to rewrite it in a syntax that’s likely to work when they run it. It only takes a few seconds each time but I grew weary of it.
- Starlevel001 4y agoYou can just do `bash -c "CMD"`.
- tomjakubowski 4y agooccasionally you'll need to run a command which sources or exports… it's no silver bullet in my experience anyway
- pxc 4y agoCheck out fish-foreign-env, bass, and babelfish
- mixmastamyk 4y agoThat’s accepted now, and was always available by prepending env.
- ducktective 4y agocreate a key-binding to invoke your terminal with bash. I have not set fish as my system shell (aka chsh)
- ilaksh 4y agoThey have improved compatibility a lot. Also, you could do what I do: leave bash or something else as the default, and then just run fish manually. Then if I have a problem pasting or something I run type exit. But the incompatibilities are a lot less now.
- CJefferson 4y agoPersonally, I'm a lover of subshells, I often write things like (cd mydir && make), making use of the fact the 'cd mydir' only happens in the subshell. Fish doesn't have anything like that, there are a few workaround, but none of them are (in my opinion) anywhere near as nice.
- 8ytecoder 4y agoI use this a lot in my scripts - handy when you want to capture the output or execute a command in a different directory.
- lytedev 4y agoset output (echo captured) echo $output > captured And if you wanna run a command in another dir: pushd other_dir run_command popd
- onei 4y agoIf it's just make you're doing that for "make -C mydir" does that and puts you back in the original directory when it's done.
- tomjakubowski 4y agoI do this too (in zsh), but maybe writing a function callable like this would work: with mydir make Although you'd want to be able to write things like with mydir make && ./bin/myprog and parse everything to the right of `mydir' as a shell pipeline. That might be the sticking point in fish.
- lytedev 4y agoYou should instead pushd /my/path && command && popd Both in bash AND in fish!
- CJefferson 4y agothe problem with that is I ended up in the wrong directory if I press ctrl+c, or in the exact examples you give, if command fails.
- agency 4y agoLast time I looked into switching the vim mode in zsh was better by enough of a margin that I didn't switch, but that was years ago. I've been meaning to give fish another shot.
- tomjakubowski 4y agozsh has survived for longer (it's "Lindy") and is therefore more widely available on remote machines. Also, maybe just my problem, but I do get frustrated having to switch back to bash/zsh syntax and semantics in cases where Fish isn't available, or when writing scripts others will use. Easier for me to stick with zsh for my shell and bash for shipping shell scripts.
- axkdev 4y agoYou can 1. Make your scripts executable or 2. Use bash / zsh inside of fish. 3. You can define wrapper functions in fish that just call bash/zsh functions internally. I use fish, although I hate writing scripts in it. It just feels wrong. Better stick to good old bash.
- pxc 4y agoFor copying and pasting while preserving environments, you can always use `exec` as an escape hatch. exec bash <paste some bash> exec fish
- ogogmad 4y agoDoes process substitution work correctly yet?
- losvedir 4y agoGreat! Love the new Astronaut prompt. I dabbled with starship.rs, and really liked the prompt, but ultimately didn't want to deal with an extra moving part in my terminal setup. I'm so happy that some of it is available in stock fish shell, now.
- assbuttbuttass 4y ago> Added completions for: > archlinux-java (#8911) > apk (#8951) > brightnessctl (#8758) > efibootmgr (#9010) > fastboot (#8904) > optimus-manager (#8913) > rclone (#8819) > sops (#8821) > tuned-adm (#8760) > wg-quick (#8687) One of my favorite things about fish is that it bundles completions for a huge number of packages. My experience with bash was that completion support was very spotty
- BudaDude 4y agoZsh Completions is a pretty good alternative for anyone using zsh. https://github.com/zsh-users/zsh-completions https://github.com/zsh-users/zsh-completions
- loeg 4y agoZsh completions can be hit or miss. Sometimes they make huge differences to how path argument selection works (tab completion) in confusing ways that are inconsistent between commands.
- Night_Thastus 4y agoI love fish, it's become my main daily driver. :)
- jakobov 4y ago
- azinman2 4y agoFish shell has far better history and autocompletion UI, and an actual Web based UI for config.
- mixmastamyk 4y agoWho wants a web-based tool for configuring terminal apps? Sounds like a mismatch to me.
- azinman2 4y agoWhat would you prefer? You can always manually edit config files, or you can have a UI that lets you preview how various things will look and simplify changes. Seems like the best of both worlds. Have you tried it?
- mixmastamyk 4y agoCould be useful the first time, but after that just clobbers things? Ten themes are not enough for any but the most casual users. These cases don’t fit the terminal well. If it were a curses app with complete (or non-clobberful) customization I might see the point.
- azinman2 4y agoSorry what gets clobbered? If you only need it once, just don’t launch it again? It’s not like it’s always running.
- mixmastamyk 4y agoYou edit files, or use the interface. Much is configured through custom written functions. If you use both there is likely to be trouble.
- ciguy 4y agoI really love fish and used it daily for many years. Then I started work at a new company that had an existing library of internal shell tools that weren't compatible with Fish and the effort to port them was too much. I found that ZSH managed with OhMyZSH plugins gets me similar functionality without the syntax incompatibilities. Unfortunately unless Fish moves back towards compatibility I don't see myself ever going back, it's just too much hassle dealing with little syntax issues all the time.
- latenightcoding 4y agoSame here, fish is amazing until is isn't. I really wish it was POSIX
- db65edfc7996 4y agoDitching some of the POSIX missteps is half the appeal of fish.
- enkrs 4y agoI’m an avid bash user for the same fear of incompatibility. But how does that work in practice? I mean- if I use Fish shell interactiveley, how does that affect shell scripts? I presume they would still be run via bash (#!/bin/bash)
- saila 4y agoEvery script should have a #! line, but if it doesn't, you can always run it with `bash <script>`.
- Tyr42 4y agoCould be "add source /blah blah" to your bashrc, and this adds some shell functions (which allow it to do stuff like cd).
- mhink 4y agoExecuting programs (including scripts, which are indicated by shebangs like #! /bin/bash) is the operating system's responsibility, not the shell's. So yeah, shell scripts work exactly the same if you're running them as an executable. Some scripts, however, (like for instance .bashrc) are intended to be sourced by the shell rather than invoked as an independent executable. These won't work, and will need to be ported.
- hit8run 4y agoI'm running fish for at least 8 years now and I'm very happy with the out of the box experience. It's one of the first things I install on new machines.
- azinman2 4y ago> ampersand-nobg-in-token, which means that & will not create a background job if it occurs in the middle of a word. For example, echo foo&bar will print “foo&bar” instead of running echo foo in the background and then starting bar as a second job. Yes! This has been annoying with curl for a long time.
- donio 4y agoSince such URLs very often come from copy & paste another way to deal with this is smart auto-quoting when a paste is detected via the "bracketed paste" feature of modern terminal emulators. zsh does this if you enable url-quote-magic.
- faho 4y agoFish also enables bracketed paste and does smart escaping when you paste inside single-quotes. (I'm a fish developer)
- pvg 4y agoA whole recent kettle of them: 3 months ago, 90 comments https://news.ycombinator.com/item?id=30734072 https://news.ycombinator.com/item?id=30734072 3 months ago, 20 comments https://news.ycombinator.com/item?id=30660587 https://news.ycombinator.com/item?id=30660587 7 months ago, 291 comments https://news.ycombinator.com/item?id=29341390 https://news.ycombinator.com/item?id=29341390
- garlicrouted 4y agoIf I'm not a "power user" (learned rudimentary bash as teenager, stuck with it on MacOS through college) is it worth it to learn a new shell? I respect the craftmanship, but if I'm more of a "software carpenter" why should I invest the time?
- jefft255 4y agoFor me, fish made my life instantly better without any real investment coming from bash. There are some incompatibilities, but I felt productive right away.
- lachenmayer 4y agoI always recommend fish to anyone who doesn't (yet!) have strong opinions about their shell. Immediately seeing if you misspelled a command because the color changes is a huge benefit if you're not super familiar with the command line. The auto-complete and suggestions are also miles better than bash - they are automatically generated from man pages, so most commands have a usable set of completions. The web-based config lets you easily tweak settings that would otherwise be an incomprehensible soup of PS1=3!@*(!@!@ gobbledygook. Also, it mostly "just works" out of the box, so you really don't have to waste any time setting anything up if you don't really care.
- garlicrouted 4y agoSounds promisingm, especially now that macOS defaults to Zsh... I very rarely see any documentation where that is the default.
- jeppesen-io 4y ago> The auto-complete and suggestions are also miles better than bash - they are automatically generated from man pages, so most commands have a usable set of completions. I never understood this. It's always seemed worse - in bash/zsh I can tab complete branches/tags etc in git, pods/deployments etc in kubectl. I try that in fish and it'll just list files in my PWD
- k8sToGo 4y ago
- grajam_hons 4y ago
- butterfly771 4y agoI used to like fish, but because of compatibility issues, I went back to OMZ (:
- mk12 4y agoHave you tried it recently? It's gotten a lot better. The following commands used to not work, but now they all do: true && echo hi false || echo hi export VAR=1 VAR=1 somecommand echo "$(echo substitution)"
- alexpw 4y agoThis killed all shell interaction within my tmux setup, somehow, and I had to downgrade in osx/brew [1] back to v3.4.1 [2]. I'm still wondering what part of my (probably outdated) tmux config caused it, but the most suspicious part is the run-shell/if-shell stuff. Anyway, have things to do before I can try again and dig in. Thought I'd post in case someone else ran into this. [Edit] Tip: swap to a different shell before uninstalling your current shell. Sigh...lol [1] https://github.com/fish-shell/fish-shell/issues/5497 https://github.com/fish-shell/fish-shell/issues/5497 [2] https://raw.githubusercontent.com/Homebrew/homebrew-core/ad5d542a28f634a9b65a5a7f6dbacab335aff92d/Formula/fish.rb https://raw.githubusercontent.com/Homebrew/homebrew-core/ad5...
- faho 4y agoWould you mind posting a link to your tmux config? I'd look into it.
- alexpw 4y agoThank you in advance! tmux.conf [1] [1] https://gist.github.com/alexpw/7d406734f912f835d705066de8286bda https://gist.github.com/alexpw/7d406734f912f835d705066de8286...
- ridiculous_fish 4y agoHello, fish shell dev here. We opened an issue on our tracker - when you get a chance we'd appreciate if you'd share some tmux logs there, as I wasn't able to reproduce with your config file. https://github.com/fish-shell/fish-shell/issues/9019 https://github.com/fish-shell/fish-shell/issues/9019
- alexpw 4y ago[Late Update] The fish 3.5.0 release is not responsible for my tmux issue. False alarm. Downgrading did somehow help me regain shell interaction, but I can't create a new session/pane, etc. I think something else broke my tmux setup during the brew upgrade, or possibly even before it.
- jacobsenscott 4y agoFish is fantastic. Some people worry about posix compatibility and stuff, but that only matters if you are copy pasting bash snippets directly to the command line. If you are using bash or zsh as a programming language then you put the code in a file, and run it with that shell - so it doesn't matter what shell you are running. If you love bash or zsh, and are in the habit of building long complex commands on the command line, then stick with bash or zsh. But if you are just running commands fish is far superior. If you are not a bash/zsh/posix expert fish is a cleaner language and you'll learn it more easily. A fully tricked out zsh might do everything that fish does, but it is very slow compared to fish.
- pxc 4y ago> If you love bash or zsh, and are in the habit of building long complex commands on the command line, then stick with bash or zsh. Fish handles this very ably as well, of course! If you're a developer and you work in or deploy to a lot of environments where you can't install software, choosing what comes with the environment makes sense. But even when it comes to scripting, you won't regret sticking with Fish, imo.