What I want to do: open an iTerm window/tab, and ssh to some remote system. On that remote system, I need the following exports to be "effective":

export LANG="C"
export LC_ALL="C"

When I open that iTerm tab/window manually, and type ssh whatever.host ... that works nicely (as I have these exports in my .bashrc on my Mac).

Now I configured Firefox to use iTerm for ssh-URIs, like ssh://whatever.host.

That works like I charm - I can click such URLs and a new iTerm tab/window shows up, and ssh was already called, and I am logged into that remote host. But: these exports are not visible.

I tried to use .bashrc, .bash_login, .bash_profile and also put the exports file into a ./ssh/rc file.

But nothing seems to work ( I checked stuff such as superuser or ssh documentation).

And just to be fully precise: actually, in my home directory, my .bash_profile file is a link to .bashrc. But even when I just put these exports into three .bash login/profil/rc files it doesn't help. : the "manual" ssh sees the exports, but an iTerm triggered by Firefox does not.

In other words: how can I make sure that the ssh session that is "triggered" using an iTerm session sees these exports?

( and no, I can't simply change the .bashrc on the remote systems to contain the required exports )

  • What do you mean, "you can't get it to work when Firefox is triggering the iTerm session"? I don't see how an external app triggering iTerm will affect your environment variables on a remote host. – Allan Mar 8 '18 at 11:16
  • It's still not clear. 1) How is FF triggering iTerm? 2) Where are these environment variables set, on your local Mac or on a remote host? 3) What ssh session is being established? – Allan Mar 8 '18 at 11:31
  • @Allan Lets try again, hopefully it is clear now. – GhostCat Mar 8 '18 at 11:43
  • When you log into the remote host, issue the command echo $0 and post the output. – Allan Mar 8 '18 at 12:34
  • @Allen: that gives -bash – GhostCat Mar 8 '18 at 12:38

You must log in to answer this question.

Browse other questions tagged .