top | item 6950891

Bashstrap – For your OS X terminal

73 points| barryclark | 12 years ago |github.com | reply

51 comments

order
[+] krrrh|12 years ago|reply
I remember spending so many happy hours customizing bash back in my early years with unix. Now I'm older and wiser, and I just use fish.

http://fishshell.com

I think that it should be especially appreciated by those who use OSX for its "it just works" approach. A couple of pro tips:

* Instead of running chsh to change your default login shell just change the shell command for Terminal.app it iTerm. This means that scripts in cron etc will still run under bash and you won't break anything accidentally.

* Just like with zsh if you want to get customized there is something called oh-my-fish that helps a bit, but seriously you're 90% there with the defaults.

[+] SnowLprd|12 years ago|reply
My tutorial for setting up fish on Mac OS X and Ubuntu: http://hackercodex.com/guide/install-fish-shell-mac-ubuntu/

I've never had any trouble using chsh to make fish the default shell. Bash scripts in crontabs still run under bash -- not sure why anyone would think otherwise. Plus, changing the shell command for iTerm/Terminal won't help with remote servers, so using chsh everywhere means you always get a consistent shell experience, no matter whether you're using your terminal locally or remotely.

[+] mmanfrin|12 years ago|reply
Fish is wonderful, but as someone who is novice to middling in skill (2 years), I found the fact that it had a different set of syntaxes to be difficult to work with. Instructions for random things to install I found all used bash syntax, which broke when used in fish.

I've since switched to zsh, and I am terribly happy with it. It has a lot of the nice advanced features that fish has, without breaking from bash syntax.

[+] kika|12 years ago|reply
Clicked on comments to say the same. When I discovered fish, I felt like "where have I been". But there's one downside though: I got used (used as in muscle reflexes) to things like ls -l `where something` and they do not work anymore, fish is not backwards compatible with bash.
[+] _frog|12 years ago|reply
Agreed. In my experience fish just runs a heck of a lot faster than either zsh or bash as well as adding some features I love, like the command syntax highlighting and autocomplete. I couldn't see myself going back to either of those after using it for an extended period of time.
[+] estebanrules|12 years ago|reply
I would like to use fish shell but my .bash_profile is setup exactly as I want it, and when I've switched to other shells before (zsh) it has been a general pain in the ass. How do I retain my current bash settings in fish shell?
[+] toupeira|12 years ago|reply
Calling this "Bootstrap for Bash" is pretty disingenuous, all I can see are a bunch of configuration files that are very basic and hard-coded to your own usage.
[+] clarry|12 years ago|reply

  It cuts out the fluff
To me it looks like the exact opposite.
[+] jpttsn|12 years ago|reply
I had the same feeling. I already know my username, and if there's a directory name before my prompt the "in" is implicit.
[+] gwu78|12 years ago|reply
You are not alone.

I'd go further and say anyone who prefers Bash is someone who does not mind a little or even a lot of fluff.

[+] r4d2|12 years ago|reply
This is just some fancied up bashrc.

A (much) better alternative would be to install zsh with oh-my-zsh (https://github.com/robbyrussell/oh-my-zsh).

[+] atmosx|12 years ago|reply
zsh is broken and breaks X times per year. It's annoying, really. I'm tired of wasting time configuring terminals time and again because the new version of XYZ package is broken.

Anyone who does not enjoy spending huge amounts of time trouble-shooting on the terminal should use bash. It's the default in most distributions, it supports all major features a modern shell should.

[+] barryclark|12 years ago|reply
Yep! I did take a look at oh-my-zsh but decided not to go that route, I didn't like the aesthetic of many of the themes and Bash is capable of a lot of zsh's features now.
[+] chanced|12 years ago|reply
Came here to say the same. +1 to oh my zsh
[+] aremm|12 years ago|reply
This is quite sad, for a better alternative starter check out Paul Irish's which seems to be based on mathias's. The link is here: https://github.com/paulirish/dotfiles
[+] mathias|12 years ago|reply
Indeed, looks like Bashstrap is a fork of my dotfiles (without giving any credit, sadly). A lot of the commands, file structure, and even parts of the readme are a direct copy-paste.
[+] poolpool|12 years ago|reply
Since everyone likes mentioning oh-my-zsh I figured I would mentioned prezto

https://github.com/sorin-ionescu/prezto

which is a very nice alternative and much smaller.

[+] rayshan|12 years ago|reply
^This. Prezto a git workflow makes personalization easily maintainable and deployment in new environments a snap.
[+] dinedal|12 years ago|reply
I'm a zsh-er and use oh-my-zsh, but I borrowed the syntax highlighting, called it `sat` short for "source cat", and piped through less for paginated output:

  # before use: [sudo] easy_install pygments
  alias sat='pygmentize -O style=monokai -f console256 -g | less'
I like these kinds of projects, because someone always shows me something in my set up I don't have, and it's really trivial to borrow from them.

In return, I feel everyone should have a proper git log alias, here's mine:

  alias logg="git log --graph --oneline --all --decorate --abbrev-commit"
Example output: http://d.pr/i/B9LT
[+] barryclark|12 years ago|reply
That's awesome. Will definitely be adding it in, thanks!
[+] devNoise|12 years ago|reply
The one thing I always add to my profile is "export COMMAND_MODE=unix2003". This will make some commands behave as you would expect them to under Linux instead of BSD.

Don't recall seeing that in my brief scan of the dotfiles.

[+] Qerub|12 years ago|reply
For the record: COMMAND_MODE=unix2003 is already default in Terminal(.app), but it should definitely be set for iTerm.
[+] dylandrop|12 years ago|reply
The one area where I see this lacking is git autocomplete. Also personally I wouldn't use the `s .` command for Sublime... maybe you could make some of the aliases configurable rather than default?
[+] nichochar|12 years ago|reply
Oh My ZSH works very well for me. Love it
[+] dmtroyer|12 years ago|reply
+1 for Oh My Zsh. Has plugins for git, sublime_text, etc, and great support.
[+] sneak|12 years ago|reply
What's wrong with $EDITOR?

Why would I want a terminal command for using a GUI editor?

Why would I want a GUI editor at all?

[+] Karunamon|12 years ago|reply
>Why would I want a terminal command for using a GUI editor?

Because you use Sublime Text and you spend a lot of time at the CLI?