4

Every time I'm visiting a file system in remote machine and I execute a command (e.g. grep) the emacs buffer with the result of that command also contains my verbose .bash_profile output.

How could I disable this behavior? That is, how to make the remote command only load .bashrc? (In tramp my remote method is ssh)

Ocaso Protal
  • 19,362
  • 8
  • 76
  • 83

1 Answers1

6

I suggest to move everything in your .bash_profile that outputs text to the end of the file and put the following before these commands:

If [ "$TERM" == "dumb" ]; then
     return
fi

That should do it. Reread http://www.gnu.org/software/tramp/#Remote-shell-setup for more information.

Tom Regner
  • 6,856
  • 4
  • 32
  • 47
  • Thank you so much! I had the same issue, and was mislead by TRAMP's documentation saying to put the configuration in .bash_profile to "avoid incompatibilities", but it turns out TRAMP's connection is actually affected by .bash_profile – Adam Oudad Dec 22 '22 at 19:40