2

When I create a local shell session in MobaXterm with the CMD "terminal shell" selected, the MobaXterm path %USERPROFILE%\Documents\MobaXterm\slash\binis prepended to my full path. This is breaking multiple programs for me, such as Vim, Python, git and ssh. I have these programs installed on my system, and they work correctly from a normal command prompt.

However, since the MobaXterm insists on adding its own path, it forces me to use the ones installed in slash\bin, which do not work correctly.

I have already checked the "Use Windows PATH" box in the session's Terminal Settings. The Windows path is available, but any name collisions resolve to MobaXterm's binaries since it comes first.

There is a related question on Stack Overflow that asks why MobaXterm does this, but I don't care why. I just want to open a local CMD prompt and have it behave the same way as if I had opened cmd.exe.

I am using Personal Edition v9.4 on Windows 10.

TL;DR
How can I make MobaXterm stop prepending its path to the path used in a local CMD session?

2 Answers 2

1

In MobaXterm v10.7, there is a line in /etc/profile (which is actually %USERPROFILE%\Documents\MobaXterm\slash\etc\profile) that reads:

PATH="/bin:$PATH"

Removing this line should accomplish what you want.

(I have no reason to think it is different in v9.4 which you are using.)

3
  • Thanks for the suggestion, but that didn't seem to work. I noticed that Moba tries to rewrite the profile file on startup, but even after marking the file as read-only and ensuring that that line stays removed after startup, the Moba path is still there. I don't think this file is even used when starting a windows command prompt session.
    – skrrgwasme
    Commented Aug 15, 2018 at 16:42
  • @skrrgwasme wait, is it in a DOS prompt that you see the modified PATH?
    – Wildcard
    Commented Aug 15, 2018 at 16:47
  • Yup. I thought I explained that well enough in my question.
    – skrrgwasme
    Commented Aug 15, 2018 at 17:04
1

I ran into the same problem, with mobaxterm putting its version of nslookup in front of WSL's, the only way I could see to 'fix' this is to hardcode my path in my ~/.bashrc

ie:

echo $PATH

Then cut and paste output into your ~/.bashrc and remove the offending mobaxterm entries

Not ideal, but it works

You must log in to answer this question.

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