FarGroup / FarManager

File and Archive Manager
https://farmanager.com
BSD 3-Clause "New" or "Revised" License
1.75k stars 194 forks source link

Conflict between Alt+F4 FAR hotkeys and Windows Terminal #845

Open Zeroes1 opened 2 months ago

Zeroes1 commented 2 months ago

Description of the new feature or improvement

Windows Terminal стал стандартом при запуске консольных приложений в Windows 11, в 10ке тоже пользуется популярностью.

Windows Terminal по дефолту имеет хоткей на Alt+F4 - закрывает WT со всеми вкладками без предупреждения.

в FAR'e есть тоже хоткеи на Alt+F4:

1) в настройке ассоциаций: Команда редактирования, выполняемая по Alt+F4:

2) редактирование меню (F2) в виде текстового файла.

3) в far:config - редактировать целое значение как двоичное число.

Предложение: как вариант чтобы не ломать существующие хоткеи, добавить альтернативные? [хотя бы для 2 и 3 пункта].

ps. ещё было в MacroBrowser - вызов немодального редактора, но Shmuz уже добавил альтернативу на Shift+F4.

Proposed technical implementation details (optional)

No response

yegor-mialyk commented 2 months ago

While I understand the pain associated with intercepting certain key combinations by WT, I do not think the alternative combinations need to be implemented at the code level. However, it is perfectly fine to have them as macros provided "in the box" (Addons).

The reasons why I think so are:

Zeroes1 commented 2 months ago

@yegor-mialyk I himsel remove Alt-F4 in WT (very dangerous action i think...), I'm worried about regular users (not advanced or pro)...

pedjas commented 2 weeks ago

While I understand the pain associated with intercepting certain key combinations by WT, I do not think the alternative combinations need to be implemented at the code level.

Well, it would not be alternative as Alt+F4 does not work at all. Function cannot be used at all. Alt+F4 should be set as alternative to new hotkey, as that would still be useful for users that are on older Windows and do not have this issue. But for user on Windows 11 Alt-F4 is useless. It need to be replaced.

* It is possible to redefine keys in WT, including Alt+F4 (via Settings -> Actions).

This is not solution. Option like running external editor should be standard option, without requiring user to customize hotkey. If there is no other option, different hotkey should be assigned and make it new standard hotkey for the function.

* Many users might not even notice that a new key combination has been added to Far Manager.

Of course they would notice as Alt+F4 does not work so users would search for a solution.

yegor-mialyk commented 2 weeks ago

I suggested two possible solutions to resolve the issue that exist today. It's fine if you do not like them; you can wait until (and if) an alternative combination is added to Far Manager. Please note, as I mentioned above, Alt+F4 is not the only combination intercepted by WT. Does this mean we should have an alternative for all of them, such as Ctrl+V? What would it be? Ctrl+Shift+V? In all applications under Windows, you use Ctrl+V to paste text, and in Far Manager, you would use Ctrl+Shift+V and call it a solution. I personally disagree.

pedjas commented 2 weeks ago

I suggested two possible solutions to resolve the issue that exist today. It's fine if you do not like them; you can wait until (and if) an alternative combination is added to Far Manager. Please note, as I mentioned above, Alt+F4 is not the only combination intercepted by WT. Does this mean we should have an alternative for all of them, such as Ctrl+V? What would it be? Ctrl+Shift+V? In all applications under Windows, you use Ctrl+V to paste text, and in Far Manager, you would use Ctrl+Shift+V and call it a solution. I personally disagree.

I am not following your reasoning. You say it should stay as it is? As Alt-F4 does not work, functionality of starting external editor should stay unavailable to user?

shmuz commented 2 weeks ago

As Alt-F4 does not work, functionality of starting external editor should stay unavailable to user?

A solution exists: add a macro that will send AltF4 to Far.

Macro {
  description="Open external editor";
  area="Shell"; key="AltShiftF4"; -- you can choose another key
  action=function() Keys("AltF4") end;
}
yegor-mialyk commented 2 weeks ago

There are two options we have today:

  1. Redefine keys in WT via Settings -> Actions
  2. Simple key macro:

    Macro {
    description = "Alternative Editor";
    area = "Shell";
    key = "AltE"; -- any combination you want
    
    action = function()
    Keys("AltF4")
    end;
    }

My original suggestion was to add such macro into the Far Manager distribution package (Addons)

yegor-mialyk commented 2 weeks ago

@shmuz our messages have been crossed in wire.

alabuzhev commented 2 weeks ago

I am not following your reasoning. You say it should stay as it is? As Alt-F4 does not work, functionality of starting external editor should stay unavailable to user?

@pedjas I understand your disappointment, but, realistically, what can we do? As Yegor already mentioned, Alt+F4 is not the only combination intercepted by WT.

These are default WT actions. I've highlighted conflicting with red and non-conflicting with green:

image

42 conflicts. And maybe I missed a few.

What shall we do? Invent 42 new ugly hotkeys (all the nice ones are taken), update the code, all the documentation, all the translations, all the online FAQs, all the forum posts etc., try to learn these new tricks after a quarter of a century, keep doing that again and again every time someone in WT team decides to grab another key for a cool new feature, and after all that get bug reports like "Alt+F4 doesn't work" every now and then anyways for the next 20 years because most of the users couldn't care less about updates and stick to some prehistoric versions for religious reasons and time travel hasn't been invented yet?

pedjas commented 2 weeks ago

42 conflicts. And maybe I missed a few.

What shall we do? Invent 42 new ugly hotkeys (all the nice ones are taken), update the code, all the documentation, all the translations, all the online FAQs, all the forum posts etc., try to learn these new tricks after a quarter of a century, keep doing that again and again every time someone in WT team decides to grab another key for a cool new feature, and after all that get bug reports like "Alt+F4 doesn't work" every now and then anyways for the next 20 years because most of the users couldn't care less about updates and stick to some prehistoric versions for religious reasons and time travel hasn't been invented yet?

Again I do not get it. There are 42 hotkeys set in FarManager that do not work and solution is to leave them as is?!?! They do not work but who cares? It is better to leave them as is, leave them documented, and pretend they can be used although they do not work?

That is really strange reasoning,

One would expect that logical solution is to set alternative hotkeys, no matter how ugly they must be so if "old one" does not work, there is alternative. At least, one would expect that hotkey that does not work would not be presented as such and documented.

Now non working hotkeys are nuisance for options that can be run other way or are insignificant, but external editor can be run only by hotkey. I am sure people would not be bothered if they have to use Alt+Shitf+F4 or whatever hotkey is decided) if Alt+F4 does not work, as that would mean they again can use that option.

This is matter of functionality. It should not be left for user to have to deal with it on his own, by customizing FarManager or Windows on each and every computer they use it on.

johnd0e commented 1 week ago

Не стоит недооценивать целевую аудиторию фара, большинство способно решить проблему с шорткатами даже без нашей с Вами помощи.

Но раз у Вас всё же болит душа за них, то почему бы Вам не подготовить предложения для 43 альтернативных хоткеев, оформив их виде макросов, как уже несколько человек выше предлагали?

Замечу также, что тут можно зайти и с обратной стороны, и отучить wt от некоторых хоткеев. Это можно сделать как и из интерфейса, по одному, так и скопом за один раз с помощью скрипта.


Do not underestimate the target audience of the Far, most of them are capable of solving the issue with shortcuts even without our help.

But if you still care about them, why not prepare proposals for 43 alternative hotkeys, formatting them as macros, as several people above have suggested?

I would also like to point out that you can approach this from the opposite side as well, and teach wt to avoid some hotkeys. This can be done both from the interface, one by one, and all at once with the help of a script.

rohitab commented 1 week ago

But for user on Windows 11 Alt-F4 is useless. It need to be replaced.

Again I do not get it. There are 42 hotkeys set in FarManager that do not work and solution is to leave them as is?!?! They do not work but who cares? It is better to leave them as is, leave them documented, and pretend they can be used although they do not work?

The hotkeys can be used and in fact work just fine on Windows 11 with Windows Console Host. The issue is due to conflicting keys with Windows Terminal. I use Far without Windows Terminal, and haven't had any issues with the default hotkeys.

pedjas commented 1 week ago

The hotkeys can be used and in fact work just fine on Windows 11 with Windows Console Host. The issue is due to conflicting keys with Windows Terminal. I use Far without Windows Terminal, and haven't had any issues with the default hotkeys.

That is actually very helpful suggestion. I did not know that classic Console is stil there, just it is not used. Windows Terminal is placed instead.

I handled issue by setting default terminal application to Windows Console Host. Not the best solution but at least it is simple enough.

Alt-F4 works now! Thanks a lot!

For those having similar issues: once Windows Terminal is open, go to it's Settings/Startup and change Default terminal application to Windows Console Host.

If you want to use Console just for Far Manager then you can change path in FarManager icon to: C:\Windows\System32\conhost.exe "C:\Program Files\Far Manager\Far.exe"

This will also change icon to Console icon, so you have to set that back to FarManager icon.

pedjas commented 1 week ago

Do not underestimate the target audience of the Far, most of them are capable of solving the issue with shortcuts even without our help.

It is not poinf of who is caable do to what but about User Experience. Users should no be forced to handle this issue. this should work with clean install.

But if you still care about them, why not prepare proposals for 43 alternative hotkeys, formatting them as macros, as several people above have suggested?

I do not know what all those malfunctioning hotkeys are. Somene else mentioned that number.

I also believe in using apps as they are with as less customizations possible. 40 years of experience tought me that, when you use the same app on several computers, especially if they are not all yours, it is best to stay with defaults.

I would also like to point out that you can approach this from the opposite side as well, and teach wt to avoid some hotkeys. This can be done both from the interface, one by one, and all at once with the help of a script.

This is very strange way to solve this. Disabling Alt-F4 on WT thus crippling it is not a solution.