I am used to get headaches to find out a solution to have additional terminal that has independent environment with the main one. I searched via Google, nothing useful (because of my bad searching skill? I don't think so). I also tried iTerm and original OSX terminal together, pray for the magic appears, but it didn't not appear, of course, because they use same user bash. This action is just a hopeless action to prevent pulling my hair :D
So, why I crazily need this? Using multiple Heroku and AWS accounts with CLI pushed me to this situation. Imagine that I need to do heroku login
and fill username, password or aws configure
and fill keys (thanks for AWS CLI profile to resolve this but I still don't feel comfortable with it). This is really annoying when repeat them many times each day. Of course, I can write a bash file to do it more quickly but the separated terminal environment is still better :)
After some crazy hours, I realized that I made things complex myself, the solution is very simple (I think this is why I cannot find solution by searching, LOL): use 2 users, so easy. Just create additional user (namtv2), sudo su namtv2
and login second AWS, Heroku accounts, it works like a charm.
To create new user
-
OSX
If you are crazy fan of using terminal or you are anti-fan of using GUI, you can play with dscl to create user with nearly ten of commands
I will not use above option because using GUI is much easier. OpenUsers & Groups
preference and you will know how to create new user -
Ubuntu (other Linux distribution should be similar)
Ubuntu GUI to create user is not easier as terminal:
sudo adduser namtv2
and fill some information, it's all
Just a quick note to help others with same problem can find out solution quickly and prevent hopeless actions :)