Re: rules in mc.ext

2022-09-15 Thread Jörg Thümmler

Am 16.09.22 um 06:31 schrieb Fourhundred Thecat via mc:

Hello,

can I change the default internal viewer to something else (less)? I
think I could change each line individually:

   View=%view{ascii} mediainfo %f

to

   View=mediainfo %f | less

but I would rather change this once, globally.

Also, I am confused how the include directive works in mc.ext. As it
says in mc.ext, the rules are applied from top to bottom. Therefore, I
want to have exact, specific rules at the top

   shell/i/.tar.xz

and vague, "dirty-hack" rules as low as possible, ie

   type/^PC\ bitmap

I also think calling external command "file" is expensive, so I don't
want to call it too early, when simple regex rule is sufficient.

Anyways, so I have relatively early:

   shell/i/.gif
     Include=image

   include/image
     Open=([ "$DISPLAY" ] && gpicview %f >/dev/null 2>&1 &)
     View=%view{ascii} file %f

and at the bottom, I have:

   type/^PC\ bitmap
     Include=image

but this does not work because this last rule is after "include/image".
I thought, "include/image" just defines what "Include=image" means. But
apparently it must be right after I used "Include=image" ?

Lastly, is there some optimization in processing this decision tree?
Lets say I have 100 rules in mc.ext. And I press F3 on file.foo. MC goes
from top to bottom, testing each rule. If there are 50 rules "type/",
does it mean MC calls the file command 50 times (if it does not find
match earlier) ?

PS: I am using my original mc.ext file, which I kept over upgrades. I
noticed the format has changed, and it now uses scripts stored in
/usr/lib/mc/ext.d/:

   View=%view{ascii} /usr/lib/mc/ext.d/archive.sh view tar.xz

I would like to stick with my original format.

thank you,
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


Hi,

you can change viewer and editor globally:

press F9 - goto Options - Configuration and unselect "use internal 
viewer" (and if you want, "internal editor" as well). MC will use now, 
whats globally set for your system/user. Less (and vi(m) as editor i assume.


If you set and export VIEWER and EDITOR env variables before calling mc, 
you can change this to whatever you want...


--
cu

jth
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


Re: shift-Fn keys shifted by two in tmux

2021-12-16 Thread Jörg Thümmler

Am 15.12.21 um 13:47 schrieb Marco:

On Mon, 13 Dec 2021 08:43:01 +0100
Jörg Thümmler  wrote:


can you check which keycodes are sent by the Shift-Fn-Keys in other
apps running in tmux? They are correct?


“xev” lists:

   keycode 50 (keysym 0xffe1, Shift_L)
   …
   keycode 71 (keysym 0xffc2, F5)

if I press - regardless if launched from within tmux or
not.


An what happens, if you open another terminal app in tmux and there
call mc? Same "keyshifting"?


I'm not sure what you mean by “another terminal app”. Another window
in tmux you mean? Starting a 2nd instance of mc in another window
yields the same result.

I just tried it on the console (no X) and the issue vanishes. This
makes my believe it has nothing to do with mc, rather it's a
misconfiguration of my terminal emulator.

Thanks for the nudge in the right direction.

Marco



Hi Marco,

what I meant was

- starting, say xterm or rxvt and then mc: what does shift+f5
- then closing mc and starting tmux in the xterm or rxvt-window and then 
checking, what shift+f5 does... does the behavior change?
- i sometimes watch some inheriting, so if the behavior is different in 
these cases it must be a terminal programs problem...


btw did you try the "keylerning" for mc in tmux (backup ~/.config/mc/ini 
first), did the shift+fn keys work there?


--
cu

jth
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


Re: shift-Fn keys shifted by two in tmux

2021-12-12 Thread Jörg Thümmler

Am 11.12.21 um 16:35 schrieb Marco via mc:

Hi,

when I start mc in a terminal everything works ok. However, if I
start mc in tmux the shift-Fn keys are shifted by two. That means
that rename, which is shift-F6 usually, is shift-F8 under tmux.
And shift-F6 will edit the file in tmux.

Muscle memory doesn't pay attention to tmux running and I keep
launching the wrong operations. Why is that and how can it be
fixed?

Marco

GNU Midnight Commander 4.8.27
tmux 3.2a
TERM=rxvt-unicode-256color (terminal)
TERM=screen-256color (tmux)
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc



Hi,

can you check which keycodes are sent by the Shift-Fn-Keys in other apps 
running in tmux? They are correct? I would think, it's a general tmux 
keycode problem. I don't use tmux, can you set custom keymappings there?


An what happens, if you open another terminal app in tmux and there 
call mc? Same "keyshifting"?


--
cu

jth
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


Re: keymap problem with 4.8.27

2021-11-10 Thread Jörg Thümmler

Am 10.11.21 um 19:24 schrieb Henning:

Part of the keys are mine, part are not.
Especially I'm unable to prevent f1 to call the internal Help. I had 
banned it to f20 because I never use it. Instead I Use f1 to invoke the 
hotlist becaus ctrl-\ not usable with german keyboard layout.

Also, I invoked search with ctrl-f because alt-? is not usable here.
But it doesn't work any more.

I replaced every keymap file (in /etc/mc, /root/.config/mc and 
/usr/share/mc) with a link to my keymap and also copied default.keymaps

out of the way, but to no avail.

So, currently I am changing keymap.c to use my keys. Of course this 
shouldn't be necessary.


henning

P.S. I really appreciate your work on mc. I came to mc directly from DOS 
Norton Commander n the end of the 90s and have it used ever since in 
whatever Linux/Unix installation. It is, together with bash and sed one 
of the programmes I always ensure to have and I always compile myself.


henning
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


Henning,

it will not touch your other problems but i have german 
utf8-xfce4-terminal and german latin1-putty terminals running. In both 
cases ctrl-\ works in mc calling hotlist. First pressing ctrl, then add 
altgr and then the ß?-key right from 0 on a german keybord.


Your P.S. could be written by me...

--
cu

jth
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


Re: Help testing release candidate / mc-4.8.27-rc1

2021-08-03 Thread Jörg Thümmler

Hi there,

TLDR; I would appreciate if you could please test the following 
tarball on your systems and report any blocker regressions as compared 
to the previous 4.8.26 release:


https://www.midnight-commander.org/nopaste/tarball/mc-4.8.27-pre1.tar.xz

$ sha256sum mc-4.8.27-pre1.tar.xz
d922e4175a20779549c4a9746bbe169d4acd2a83b2e14d1d6dfd2cbec32eb12b  
mc-4.8.27-pre1.tar.xz


I've built this tarball out of the latest master with translations 
from Transifex pulled in on a fresh Fedora 33 VM, which I'm also going 
to use to build the final release in about a week from now if nothing 
serious comes up.


Many thanks!


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


Hi,

i tried and endet up with:

make[3]: Verzeichnis „/home/joe/test/mc/mc-4.8.27-pre1/lib/tty“ wird 
betreten

  CC   tty-slang.lo
tty-slang.c: In function ‘do_define_key’:
tty-slang.c:206:26: error: ‘SLFUTURE_CONST’ undeclared (first use in 
this function); did you mean ‘SLCONST’?

 seq = SLtt_tgetstr ((SLFUTURE_CONST char *) strcap);
  ^~
  SLCONST
tty-slang.c:206:26: note: each undeclared identifier is reported only 
once for each function it appears in

tty-slang.c:206:41: error: expected ‘)’ before ‘char’
 seq = SLtt_tgetstr ((SLFUTURE_CONST char *) strcap);
 ^~~~
tty-slang.c:206:49: error: expected ‘)’ before ‘strcap’
 seq = SLtt_tgetstr ((SLFUTURE_CONST char *) strcap);
 ^~
tty-slang.c:202:38: warning: unused parameter ‘strcap’ [-Wunused-parameter]
 do_define_key (int code, const char *strcap)
  ^~
tty-slang.c: In function ‘tty_shutdown’:
tty-slang.c:358:29: error: ‘SLFUTURE_CONST’ undeclared (first use in 
this function); did you mean ‘SLCONST’?

 op_cap = SLtt_tgetstr ((SLFUTURE_CONST char *) "op");
 ^~
 SLCONST
tty-slang.c:358:44: error: expected ‘)’ before ‘char’
 op_cap = SLtt_tgetstr ((SLFUTURE_CONST char *) "op");
^~~~
tty-slang.c:358:52: error: expected ‘)’ before string constant
 op_cap = SLtt_tgetstr ((SLFUTURE_CONST char *) "op");
^~~~
tty-slang.c: In function ‘tty_keypad’:
tty-slang.c:455:36: error: ‘SLFUTURE_CONST’ undeclared (first use in 
this function); did you mean ‘SLCONST’?
 keypad_string = SLtt_tgetstr ((SLFUTURE_CONST char *) (set ? "ks" 
: "ke"));

^~
SLCONST
tty-slang.c:455:51: error: expected ‘)’ before ‘char’
 keypad_string = SLtt_tgetstr ((SLFUTURE_CONST char *) (set ? "ks" 
: "ke"));

   ^~~~
tty-slang.c: In function ‘tty_tgetstr’:
tty-slang.c:760:27: error: ‘SLFUTURE_CONST’ undeclared (first use in 
this function); did you mean ‘SLCONST’?

 return SLtt_tgetstr ((SLFUTURE_CONST char *) cap);
   ^~
   SLCONST
tty-slang.c:760:42: error: expected ‘)’ before ‘char’
 return SLtt_tgetstr ((SLFUTURE_CONST char *) cap);
  ^~~~
tty-slang.c:760:50: error: expected ‘)’ before ‘cap’
 return SLtt_tgetstr ((SLFUTURE_CONST char *) cap);
  ^~~
tty-slang.c:758:26: warning: unused parameter ‘cap’ [-Wunused-parameter]
 tty_tgetstr (const char *cap)
  ^~~
tty-slang.c:761:1: warning: control reaches end of non-void function 
[-Wreturn-type]

 }
 ^
make[3]: *** [Makefile:549: tty-slang.lo] Fehler 1

Opensuse 15.1 Kernel 4.12.14-lp151.28.91-default running here
gcc is gcc7
glibc is 2.26
libslang2 is 2.3

don't waste any time on this if it's onyl my fault or too old system / 
libs running here...


--
cu

jth
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


Re: detect if shell is running standalone or from mc

2021-07-05 Thread Jörg Thümmler

Am 03.07.21 um 14:06 schrieb Fourhundred Thecat via mc:

Hello,

how can I determine in a shell, whether the shell is running standalone
or in mc?

I am using zsh, and I have few aliases defined.

I would like to change behavior of the alias, depending whether I am in
mc or not.

How can I detect it in the shell, that I am currently in mc?

thanks,
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


Hi,

you may use ps therefore. The mc bash starts a pseudo-tty (ptsXX), if mc 
is running in a pts itself (Graphic desktop) the mc shell uses a new one:


$ ps ax

11914 ?Sl 0:01  \_ xfce4-terminal
24794 pts/13   Ss 0:00  \_ bash
24935 pts/13   S+ 0:00  \_ /usr/bin/mc -P 
/tmp/mc-joe/mc.pwd.24794

24940 pts/14   Ss 0:00  \_ bash -rcfile .bashrc
10732 pts/14   R+ 0:00  \_ ps axf

and

ps xf | grep "/usr/bin/mc"

24935 pts/13   S+ 0:00  \_ /usr/bin/mc -P 
/tmp/mc-joe/mc.pwd.24794
 7211 pts/14   S+ 0:00  \_ grep --color=auto 
/usr/bin/mc


shows "grep" running in separate pts while running "ps" without mc "ps" 
uses the same pts:


11914 ?Sl 0:02  \_ xfce4-terminal
24794 pts/13   Ss 0:00  \_ bash
12263 pts/13   R+ 0:00  \_ ps xf

the "tty" command called in a shell, then calling mc and running "tty" 
in his shell show these different ttys as well.


--
cu

jth
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc


Re: Any missed features?

2021-02-16 Thread Jörg Thümmler

Am 16.02.21 um 18:52 schrieb wwp:

Hello Sebastian,


On Tue, 16 Feb 2021 09:49:28 -0600 Sebastian Gniazdowski via mc  
wrote:


On Mon, 15 Feb 2021 at 11:41, Andrew Borodin  wrote:


Everybody wants to implement features, even that features will not be used
by 99% users.
Nobody wants to fix bugs.
  


What bugs are there to fix? I might try to fix one or two. PS. I hope that
features that I'll implement will be used by more than 1% people.


One in particular comes to my mind: the fact the timed-out FTP
connections are sometimes unrecoverables. Even clearing them in the
active vfs list is impossible, the only choice is quitting mc - that
hurts. I'm sure FTP features target a lot of users, but no idea how
many of them are facing such issues.


Regards,


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



Hi,

i'm often using the ftp features. But the named issue i'm seein' rather 
seldom, and if, not by timeout, but by such things as renaming or 
copying a file on the remote side, which is maybe impossible on some ftp 
implementations. Yes, timed out connections are an issue if the remote 
ftp (server) doesn't allow automatic reconnecting or whatever there is 
happening in the background).
Otherwise i usually get an "directory not found" on the remote side, but 
i am positioned onto the ".." entry and ENTER key reconnects (or 
whatever it does) and i'm on the higher dir level. No real problem for me.
I don't know what really happens in that case, whether mc really 
reconnects with a somehow cached pw or whatever, but it works for me. 
All machines controlled by me use the vsftp server.


--
cu

jth
___
mc mailing list
https://mail.gnome.org/mailman/listinfo/mc