How to edit hosts with TextEdit on Yosemite?
Yes I just tried your command and it exists with error code 132 (I don't know why). 

You can still use this to open your hosts file sudo open -t /etc/hosts. It will open the TextEdit app, if you want to run it in the background you can add your -b in the command line.  Or you can use other text editors like vim and nano they're both working perfectly with Yosemite.