Welcome to Vifm Q&A, where you can ask questions about using Vifm. Registration is optional, anonymous posts are moderated. E-mail and GitHub logins are enabled.
0 votes
in vifm by

Hello,

Whenever I press Win key, vifm performs undo. I am not using Win key in my vifmrc. What can be the cause of this?

Thank you

1 Answer

0 votes
by

Hi,

the key must be sending a sequence which includes u. You can check how it looks like in bash or terminal Vim's command-line by pressing Ctrl+V followed by the Win key and then map it to <nop>.

This is quite unusual, by the way, because Win key is normally treated as a modifier (like Alt, Ctrl or Shift).

by

Any way I can disable u?

I can't find what is being triggered with Win key. I don't have Vim. Do you have any other suggestion on how I can find what it is being triggered?

Thank you

by

At least bash and zsh handle Ctrl+V very similarly. You can try pressing Win key in Vifm's command-line as well. u can be disabled via nnoremap u <nop>.

by

When I press win on vifm command-line, it returns

[57362;3u

What do you interpret from it?

by

The point was not to interpret but to know what to map to <nop> to avoid mishandling of the sequence:

noremap <esc>[57362;3u <nop>
by

This is preventing Win key to trigger undo. But, now the Win key switches the panel.
Do you have any additional suggestions on how to prevent this?
Thank you

by

Maybe this isn't the complete input sequence, try with Ctrl+V in a shell which can print all characters.

What terminal are you using? Maybe it has an option to disable sending Win key to applications.

by

I am using kitty. I also tried in xfce-terminal. In both I have ctrl+v set to paste. What does ctrl+v suppose to doe here?

When I press Win key in Vifm's command-line, it returns

[57362;3u

However, If I press it in kitty, it returns

362;3u

I tried

noremap <esc>362;3u <nop>

in my vifmrc, but it doesn't do anything. Pressing Win key in xfce-terminal, doesn't do anything.

Any other suggestions?
Thank you

by

What does ctrl+v suppose to doe here?

It prevents handling of the next key by the shell.

Try showkey -a and then press Win. I can't reproduce the behaviour in Kitty, it sends nothing for the key in my case.

by

The showkey -a followed by Win key produces this:

$ showkey -a

Press any keys - Ctrl-D will terminate this program

^[[57362;3u 	27 0033 0x1b
 	91 0133 0x5b
 	53 0065 0x35
 	55 0067 0x37
 	51 0063 0x33
 	54 0066 0x36
 	50 0062 0x32
 	59 0073 0x3b
 	51 0063 0x33
 	117 0165 0x75
^D 	 4 0004 0x04

Thanks

by

That's <esc>[57362;3u. I don't see how the key can switch a panel after being mapped to <nop>. There is no Tab or Space in its code either.

Don't have other ideas so far other than preventing Kitty from sending the key somehow.

by

I also asked kitty people, with no luck!

https://github.com/kovidgoyal/kitty/discussions/8687

Anyway, I appreciate your time. Thank you

by
edited by

I like that he doesn't bother to say how to disable it. echo -ne '\e[<u' seems to do it.

by

That's how it is unfortunately!!

Thanks for your help again.

What I love about vifm, other that the app itself that is amazing and I can't imagine living without it, is how patient, kind, and supportive you are. You are the best! Appreciate it!

...