[Edit: reframing to make the question more clear]

I use the Mac Terminal to access remote linux systems. On the Mac, the bash prompt is set by:

PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}\007"

On the remote LINUX system, the bash prompt is set to:

 PROMPT_COMMAND='printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'

(This path is set in the /etc/bashrc on the remote linux system, and is not editable by mere morals)

So, when I start a terminal, the title of my Terminal session looks like:

user@mymac -- -bash

(the "-- -bash" element appears to be added by Terminal)

And after i ssh to a linux system the title changes to:

otheruser@linuxbox:~ -- ssh linuxbox

(the "-- ssh linuxbox" element added by Terminal)

The problem is when I switch to an automount path on the REMOTE LINUX system like 'cd /net/hostname/path' where the NFS path is exported to the Linux system but NOT my Mac, terminal locks up. Every window, every tab becomes unusable.

The title at this point has been set to:

 otheruser@linuxbox:/net/hostname/path -- ssh linuxbox

I finally figured out that my Mac is trying to mount the file nfs file system referenced on the remote terminal session, which I believe is triggered by the title, since that's the only way place the '/net/... path is being passed, and the following mount command are running on my local Mac:

 $ ps -ef | grep automount    0   858     1   0 10:58AM ??         0:00.08 automountd
0  1003   858   0 11:03AM ??         0:00.00 /sbin/mount -o nobrowse -t nfs -o retrycnt=0 -o nosuid,nodev -o nosuid -o automounted -o nosuid hostname:/path   /net/hostname/path
0  1004  1003   0 11:03AM ??         0:00.01 /sbin/mount_nfs -o nobrowse -o retrycnt=0 -o nosuid -o nodev -o nosuid -o automounted -o nosuid hostname:/path /net/hostname/path

If I 'kill -9' the 'mount_nfs' command, terminal starts responding again until the title of the terminal is changed when the prompt updates. Which is frequently.

Why is terminal triggering a mount command locally in this case? How can I stop it? That is without having to change the prompt on the remote system.

  • Why do you expect OS X tp know that the path you give to cd does not exist - it is a valid name – Mark Oct 27 '15 at 16:06
  • To put it another way: why does OS X need to even think about (i.e. try to mount) a remote filesystem based on the title of a Terminal session? ...especially when that terminal session is to a remote system. – Ray Oct 28 '15 at 19:07
  • Like all Unices when you ask for pwd Unix expects the directory to be present and if not it helpfully tries to mount it – Mark Oct 28 '15 at 19:09
  • Mark- the 'pwd' is being executed on the remote system to build the prompt (and title). Not understanding why OS X cares, and tries to mount the path as well. – Ray Oct 28 '15 at 19:10
  • No pwd is always excited in the current system - you would need to exec to execute on any freight system – Mark Oct 28 '15 at 19:11

You must log in to answer this question.

Browse other questions tagged .