Bug 482628

Summary: Allow disabling toolBar accelerator
Product: [Applications] konsole Reporter: Kunshan Wang <wks1986>
Component: keyboardAssignee: Konsole Developer <konsole-devel>
Status: CONFIRMED ---    
Severity: normal CC: 988alex, ddan39, duha.bugs, ivan, juszczakn, kde-bugs, kde-bugzilla-my4sqiqt, kde, kdebugs.kapush, knut, raphael.kde, reg.bugs, ye.jingchen
Priority: NOR Keywords: qt6
Version: 24.02.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Konsole opens search box after pressing ALT+F

Description Kunshan Wang 2024-03-07 02:18:36 UTC
Created attachment 166533 [details]
Konsole opens search box after pressing ALT+F

SUMMARY

In most shells, ALT+F is a shortcut for moving the cursor one word forward.  But if the main toolbar is shown, the ALT key will activate toolbar buttons instead of being sent to the shell.  This problem only occurs after I upgraded to KDE 6.

STEPS TO REPRODUCE
0. (Optional) Create a new user and re-login with that, to ensure we are using the default configuration.
1. Open Konsole, and ensure the main toolbar is shown. (This is the default.)
2. Type "echo hello world" in the shell, but do not press the ENTER key.
3. Press CTRL+A, and the cursor should move to the beginning of the line.
4. Press ALT+F

OBSERVED RESULT

When holding the ALT key, underlines appear under the letter 'N' in "New Tab", 'S' in "Split View", ..., and 'F' under "Find..." in the main toolbar.

When the F key is pressed while holding the ALT key, the search box is open, as if the toolbar button "Find..." is clicked.  Please see the screenshot in the attachment.

EXPECTED RESULT

The ALT+* key combos should be sent to the shell.  In this case, after pressing ALT+F, the cursor should be under the space between "echo" and "hello".  Pressing ALT+F again should move the cursor to the space between "hello" and "world", and pressing it again should move the cursor to the end of the line.

SOFTWARE/OS VERSIONS
Distribution: Arch Linux
KDE Plasma Version: 6.0.1
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2
Kernel version: 6.7.8-arch1-1 (64-bit)
Graphics Platform: Wayland

ADDITIONAL INFORMATION

This problem only occurs after upgrading to KDE 6.

One way to work around this problem is hiding the main toolbar.  CTRL+SHIFT+F also opens the search box even if the main toolbar is hidden.
Comment 1 duha.bugs 2024-03-07 19:31:23 UTC
Agree the accelerator should probable moved to ALT+I or something.

As a workaround you can either use CTRL+ALT+F or remove the "Find Action..." from the toolbar.
Comment 2 Kunshan Wang 2024-03-08 06:29:12 UTC
(In reply to duha.bugs from comment #1)
> Agree the accelerator should probable moved to ALT+I or something.
> 
> As a workaround you can either use CTRL+ALT+F or remove the "Find Action..."
> from the toolbar.

I prefer not to use CTRL or ALT alone for any accelerator keys in Konsole or any terminal emulators.  Most terminal applications (such as Emacs) have many CTRL+* and ALT+* key bindings.
Comment 3 Iván Ávalos 2024-03-16 05:43:44 UTC
Removing "Find" from the toolbar doesn't seem to work, as it causes ALT+F to be remapped to the "File" menu. I agree with @Kunshan Wang in that Konsole should /never/ use ALT or CTRL accelerator keys, and should instead rebind them to something else, just like it already does with most CTRL keybindings (it rebinds them to CTRL+ALT).
Comment 4 Arnd 2024-04-02 07:07:12 UTC
With my german locale, ALT-F does nothing, but ALT-S brings up the search box. When I start konsole with LC_ALL=C, then ALT-F brings up the search box and ALT-S does a window split, which also isn't configurable through the "Configure keyboard shortcuts" Dialog.

I have an up to date arch linux with KDE frameworks 6.0.0 and Qt 6.6.3

The fish shell uses ALT-S to put a sudo in front of the current or last command. Very nice feature, now broken.
Comment 5 Arnd 2024-04-05 06:31:41 UTC
It's even more weird. Open Menu has two entries in the keyboard configuration dialog. With LC_ALL=C they are both unbound. But with german locale both are bound to F10, which is heavily used by midnight commander. If I configure that to unbound, close the dialog, reopen it, it is still unbound and for a short time it even works this way. But after switching to another Tab and back again, it's set to F10 again.
Comment 6 kdebugs.kapush 2024-05-17 14:44:57 UTC
This bug has now reached manjaro linux which recently updated to plasma 6.

this is a major annoyance and it seems hard to believe that kde devs would do such a blunder and oversight.

how can people behind konsole not know that shells and shell applications use ctrl and alt ? this is beyond me.

anyways I confirm that renaming find from the session toolbar does not fix the issue as ALT+F is still captured by konsole and opens the file menu.

I second Kunshan Wang and also thinks that ctrl and alt should not be capture by terminal emulator as several terminal applications and shells make use of CTRL and ALT shortcuts.

But what really surprised me was that those shortcuts are nowhere to be found in any konsole or kde settings, even in the konsole keyboards shortcuts settings panel where we can find other proper shortcuts exists for the same functionality.
it kinda defeats the point of having a shortcut settings when half the set shortcuts are missing and cannot be set or unset from there.

At the very least there should be a setting to enable/disable ctrl and alt being captured by konsole instead of going to the terminal.
Comment 7 duha.bugs 2024-05-17 19:07:55 UTC
(In reply to Iván Ávalos from comment #3)
> Removing "Find" from the toolbar doesn't seem to work, as it causes ALT+F to
> be remapped to the "File" menu. I agree with @Kunshan Wang in that Konsole
> should /never/ use ALT or CTRL accelerator keys, and should instead rebind
> them to something else, just like it already does with most CTRL keybindings
> (it rebinds them to CTRL+ALT).

You can disable the "File" menu accelerator (the _) in the settings -> configure konsole -> enable menu accelerators

I tried to expand this behavior to the toolBar as well but was unable so far. I was only able to set the mainToolbar to no no accelerators with KAcceleratorManager::setNoAccel(toolBar());  but I haven't had any luck with the sessionToolbar.

If any dev wants to have a look, the code is in MainWindow.cpp. 


Not sure about the issues with the CTRL shortcuts. I think accelerators (the underline) and ctrl shortcuts are different. Possibly a seperate bug report for this might be useful.
Comment 8 duha.bugs 2024-05-17 19:11:10 UTC
Kate does disable the toolBar accelerators by default:
https://invent.kde.org/utilities/kate/-/commit/7154bbd48a167b37ba3a2271cd638f12351771c4
Comment 9 duha.bugs 2024-05-17 19:11:59 UTC
*** Bug 486450 has been marked as a duplicate of this bug. ***
Comment 10 Knut Johansson 2024-05-26 21:59:20 UTC
Why not simply change it to alt+shift+f, and make it consistent with the way other key bindings are adapted to function in konsole. Like ctrl+shift+c (for ctrl+c).
Comment 11 Nick 2024-06-28 23:20:05 UTC
FWIW, I just recently ran into this on opensuse tumbleweed, and was able to work around this by hiding the session toolbar which contains the Find operation.

Settings > Toolbars Shown > deselect Session Toolbar

This was particularly annoying when using SSH + Emacs, which makes heavy use of pretty much all of the modifier keys.
Comment 12 dan 2024-07-04 02:04:12 UTC
how did this get by testing? do most KDE/Plasma users really not use the terminal at all? I feel like Alt+F is a very commonly used shortcut. I don't get why so many terminal emulatorss have so many shortcuts enabled by default at all to be honest. Maybe a few ctrl+alt+ shortcuts, ok, but so many TUI apps, like htop, get shortcuts like F1 thru F10 stolen by the terminal emulator.

It would be nice if the toolBar accelerators were somehow more customizable, similar to the general shortcuts, but I would happily settle for at least just a checkbox to disable them in general.
Comment 13 Raphaël Jakse 2024-09-03 07:19:46 UTC
Because of this bug, Alt+N triggers the "New tab" button (in French and English locales) when the main toolbar is displayed. This is an issue because Alt+N is used in terminal programs, for instance in Nano to toggle line numbers.

I don't fink making it possible to disable keyboard accelerators is good enough, they should be disabled by default, and I'm not sure it's useful to make this configurable.

I'm usually biased toward accessibility, and keyboard accelerators are a pretty important accessibility feature. However, in this case, removing the accelerator seems better because it is possible to configure keyboard shortcuts for all the actions of the main toolbar. Any keyboard accelerator is likely to override a terminal program's shortcut, and I would guess this is why there are none in the menu bar.

> how did this get by testing?

KDE always need testers, and this might be the indication that KDE lacks a tester like you to spot such bugs. Testing is one of the many ways to help KDE.
Comment 14 dirkjan 2024-09-06 17:06:56 UTC
Can the developers please just make the session toolbar hidden by default for now?

This issue took me WAAAY to long to figure out.

I love bash's "ALT-P" command (try it).
Which pastes here, and that isn't instantly recognizable as being a paste so I didn't understand why this one computer where this toolbar was showing was misbehaving...