0

I want to use iTerm with my default bash terminal because there is a lot of customization that i have done to my .bash_profile and I don't want to lose it or perform all the hard work again.

3
  • What makes you believe that using a different SSH client will somehow override your bash_profile?
    – Allan
    Jul 9, 2016 at 12:40
  • i thought iterm might have its own shell and installing it might not replace the original one
    – Ajay Singh
    Jul 9, 2016 at 13:07
  • The shell is on the server, not the client. The interior of a room doesn't change when you look through a different window.
    – Allan
    Jul 9, 2016 at 13:09

1 Answer 1

4

You are mixing up a couple of things here. Note there is no such thing as bash terminal.

iTerm and Terminal are applications that start up a defined program - by default it is /usr/bin/login. This program starts a shell (listed in /etc/shells) by default this is /bin/bash.

bash reads ~/.bash_profile if it is started by login (or with a -l parameter), bash does not care if it is started by iTerm or Terminal. (There might be environment variables set depending on what starts bash e.g. ITERM_* from iTerm and TERM_PROGRAM by both)

iTerm and Terminal store their defaults in different places (both within ~/Library/Preferences) and do not write to ~/.bash* files.

Thus your ~/.bash_profile will be run by both iTerm and Terminal and will not be affected by them except if you test on certain variables

2
  • what if i want to use different bash_profiles/ vimrc for terminal and iTerm?
    – Ajay Singh
    Jul 9, 2016 at 13:08
  • you don;t you test on the value of TERM_PROGRAM for bash
    – mmmmmm
    Jul 9, 2016 at 14:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .