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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Use Zsh

164 点作者 daivd超过 12 年前

26 条评论

dbbolton超过 12 年前
There's one of these "why you should convert from X to Y" posts every week or so. I understand that a person can be somewhat excited about finding a better application to replace their old stand-by and might feel the need to evangelize. I don't see anything wrong with wanting to introduce others to new software with a helpful attitude.<p>However, it seems like all of the bash-to-zsh posts boil down to better autocompletion and oh-my-zsh. I haven't really seen anything fresh in quite some time. This is something that I do not understand. Does the author think he is saying something that hasn't been said, or is the hope that if we keep saying the same thing over and over that we can get more people to try zsh? I really can't say.<p>Also, I recommend <i>not</i> using oh-my-zsh if you are a beginner. Rather, I recommend that you start with a blank slate and read the documentation. This is the only way to get the exact configuration you want. If you don't really care about your shell that much, then why are you switching in the first place? Alternatively, you might try using the "recommended" config offered on first run (I can confirm that the default config on Debian is a good start and will work for most people). Then go through that config while reading the Zsh User Guide[1] and tweak it to your liking. It is my opinion that oh-my-zsh ultimately stops people from reading documentation and offers an incentive (ease of use) for using code that may not be understood (when it probably should be). However, a lot of people seem to like it. Perhaps I am missing something.<p>My intent is not to discourage this author specifically, but rather to call into question the underlying motivation and behind and utility of all posts of this type.<p>1 - <a href="http://zsh.sourceforge.net/Guide/" rel="nofollow">http://zsh.sourceforge.net/Guide/</a>
评论 #4588040 未加载
评论 #4587607 未加载
评论 #4588879 未加载
评论 #4588463 未加载
评论 #4589325 未加载
评论 #4588212 未加载
评论 #4588200 未加载
fusiongyro超过 12 年前
I used to use zsh but switched back to bash a couple years ago simply because the benefit wasn't worth the trouble. When I first changed back I went to some difficulty to get my PS1 to have color in it. That slowly faded away and now I have a visceral, negative reaction to prompts with that much colorful whizzy fu. Maybe in a few more years I'll trim out the username/hostname/path and become content with just a %.
评论 #4586681 未加载
评论 #4586235 未加载
sstephenson超过 12 年前
Here's another perspective: <a href="http://sstephenson.us/posts/on-configuration" rel="nofollow">http://sstephenson.us/posts/on-configuration</a>
评论 #4586516 未加载
评论 #4586667 未加载
评论 #4586569 未加载
评论 #4586698 未加载
redsymbol超过 12 年前
I've been using zsh for over ten years. Since one of my best friends (now a computational physicist) convinced me to try it in college.<p>Over time I've temporarily switched to others just to make sure I wasn't being stuck in a rut, but I always have come back to zsh. It's a joy to use as a day to day command line interface.<p>For writing shell scripts, i.e. actual software implemented in shell, I actually prefer bash. In large part because it's more portable, in the sense that any given machine is likely to have bash already installed.
评论 #4587557 未加载
MatthewPhillips超过 12 年前
This article really feels like bikeshedding to me. I'm always going to use whatever shell comes default with the OS I'm on (which almost always means Bash), simply because changing the shell is an unnecessary block of time that could instead be used writing software. I need a <i>really</i> good reason to switch, something the equivalent of pipes, and if the #1 reason you can give is "Powerful context based tab completion", I'm confident in dismissing zsh as a cosmetic improvement on bash that I don't need to waste my time on.
评论 #4586761 未加载
评论 #4586455 未加载
评论 #4586586 未加载
评论 #4586631 未加载
ludwigvan超过 12 年前
&#62; In Bash, we often use PgUp to search through the command history. In Zsh you just write part of the command and press Up. This will let you cycle through all command lines that contain what you have written, not just those that begins with it. If you don’t write anything Up works as usual, by cycling through all commands.<p>This is not true, you can do that in Bash too (via .inputrc) <a href="http://blog.theliuy.com/2011/inputrc-keyboard-mapping-config-file/" rel="nofollow">http://blog.theliuy.com/2011/inputrc-keyboard-mapping-config...</a><p>Edit: Maybe I misunderstood though, does pressing Up really let you search all command lines that contain what you have written, not just those that begins with it? It doesn't seem to do that on my zsh.
评论 #4586215 未加载
评论 #4586096 未加载
评论 #4586863 未加载
eblume超过 12 年前
I tried using oh-my-zsh, but all of a sudden bringing up a new terminal (on OS X) went from taking ~1 second to ~5 seconds. Totally killed my interest in zsh.<p>I'm sure there's a way to make it all work nicely, but bash has been doing just fine for me, I don't feel the need to figure out an entirely new configuration system for a tool that ultimately has little new utility in my workflow.
评论 #4586500 未加载
评论 #4587010 未加载
评论 #4586844 未加载
评论 #4586672 未加载
评论 #4586644 未加载
评论 #4588423 未加载
zobzu超过 12 年前
So I heard "use zsh its so cool" since about 12 years, every 3 month. Here's the new post, just in time.<p>Don't get me wrong, I use zsh. I also use bash. I end up using more bash than zsh though. The reason are the same as 12 years ago. If zsh was the most popular shell <i>right</i> <i>now</i> the same people would be praising bash.<p>- they're equally fast for what we need them to do<p>- they've similar features<p>- bash is <i>everywhere</i><p>- bash is <i>the</i> standard for all scripts<p>- zsh has extra complexity<p>Oh yeah and stop using pg-up in bash, use ctrl-r. And if different is cool, I don't know, use fish.
评论 #4586864 未加载
mathieuh超过 12 年前
Any one else using Fish?
评论 #4586117 未加载
ithcy2超过 12 年前
Everything in the "Context based tab completion" paragraph is already done by bash_completion.<p>* It knows which commands git takes? Yes. * which hosts are in my hosts file for ssh? Yes. * which users my system have when I write chmod? Yes. * available packages to apt-get? Yes.<p>Plus everything in /etc/bash_completion, plus the hundreds of additional commands in /etc/bash_completion.d, plus many, many online resources for creating your own...
评论 #4587497 未加载
lr--rw-rwx超过 12 年前
My concern with Zsh is that is just not that much better than Bash and that's the (valid) reason, why it's not getting widespread adoption.<p>It's like with Plan9 and Linux or new systems languages which try to make a better C. The technology _is_ better than the existing one, but not that much better that it's that relevant.<p>I think one of the main problems of current shells is that they try to be a CLI and an interpreter for a programming language (e.g. Bash script) at the same time, but the user uses mostly just one of these features for certain periods of time. At one point he wants to control the computer in a very efficient matter (system usage), so short keystroke sequences are convenient. At other times one wants to do more complex stuff which involves programming (development).<p>However current Shells are at any point in time prepared for both and that's the reason why both tasks are sometimes cumbersome.
Alan01252超过 12 年前
Just started using Zsh. I never really had any qualms with bash, and so had the mantra if it's not broke don't fix it.<p>Then I worked with a couple of junior developers and noticed them doing some cool looking things on the terminal.<p>Suffice to say I've now switched to Zsh and can't see myself going back to bash any time soon. Thanks junior devs :)
scrsh超过 12 年前
It's not portable.<p>And I have to invest time to learn all the codes.<p>In the times it takes to learn zsh, I could write the same functionality into small sh scripts which I can run on any machine. Put them in a folder, add it to my PATH and I'm in business.<p>I can tar up this folder and upload it to some internet-connected machine so I can download it to any other machine with an internet connection.<p>zsh is wonderful. It is the ultimate "interactive" shell. But it's not portable.<p>Moreover, the less "interactive" I need to be on the command line the better. If I have short, portable scripts to do certain things, and I can run them on any machine with /bin/sh (no need to install anything; sh is the universal interpreter), that's a nice thing to have. zsh won't give me that.
buster超过 12 年前
Been trying zsh for a while, ran fish for 1 or 2 years. Am back to bash because to many scripts rely on bash and wont't work on zsh or fish.<p>Thing is, it's note that hard to get the mentioned features in bash. Good tab completion, good git enabled color prompt, ssh completion, host completion, command completion and (my favorite) "start typing, press up, cycle through command history with the given input" aka reverse search. I really really liked fish. But incompatibility with bash was just too annoying after a while.
评论 #4586883 未加载
djcb超过 12 年前
I've been using zsh for a decade or so, and I like it quite a lot. For basic things, it works enough like bash to hardly notice it; but slowly I've learned all the special tricks.<p>Now, I would recommend against using /oh-my-zsh/ and the like wholesale; just add useful things to your zsh setup step-by-step, where you actually understand each step.<p>Otherwise you're just importing a blob of magic that can interact with other things in weird ways. /oh-my-zsh/ contains a lot of gems, but take them one by one.
nakkiel超过 12 年前
I'm not going to elaborate much because I feel I'll waste my and I have a plane to catch but I have yet to see a compelling argument to make me believe zsh is in any way superior to bash.<p>All posts on the subject show that theirs authors have been using a shell they don't know and have replaced it by another shell plus configuration files made up by someone more clever. All posts are also bullet lists of features bash can actually be configured to do.<p>Someone wake up.
评论 #4589069 未加载
reyan超过 12 年前
I use prezto (<a href="https://github.com/sorin-ionescu/prezto" rel="nofollow">https://github.com/sorin-ionescu/prezto</a> -- initially a fork of oh-my-zsh).
评论 #4587394 未加载
army超过 12 年前
I use zsh for day-to-day use. It's mostly been good to me but sometimes I contemplate switching back to bash because of the performance: sometimes zsh simply hangs for seconds at a time. I'm sure one extension or another is at fault and I could fix the performance issues by reconfiguring things, but I really don't want to put the time into doing that.
brcrth超过 12 年前
No, really. Use what you like/know. I hate posts about "you should use X because I like it".
评论 #4586329 未加载
评论 #4586204 未加载
tharris0101超过 12 年前
I used zsh for years. Loved it. I just don't do as much command line stuff anymore so vanilla bash works fine for me. I do miss the history stuff mentioned at the end of the article, though.
adambratt超过 12 年前
Been meaning to start using it for a while. You convinced me to download it and see what all the fuss was over.<p>Couldn't be happier!
评论 #4586046 未加载
zerop超过 12 年前
Not sure if this is good ask. But windows needs a tool like this. Why not have a port for windows as well.
评论 #4586720 未加载
grandalf超过 12 年前
just installed zsh but now my rvm is broken, any quick tips? tried adding the following to .zshrc but it doesn't appear to have fixed the issue:<p><pre><code> if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then source "$HOME/.rvm/scripts/rvm" ; fi</code></pre>
评论 #4586391 未加载
ta12121超过 12 年前
I've never read about zsh on HN before. I swear it officer.
y4m4超过 12 年前
what a joke!
lurker14超过 12 年前
As someone who used zsh for a while but got tired of setting it up everywhere I go and losing the "local community" bash stuff, I humbly request:<p>someone please post a rebuttal showing how to do all this in bash with appropriate .bashrc/functions and utility programs like fasd.
评论 #4587161 未加载
评论 #4588790 未加载