How to change directory in Midnight Commander on Windows, using functions

49 Views Asked by At

In Midnight Commander (MC) on Linux, when I execute a bash script function (which is on the $PATH in .bashrc):

function cdtmp {
  cd /tmp
}

Current panel (of the MC) is changed to that location (/tmp).

In Midnight Commander on Windows, when I execute a powershell script function, I can see that it was executed, but MC panels stay unchanged.

I found a workaround with sending commands to mc.pipes file which works with powershell , but not with batch files for me. Anyway, I would like to understand the main issue and how to fix it. I guess it is about using a new/separate shell on Windows vs running stuff in active/current shell on Linux.

0

There are 0 best solutions below