[mc-devel] mc exit to current directory behavior

Dave Plater daveplater at vodamail.co.za
Fri Jun 23 13:48:59 UTC 2023


On 2023/06/21 12:49, Andrey Smirnov via mc-devel wrote:
> On 20.06.2023 18:29, Dave Plater via mc-devel wrote:
>> Hi, openSUSE's recent stable release upgrade from kde plasma5 gui 
>> from v24.4 to v27.4 has caused mc to exit into the directory it was 
>> started from instead of into mc's current directory. This is being 
>> discussed in:
>>
>> https://bugzilla.suse.com/show_bug.cgi?id=1203617
> Did you try adding the following line that sources a wrapper when you invoke mc to your .bashrc or other place where it can be sourced? This bugzilla issue contains different ways of how to do this.
>
> alias mc='source /usr/share/mc/mc-wrapper.sh'
>
> Bugzilla discussion hints that something is changed in a way the 
> /etc/profile.d scripts are sourced. Check if the shell from which you 
> invoke mc is actually bash (not ash or something).
>
> The simplest way of checking if you have the wrapper set up is to 
> issue command "alias" from the terminal emulator from which you try to 
> invoke mc. Its output should have the line mentioned above.
>
> Best regards,
>
>  Andrey Smirnov
>
> Thanks for the replies, starting mc with the wrapper script doesn't 
> fix this problem it's only fixed with "[ $(type -t mc) = "file" ] > && 
> . /etc/profile.d/mc.sh || true" .

The "." is the part I've been missing "help ." gives "Execute commands 
from a file in the current shell". Plain /etc/profile.d/mc.sh doesn't 
work but with "." included first it works ie. ". /etc/profile.d/mc.sh && 
mc" which can be added to the wrapper will solve my dilemma. Somehow kde 
have introduced something that runs virtual console scripts in a 
sandbox, I made a simple script:

#! /usr/bin/bash

   dirc()
   {
   pushd ../../
   }

   dirc

and on execution I see the normal output of pushd but remain in the 
original directory.

The next problem is getting kde to backtrack or find the commit and 
patch it out but meanwhile I have a doable work around.

Thanks for a great console level file manager it is a valuable tool and 
saves lots of typing when finding distant directories with long names.

Regards

Dave



More information about the mc-devel mailing list