TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

The fish shell is amazing

447 点作者 RMPR超过 3 年前

46 条评论

jonfw超过 3 年前
I used fish for a couple of years and really liked it. But I recently learned that I can configure ZSH to have all of the same auto-complete and plugins that I loved from fish. Now I have all of the creature comforts I like, with POSIX compliance<p>I found that while fish has better syntax than bash for most things, the hassles with incompatibility or unexpected behavior brought me much more trouble than BASH&#x27;s syntax ever has
评论 #29344297 未加载
评论 #29342967 未加载
评论 #29344323 未加载
评论 #29342821 未加载
评论 #29342584 未加载
评论 #29343057 未加载
评论 #29342486 未加载
评论 #29347262 未加载
评论 #29346796 未加载
评论 #29343089 未加载
评论 #29342766 未加载
评论 #29347389 未加载
评论 #29344971 未加载
评论 #29342295 未加载
ribit超过 3 年前
I really love fish and the philosophy behind it, especially the &quot;configurability is the root of all evil&quot; attitude. Makes for a well though out software that is a true pleasure to use.
评论 #29342824 未加载
评论 #29348083 未加载
评论 #29352359 未加载
vasergen超过 3 年前
I like software where you don&#x27;t need to spend hours or even days on configuration and it just works out of box. Unfortunately the different syntax is no go for me. I have a bunch of scripts which I can run on my local machine and remote interchangeably. Even if syntax is better I want to learn rather `one syntax` that work everywhere. But that is only one thing that prevents me from trying it.
评论 #29345427 未加载
评论 #29345256 未加载
评论 #29345499 未加载
评论 #29345314 未加载
iamevn超过 3 年前
I&#x27;ve found fish to be absolutely wonderful for shell scripting. I can throw together a loop or a function with the sort of confidence I never could have in bash.
评论 #29351600 未加载
thrwyoilarticle超过 3 年前
Shells and scripting languages are different things. I don&#x27;t care how good of a scripting language Powershell is, it&#x27;s painful to use as a shell. I don&#x27;t care that fish can&#x27;t run sh scripts, I&#x27;ve never used it on a machine that didn&#x27;t have sh. Can we stop judging oranges for their lack of crunch?
评论 #29343055 未加载
评论 #29343466 未加载
评论 #29346406 未加载
评论 #29342961 未加载
评论 #29343147 未加载
评论 #29344836 未加载
sandreas超过 3 年前
Don&#x27;t forget that if you use #!&#x2F;bin&#x2F;sh in POSIX compatible scripts, you can configure &#x2F;bin&#x2F;sh to symlink dash shell instead of bash or zsh. Dash will run scripts way faster (up to 4x) because it is less feature blown...<p>This is the reason, why I try to prevent using bash&#x2F;zsh exclusive features in my daily use scripts.
评论 #29344779 未加载
assbuttbuttass超过 3 年前
Fish really shines in interactive use, like being able to write fish_vi_key_bindings, and that setting is preserved after restarting fish. Or using funced and funcsave to modify helper scripts, or abbr -s ...<p>I&#x27;m not sure I&#x27;ve ever opened my fish config file, but I&#x27;m still able to customize it easily
kbd超过 3 年前
As another commenter pointed out, while Fish has some nice out-of-the-box features, they’re all achievable in Zsh with a few lines of plugins. And did you know Zsh has a short for loop? Along with fantastic plugins like fzf-tab, I don’t see a reason to use anything else right now.<p>Though, I’m keeping a very interested eye on Nu shell. They’re doing a lot of stuff right, and I expect it will become a very useful scripting language in its own right even when not used full-time as a shell.
评论 #29342223 未加载
评论 #29342364 未加载
评论 #29342116 未加载
评论 #29342294 未加载
评论 #29342491 未加载
评论 #29342340 未加载
desireco42超过 3 年前
It is typical HN that everyone is talking about Zsh and how it isn&#x27;t so bad. And you know what, I used it for a while long time ago, and it is great. I even had config I could transport to another machine when I need.<p>All that can&#x27;t be compared with fish out of the box, which is why I am using fish, it will be 10 or so years now. When I say use, I mean that, I just use it, I don&#x27;t spend time learning it&#x27;s obscure features, creating scripts etc, no, just use it.<p>I have alias list that I use to make myself productive and it goes along with me to a new machine. Very slim and simple configuration. That and Vim, but that is another story.
评论 #29343501 未加载
fouronnes3超过 3 年前
I started a new job recently, and I&#x27;ve been thinking about terminals and shells. I love a well configured modern env, but I can&#x27;t be bothered spending the literal HOURS you need to setup everything... zsh, zsh plugins, fzf, fzf plugins, fd, dot bare, patched fonts, 24 bit terminal color, temrinal color theme, binutils color theme, powerline, diff-so-fancy... I get that the devil is in the details, but come on, can I just have a single &quot;terminal environnement distribution&quot; with sensible defaults and that&#x27;s it. Something like SpaceMacs&#x2F;SpaceVim but for all that. I don&#x27;t want to spend the time configuring and maintaining this wonderful pile of obsolete-and-yet-somehow-still-the-best-we-got technology.
评论 #29343484 未加载
评论 #29342695 未加载
评论 #29345127 未加载
评论 #29342544 未加载
评论 #29342603 未加载
评论 #29342561 未加载
评论 #29342950 未加载
stardenburden超过 3 年前
&gt; my grandma was afraid of Linux, until I showed her that fish can autocomplete<p>Unknown user on discord
rgoulter超过 3 年前
Not restricted to fish shell, but I can further recommend starship.rs as a prompt, and using fzf to search through command history.
评论 #29342067 未加载
cbzehner超过 3 年前
I used Fish for several years before switching over to nushell a few weeks ago.<p>Nushell takes the ideas behind Fish even further by incorporating types other than strings and adding more built-in functionality that’s useful for your average command-line user.<p>I doubt I’ll go back but both are great! Highly recommend Fish and Nushell!
评论 #29342004 未加载
craigkerstiens超过 3 年前
Strongly agreed here, it really just works. Sure you can get the same with zsh but the hours of my life I&#x27;ve spent tweaking and tuning zsh I&#x27;d happily give back because fish is good enough.<p>When we built our CLI for Crunchy Bridge it was a couple lines to add tab completion to the CLI when running in Fish (<a href="https:&#x2F;&#x2F;blog.crunchydata.com&#x2F;blog&#x2F;introducing-the-crunchy-bridge-cli" rel="nofollow">https:&#x2F;&#x2F;blog.crunchydata.com&#x2F;blog&#x2F;introducing-the-crunchy-br...</a>), love that when building such tooling giving a better end user experience was so simple.
dirkg超过 3 年前
I&#x27;ve gone down the rabbit hole with zshrc&#x2F;bashrc customization, there are endless options and gists and pages and its a never ending rabbit hole.<p>In the end I realized a well configured toolkit is enough for 99.99% of people, and there are an endless number of those as well. I use zsh-quickstart-kit which is updated often and has good speed and amazing features. You get all the fish features AFAIK and more with no risk of scripts breaking and it was a 1min install.<p>For non devs who don&#x27;t need to script I&#x27;d recommend fish and there are distros that default to it now.
beermonster超过 3 年前
Is there anyone who can provide a simple summary for bash v zsh vs fish? Maybe I’m lazy but I’ve just stuck with bash for.. well since ever. Maybe it’s time to try something new but then if it ain’t broke… anyway would be interested in what things it does that I never knew I needed or things which just make life simpler&#x2F;easier.
评论 #29344123 未加载
评论 #29344081 未加载
Ultimatt超过 3 年前
Is no one going to comment on for *.pdf assumes no spaces in filenames for the BASH example to be correct, what about Fish?
评论 #29344969 未加载
评论 #29357741 未加载
评论 #29344729 未加载
lolski超过 3 年前
I&#x27;ve been a Fish user for 10 years!<p>One key thing I like from Fish is their command history feature, where you can use the up&#x2F;down to move backward&#x2F;forward the history.<p>I can&#x27;t find a way to get this to work in ZSH I don&#x27;t like having to CTRL+R for going backward (how do you even go forward, I can&#x27;t remember :D)
dang超过 3 年前
Ok, let&#x27;s do this. Past related threads:<p><i>Fish shell</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=27180420" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=27180420</a> - May 2021 (118 comments)<p><i>Fish Shell 3.2</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=26302678" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=26302678</a> - March 2021 (128 comments)<p><i>Fish is not operational on a VT220 terminal (2015)</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=25526237" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=25526237</a> - Dec 2020 (113 comments)<p><i>New Features in the Fish Shell</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=24631138" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=24631138</a> - Sept 2020 (138 comments)<p><i>Dolphins learn from their peers to use empty shells to catch fish</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=23660910" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=23660910</a> - June 2020 (8 comments) (&lt;-- just kidding)<p><i>Fish: A command line shell for the 90s</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=21361696" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=21361696</a> - Oct 2019 (83 comments)<p><i>Fish shell 3.0</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=18776765" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=18776765</a> - Dec 2018 (220 comments)<p><i>Fish: A user-friendly command line shell for macOS, Linux, etc</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=15910897" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=15910897</a> - Dec 2017 (204 comments)<p><i>Fish (Shell) for a Week</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=14422672" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=14422672</a> - May 2017 (2 comments)<p><i>The fish shell is awesome</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=14179081" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=14179081</a> - April 2017 (7 comments)<p><i>Fish Shell Design Principles</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=11102941" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=11102941</a> - Feb 2016 (71 comments)<p><i>Fish shell 2.2</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=9873090" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=9873090</a> - July 2015 (70 comments)<p><i>Fish shell</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=9566441" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=9566441</a> - May 2015 (182 comments)<p><i>FISH Shell: A dynamic shell</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=8783150" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=8783150</a> - Dec 2014 (3 comments)<p><i>Fish shell 2.1</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=6626635" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=6626635</a> - Oct 2013 (151 comments)<p><i>fish shell</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=6224524" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=6224524</a> - Aug 2013 (75 comments)<p><i>Fish shell 2.0</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=5723235" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=5723235</a> - May 2013 (175 comments)<p><i>Fish 2.0 shell beta</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=5567639" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=5567639</a> - April 2013 (56 comments)<p><i>Fish: Finally, a command line shell for the 90s</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=4073162" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=4073162</a> - June 2012 (146 comments)<p><i>Fish sucks (but your shell sucks more)</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=2031110" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=2031110</a> - Dec 2010 (60 comments)<p><i>Fish - The friendly interactive shell</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=820677" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=820677</a> - Sept 2009 (16 comments)<p><i>Fish Shell: A User-Friendly Shell or Like a Heavily Customized zsh</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=811113" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=811113</a> - Sept 2009 (8 comments)
评论 #29343341 未加载
评论 #29343271 未加载
emersion超过 3 年前
&gt; You can configure your shell using a web interface! Just run fish_config<p>As much as I like the fish shell, I really consider this an anti-feature. A TUI application to configure the shell would make much more sense. The terminal emulator is your platform, not the Web.
评论 #29343605 未加载
评论 #29345610 未加载
oakmad超过 3 年前
Anyone else read that as “The fish smell is amazing”?
评论 #29345848 未加载
vermaden超过 3 年前
If you would like to add all these FISH things to ZSH:<p>- highlighting and displaying last suggested command execution from history<p>- file&#x2F;dir highlighting<p>- commands coloring and stuff<p>Then check &#x27;UPDATE 1&#x27; from here:<p><a href="https:&#x2F;&#x2F;vermaden.wordpress.com&#x2F;2021&#x2F;09&#x2F;19&#x2F;ghost-in-the-shell-part-7-zsh-setup&#x2F;" rel="nofollow">https:&#x2F;&#x2F;vermaden.wordpress.com&#x2F;2021&#x2F;09&#x2F;19&#x2F;ghost-in-the-shell...</a><p>I can not use FISH as it does not honor the POSIX syntax for loops and stuff and I often type &#x27;for&#x27; and &#x27;while&#x27; POSIX loops at command line so I use ZSH. Besides that FISH is really nice shell.<p>Regards.
ZeroGravitas超过 3 年前
I use and like fish, they mention the default color scheme, I keep meaning to change the unrecognised color from red to yellow. My general theory is that things with typos in them should be easier to read, than things recognized as syntactically correct, as you need to actually read the typo text to figure out what you&#x27;ve done wrong.
kall超过 3 年前
I love fish. On any host, if I can just get fish running, I feel 100% at home. I don‘t need a single bit of customization on it.
pmarreck超过 3 年前
I&#x27;d rather have a more powerful shell that uses a functional style yet preserves many shell semantics we&#x27;re all familiar with (like XS, <a href="https:&#x2F;&#x2F;github.com&#x2F;TieDyedDevil&#x2F;XS" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;TieDyedDevil&#x2F;XS</a> , except maintained!) than an easier-to-use shell
garciasn超过 3 年前
More and more often, I am getting the following error:<p>Malware and Phishing<p>This site is blocked because it is a known security threat. Please contact your network administrator to gain access.<p>My assumption this is because I have Xfinity Business Class and it&#x27;s blocking the site. But why would I be seeing this so often on a site linked from HN?
评论 #29342779 未加载
评论 #29342717 未加载
vander_elst超过 3 年前
Vi mode was not good enough: first thing I do in a new shell is `set -o vi` and then try to do simple things: replace parts of words, copy&#x2F;paste, search history. Fish in my experience was way worse than zsh and bash. Maybe things changed in the meantime?
dirkg超过 3 年前
Is fish usable for a web&#x2F;nodejs developer working with the usual libs in the JS ecosystem such as React&#x2F;Webpack as well as usual github projects?<p>By that I mean any scripts included in these projects. I have seen only a few scripts though.
xhevahir超过 3 年前
Can anyone explain why getting similar functionality in zsh is such a PITA? Every time I&#x27;ve tried to get smart-autocomplete history stuff working in it I&#x27;ve given up. Is it because the community is much more fragmented?
jrm4超过 3 年前
Specific question for anyone who&#x27;s gone from bash to fish (and maybe back) -- Does the &quot;only splitting on newlines&quot; mess you up? I&#x27;ve just been in bash <i>so long</i> that I feel like this will get me?
评论 #29345884 未加载
DavideNL超过 3 年前
Can anyone recommend a &quot;sane zsh defaults&quot; config that I can download and just works with approximately the same features as fish?<p>(Without having to first learn&#x2F;spend time about howto setup and configure plugins etc.)
londons_explore超过 3 年前
&gt; You can configure your shell using a web interface!<p>Think about that for a while.
评论 #29342792 未加载
err4nt超过 3 年前
I&#x27;ve been happy with Fish shell for years!<p>Yes, I could fiddle and twiddle with settings and configure a nicer shell, but Fish on its default settings on any OS just makes things smooth and easy!
slifin超过 3 年前
Fish is so good I think I&#x27;m using shellder and some other bits<p>But I just use it as a way to run commands, and I use dynamic languages to create scripts just not bash..
jzer0cool超过 3 年前
Could someone explain more the video demo? It ran the python interpreter which disappeared, but I didn&#x27;t quite catch the meaning of this.
评论 #29346093 未加载
als0超过 3 年前
&gt; when you type something invalid it’s red, blue when not<p>Does anyone know how to do something like this with Bash?
jeppesen-io超过 3 年前
I wish I could use fish, but I can&#x27;t leave the fancy auto complete of kubectl and git
评论 #29344587 未加载
uncomputation超过 3 年前
I really liked fish when I used it but unfortunately the non-compliance with other shells is just too much hassle given the feature set (autocomplete is cool but I always know when I have python3 vs python4), like not being able to just copy paste “export VAR=…” from the web like I have been my whole life.
BeetleB超过 3 年前
xonsh is also worth a try. I&#x27;ve been using it for a few years now.
donio超过 3 年前
zsh has a short form for for loops too:<p><pre><code> for i in *.pdf; echo $i </code></pre> Shorter than the fish version. Does that mean that it&#x27;s a better shell then?
aquajet超过 3 年前
Is there a reason fish isn&#x27;t posix compliant? From my experience (which is rudimentary tbf) there are only detriments due to the lack of sh scripts not working out of the box.
评论 #29345047 未加载
peterhil超过 3 年前
Have you tried Oil Shell? <a href="http:&#x2F;&#x2F;www.oilshell.org&#x2F;" rel="nofollow">http:&#x2F;&#x2F;www.oilshell.org&#x2F;</a>
评论 #29343923 未加载
评论 #29344497 未加载
jordiburgos超过 3 年前
Not for me, it breaks the .sh scripts and have to be rewritten.
评论 #29342789 未加载
评论 #29344590 未加载
评论 #29342825 未加载
评论 #29344426 未加载
评论 #29342776 未加载
nojito超过 3 年前
Fish is good, but most shells pale in comparison to powershell unfortunately.
评论 #29343467 未加载
评论 #29342724 未加载
revscat超过 3 年前
&gt; Smart tab completion not only for the commands but for the arguments as well, and it apparently does that by parsing man pages.<p>And it does this every time you spawn a shell. So if you have set your login shell to fish, then every time you launch a shell it loads all the fish plugins like this one, and that slows it down. And you can’t turn it off, or couldn’t the last time I checked around a year ago. Insult to injury? The PR where this was requested was closed by the devs as “wontfix”.<p>This, and it’s lack of POSIX compatibility, made me switch back to zsh.
评论 #29343053 未加载
评论 #29343601 未加载
评论 #29342917 未加载
评论 #29345301 未加载
pvaldes超过 3 年前
&gt; fish is not POSIX compliant, don’t expect your previous scripts to work at all<p>Extend, embrace, extinguish?...
评论 #29341806 未加载
评论 #29341932 未加载
评论 #29341804 未加载