Home directory associated with application—how can I undo this? For some weird reason I don't understand my home directory got associated with a program (TextWrangler):



Now every time I try to open my home directory in the Finder, TextWrangler gets started. How can I get the normal behaviour back?

I use Mavericks (10.9).
Try this in Terminal:

SetFile -a B "$HOME"


Original credit to this goes to Tantek Çelik. I just happened to remember finding his post when I was trying to fix a different problem getting VLC to play .dvdmedia files.

Note that if you do not have /usr/bin/SetFile then you may need to install the command line tools for Xcode. If you are not automatically prompted to install that, you should be able to install them by entering this line in Terminal:

xcode-select --install


which will prompt you to install them using a dialog box like this:



Just click 'Install' you don't need "Get Xcode" unless you want the whole thing.

If that doesn't work, the next thing I would try is:

xattr -d com.apple.FinderInfo "$HOME"


which will remove extended attributes from "$HOME" but I am not sure if there are attributes that it would remove which you would be better off keeping, so I hesitate to suggest it. Use as your own risk/YMMV, etc.