On 03Nov2011 07:55, Tim Johnson <t...@akwebsoft.com> wrote:
| * Cameron Simpson <c...@zip.com.au> [111102 18:51]:
| > Ok, now running iTerm2. How do you invoke mutt then? A special iterm2
| > profile or something else?
|
|   I just use /opt/local/bin/mutt as the command in a profile.
|   I can also launch mutt directly from the default profile. In that
|   case, mutt gets the save environment as the shell (of course).
|   So, when one picks a 'Command' option under the 'Command' group,
|   an abbreviated environment is provided?
|
|     And furthermore, if I were to set the Command option as "Login
|       Shell" and for the "Send text at start" enter 'mutt', then
|       when I launch the profile, mutt gets the environment from the
|       login shell, _with_ full paths.

That sounds right. Taking the latter case first, mutt gets the environment
because your login shell has build the environment before mutt gets
invoked.

For the former case, mutt gets invoked possibly directly by iTerm2, more
likely by haning the string "/opt/local/bin/mutt" to /bin/sh or your
own shell, but _not_ as a login shell. So your personal environment
setup has not been run. This situation is common in "GUI desktop"
environments, where the sequence is:

  GUI -> terminal-app -> command

~/.bash_profile et al don't get used along that path.

By contrast, a text mode UNIX system goes:

  getty -> login-shell -> start-window-system -> terminal-app -> command

and your login environment setup gets in right at the start.

Upshot: all new terminals on your Mac really want to source your login
environment. For your default profile you're running a login shell so it
is all done. For the others you need to tweak the command in the
profile.

You currently have:

  /opt/local/bin/mutt

Try changing the mutt profile to one of these:
  /opt/css/bin/with-login-env /opt/local/bin/mutt
or
  bash --login -c /opt/local/bin/bash

The only reason I mention the former is that it plays nicely if the
command has arguments which need quoting, eg:

  mutt -e 'some mutt setup commands'

with-login-env lets you use that raw:
  with-login-env mutt -e some-setup-commands'

whereas the latter needs nested quotes:
  bash --login -c 'mutt -e "some mutt setup commands"'

which will get nasty quite fast if there are shell/mutt $-strings in
the commands.

Cheers,
-- 
Cameron Simpson <c...@zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/

In politics, sincerity is everything.
If you learn to fake that, you've got it made.
        - Paul Austin <paus...@harris.com>

Reply via email to