View previous topic :: View next topic |
Author |
Message |
Linubie Guru
Joined: 11 Jun 2004 Posts: 380
|
Posted: Fri Oct 11, 2024 1:21 pm Post subject: midnight commander doesn't stay in directory |
|
|
I've added
Code: | alias mc='. /usr/libexec/mc/mc-wrapper.sh' |
to /etc/bash/bashrc
opening KDE Konsole and execute:
Code: | alias mc='. /usr/libexec/mc/mc-wrapper.sh' |
and then
neither works.
I need to change the directories with cd. _________________ Mircosoft software is like having sex with a stranger, you always have to be careful not to get infected with something... |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 22495
|
Posted: Fri Oct 11, 2024 3:29 pm Post subject: |
|
|
From the output you provided, it looks like the alias mc should be invoked. What do you see that makes you think it did not work? |
|
Back to top |
|
|
Banana Moderator
Joined: 21 May 2004 Posts: 1674 Location: Germany
|
|
Back to top |
|
|
Linubie Guru
Joined: 11 Jun 2004 Posts: 380
|
Posted: Fri Oct 11, 2024 5:55 pm Post subject: |
|
|
Well opening mc, changing directories and quit mc I am in the same directory, in that I began before starting mc ;O)
Let's say I started mc in directory /usr change the directory within mc to /etc and after quiting mc I am still in /usr instead of /etc.
This is what /usr/libexec/mc/mc-wrapper.sh should accomplish. _________________ Mircosoft software is like having sex with a stranger, you always have to be careful not to get infected with something... |
|
Back to top |
|
|
Linubie Guru
Joined: 11 Jun 2004 Posts: 380
|
Posted: Fri Oct 11, 2024 6:05 pm Post subject: |
|
|
deleting
Code: | alias mc='. /usr/libexec/mc/mc-wrapper.sh' |
from /etc/bash/bashrc
and adding
Code: | . /usr/libexec/mc/mc.sh |
to ~/.bashrc
neither works for me
edit: And I restarted the PC ;O) _________________ Mircosoft software is like having sex with a stranger, you always have to be careful not to get infected with something... |
|
Back to top |
|
|
flexibeast Guru
Joined: 04 Apr 2022 Posts: 407 Location: Naarm/Melbourne, Australia
|
Posted: Fri Oct 11, 2024 10:54 pm Post subject: |
|
|
Looking at the source of /usr/libexec/mc/mc-wrapper.sh:
Code: | MC_USER=`whoami`
MC_PWD_FILE="${TMPDIR-/tmp}/mc-$MC_USER/mc.pwd.$$"
/usr/bin/mc -P "$MC_PWD_FILE" "$@"
if test -r "$MC_PWD_FILE"; then
MC_PWD="`cat "$MC_PWD_FILE"`"
if test -n "$MC_PWD" && test "$MC_PWD" != "$PWD" && test -d "$MC_PWD"; then
cd "$MC_PWD"
fi
unset MC_PWD
fi
rm -f "$MC_PWD_FILE"
unset MC_PWD_FILE
unset MC_USER |
what are the contents of `${TMPDIR-/tmp}/mc-$MC_USER/mc.pwd.$$` when mc is running? _________________ https://wiki.gentoo.org/wiki/User:Flexibeast |
|
Back to top |
|
|
Banana Moderator
Joined: 21 May 2004 Posts: 1674 Location: Germany
|
|
Back to top |
|
|
spica Guru
Joined: 04 Jun 2021 Posts: 325
|
Posted: Sat Oct 12, 2024 9:01 am Post subject: |
|
|
Linubie wrote: | I started mc in directory /usr change the directory within mc to /etc and after quiting mc I am still in /usr instead of /etc. |
Does this command create /tmp/mc_was_invoked_in_this_dir.txt ? backslash is to make sure it is not an alias Code: | \mc -P /tmp/mc_was_invoked_in_this_dir.txt |
What version of mc is installed? I observe the version app-misc/mc-4.8.30-r2 does not create the file, but app-misc/mc-4.8.32 does |
|
Back to top |
|
|
|