Re: How to know when mc is running in a terminal

2014-11-10 Thread Mike Smithson


Thanks frank. The answer was in front of my nose the whole time.

Environment variable MC_TMPDIR can be used to know that you're being
called from mc. For some reason MC_SID disappears but MC_TMPDIR does
not.

I needed something more specific than just knowing whether I'm
in pts or not. I want to know if it's mc's F4 EDIT command calling, or
at least being called from a terminal with mc running in it.

if [ -n $DISPLAY -a -n $MC_TMPDIR ]; then
# we're being called from mc in XWindow terminal
do_something_odd
fi


On Mon, 10 Nov 2014 02:06:26 -0800, frank y199mp1...@gmail.com wrote:




On 10/11/2014 01:25, Mike Smithson wrote:

how can a script know whether it is being
called from F4 in mc or just a terminal?


Try the shell command 'tty'. In the Linux console it will reply e.g.  
/dev/tty1. In a graphic terminal the reply will be /dev/pts/0.






--
Peace and Cheer
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


F3: *.gif ?!

2014-11-10 Thread chris glur
My Slakware-13 which auto-rendered *.gif, *.jpg, ... by mc: F3
developed a problem, causing me to use a 'fork' of an earlier Slakware,
which lacks zgv and gqview.

So I edited /etc/mc/mc.ext from:
 include/image
Open=if [ $DISPLAY =  ]; then zgv %f; else (gqview %f ); fi
View=%view{ascii} identify %f
to:
 include/image
 #  Open=if [ $DISPLAY =  ]; then zgv %f; else (gqview %f ); fi
   Open=if [ $DISPLAY =  ]; then gwenview %f; else (gqview %f ); fi
   View=%view{ascii} identify %f

gwenview is the only graphics-viewer that I could find and of course
 `gwenview graphicFile` test OK.

In mc, F3 gives error message:

/tmp/mc-root/mcextHhBNQd: line 2: identify: command not found
   and WHILE the error mesg is still showing
ls /tmp/mc-root/mcext*
 gives:
/tmp/mc-root/mcextAKNWOd
/tmp/mc-root/mcextHhBNQd
/tmp/mc-root/mcextfde6De

After I 'accept' mc's error message,
ls /tmp/mc-root/mcext*
shows that
  /tmp/mc-root/mcextHhBNQd
has gone.

OK, it was temporary. And the other 2 are 'previous dirt'?
==
Instead of F3, mousing gives:
 /tmp/mc-root/mcextpim7Oa: line 2: gqview: command not found

Let's try to redirect the gqview ?
 ln -s /usr/bin/gwenview /usr/local/sbin/gqview

OK, now mousing renders, but F3 shows the similar error-message.

Please advise.

== Chris Glur.
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc