Midnight Commander [MC] - help for Option - Slackware

This is a discussion on Midnight Commander [MC] - help for Option - Slackware ; Hi. So1 kows how to stay in the selected directory when you exit from MC. ? I remember there was an option to fix somewhere but I don't remember. Thank you...

+ Reply to Thread
Results 1 to 7 of 7

Thread: Midnight Commander [MC] - help for Option

  1. Midnight Commander [MC] - help for Option

    Hi.
    So1 kows how to stay in the selected directory when you exit from MC. ?
    I remember there was an option to fix somewhere but I don't remember.

    Thank you






  2. Re: Midnight Commander [MC] - help for Option

    On Wed, 25 Jun 2008, ricky wrote:

    >
    > Hi.
    > So1 kows how to stay in the selected directory when you exit from MC. ?
    > I remember there was an option to fix somewhere but I don't remember.



    in /usr/share/mc/bin/mc-wrapper.csh

    I use ....


    set MC_USER="`id | sed 's/[^(]*(//;s/).*//'`"

    if ($?TMPDIR) then
    setenv MC_PWD_FILE $TMPDIR/mc-$MC_USER/mc.pwd.$$
    else
    setenv MC_PWD_FILE /tmp/mc-$MC_USER/mc.pwd.$$
    endif

    /usr/bin/mc -P "$MC_PWD_FILE" $*

    if (-r "$MC_PWD_FILE") then
    setenv MC_PWD "`cat '$MC_PWD_FILE'`"
    if ( -d "$MC_PWD" ) then
    cd "$MC_PWD"
    endif
    unsetenv MC_PWD
    endif

    rm -f "$MC_PWD_FILE"
    unsetenv MC_PWD_FILE






    --
    Cheers
    Res
    --- Usenet policy, and why I might ignore you ---
    1/ GoogleGroups are UDP'd on my nntp server. If you use them, don't
    waste your time or energy replying to me.

    2/ If only cleanfeed filtered out trolls as well as spam, usenet would be
    a nicer place.

  3. Re: Midnight Commander [MC] - help for Option

    On Wed, 25 Jun 2008, Res wrote:

    > On Wed, 25 Jun 2008, ricky wrote:
    >
    >>
    >> Hi.
    >> So1 kows how to stay in the selected directory when you exit from MC. ?
    >> I remember there was an option to fix somewhere but I don't remember.

    >
    >
    > in /usr/share/mc/bin/mc-wrapper.csh
    >
    > I use ....
    >
    >
    > set MC_USER="`id | sed 's/[^(]*(//;s/).*//'`"
    >
    > if ($?TMPDIR) then
    > setenv MC_PWD_FILE $TMPDIR/mc-$MC_USER/mc.pwd.$$
    > else
    > setenv MC_PWD_FILE /tmp/mc-$MC_USER/mc.pwd.$$
    > endif
    >
    > /usr/bin/mc -P "$MC_PWD_FILE" $*
    >
    > if (-r "$MC_PWD_FILE") then
    > setenv MC_PWD "`cat '$MC_PWD_FILE'`"
    > if ( -d "$MC_PWD" ) then
    > cd "$MC_PWD"
    > endif
    > unsetenv MC_PWD
    > endif
    >
    > rm -f "$MC_PWD_FILE"
    > unsetenv MC_PWD_FILE
    >




    oops I prefer tcsh if you are using bash ...
    in /usr/share/mc/bin/mc-wrapper.sh


    MC_USER=`id | sed 's/[^(]*(//;s/).*//'`
    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 -d "$MC_PWD"; then
    cd "$MC_PWD"
    fi
    unset MC_PWD
    fi

    rm -f "$MC_PWD_FILE"
    unset MC_PWD_FILE


    ..... most of my boxes have been upgrades through upgrades etc etc, so I
    have no idea if thats what in a 'fresh install' on mc these days.

    --
    Cheers
    Res
    --- Usenet policy, and why I might ignore you ---
    1/ GoogleGroups are UDP'd on my nntp server. If you use them, don't
    waste your time or energy replying to me.

    2/ If only cleanfeed filtered out trolls as well as spam, usenet would be
    a nicer place.

  4. Re: Midnight Commander [MC] - help for Option

    Thank for your help.
    Unfortunatly my scripts (in mc.sh and mc.csh) are exactly the sameand do not
    work.
    Any other Idea ?


    "Res" a écrit dans le message de news:
    Pine.LNX.4.64.0806252245370.7415@ebfjryy.nhfvpf.ar g...
    > On Wed, 25 Jun 2008, Res wrote:
    >
    >> On Wed, 25 Jun 2008, ricky wrote:
    >>
    >>>
    >>> Hi.
    >>> So1 kows how to stay in the selected directory when you exit from MC. ?
    >>> I remember there was an option to fix somewhere but I don't remember.

    >>
    >>
    >> in /usr/share/mc/bin/mc-wrapper.csh
    >>
    >> I use ....
    >>
    >>
    >> set MC_USER="`id | sed 's/[^(]*(//;s/).*//'`"
    >>
    >> if ($?TMPDIR) then
    >> setenv MC_PWD_FILE $TMPDIR/mc-$MC_USER/mc.pwd.$$
    >> else
    >> setenv MC_PWD_FILE /tmp/mc-$MC_USER/mc.pwd.$$
    >> endif
    >>
    >> /usr/bin/mc -P "$MC_PWD_FILE" $*
    >>
    >> if (-r "$MC_PWD_FILE") then
    >> setenv MC_PWD "`cat '$MC_PWD_FILE'`"
    >> if ( -d "$MC_PWD" ) then
    >> cd "$MC_PWD"
    >> endif
    >> unsetenv MC_PWD
    >> endif
    >>
    >> rm -f "$MC_PWD_FILE"
    >> unsetenv MC_PWD_FILE
    >>

    >
    >
    >
    > oops I prefer tcsh if you are using bash ...
    > in /usr/share/mc/bin/mc-wrapper.sh
    >
    >
    > MC_USER=`id | sed 's/[^(]*(//;s/).*//'`
    > 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 -d "$MC_PWD"; then
    > cd "$MC_PWD"
    > fi
    > unset MC_PWD
    > fi
    >
    > rm -f "$MC_PWD_FILE"
    > unset MC_PWD_FILE
    >
    >
    > .... most of my boxes have been upgrades through upgrades etc etc, so I
    > have no idea if thats what in a 'fresh install' on mc these days.
    >
    > --
    > Cheers
    > Res
    > --- Usenet policy, and why I might ignore you ---
    > 1/ GoogleGroups are UDP'd on my nntp server. If you use them, don't
    > waste your time or energy replying to me.
    >
    > 2/ If only cleanfeed filtered out trolls as well as spam, usenet would be
    > a nicer place.




  5. Re: Midnight Commander [MC] - help for Option


    ricky wrote :

    > Any other Idea ?


    Use the key before you close mc, the directory in active panel
    will be forgotten and the directory in not active panel will be
    remembered.

    Or you could start mc this way 'mc ~/Dir1 ~/Dir2' then these two
    directories will show up in the panels.
    --
    Thomas O.

    This area is designed to become quite warm during normal operation.

  6. Re: Midnight Commander [MC] - help for Option

    On Thu, 26 Jun 2008, ricky wrote:

    >
    > Thank for your help.
    > Unfortunatly my scripts (in mc.sh and mc.csh) are exactly the sameand do not
    > work.
    > Any other Idea ?
    >


    How did you install it? Where did you get it from and what is the exact
    package name you are using, I'll see if it differs.

    Mines... ls /var/log/packages/mc*
    /var/log/packages/mc-4.6.1_20070309-i486-2


    --
    Cheers
    Res
    --- Usenet policy, and why I might ignore you ---
    1/ GoogleGroups are UDP'd on my nntp server. If you use them, don't
    waste your time or energy replying to me.

    2/ If only cleanfeed filtered out trolls as well as spam, usenet would be
    a nicer place.

  7. Re: Midnight Commander [MC] - help for Option

    On Thu, 26 Jun 2008, Thomas Overgaard wrote:

    >
    >
    > ricky wrote :
    >
    >> Any other Idea ?

    >
    > Use the key before you close mc, the directory in active panel
    > will be forgotten and the directory in not active panel will be
    > remembered.
    >
    > Or you could start mc this way 'mc ~/Dir1 ~/Dir2' then these two
    > directories will show up in the panels.
    >


    A better thing to do is set, say the left panel, as 'info' .. if he's
    running the same version as I am, maybe this is where it is faulting, as I
    have always used left panel for info so we only ever see one dir/file
    listing, in the old days we used to have to modify as it never remembered
    the current dir, but I thought we changed that a few years ago.

    --
    Cheers
    Res
    --- Usenet policy, and why I might ignore you ---
    1/ GoogleGroups are UDP'd on my nntp server. If you use them, don't
    waste your time or energy replying to me.

    2/ If only cleanfeed filtered out trolls as well as spam, usenet would be
    a nicer place.

+ Reply to Thread