Bug 452860

Summary: Kmail external editor opening on modifier keypress
Product: [Applications] kmail2 Reporter: tenger
Component: composerAssignee: kdepim bugs <kdepim-bugs>
Status: REPORTED ---    
Severity: normal    
Priority: NOR    
Version: 5.19.3   
Target Milestone: ---   
Platform: Manjaro   
OS: Linux   
Latest Commit: Version Fixed In:

Description tenger 2022-04-22 13:32:37 UTC
This is related to https://bugs.kde.org/show_bug.cgi?id=25755 but different. Also, https://bugs.kde.org/show_bug.cgi?id=48841 is the same issue but for the original kmail.

I know that besides the external editor automatically opening when starting a new mail, it can also be re-opened later by pressing any key while the main body textbox part of the composer is in focus. This latter is good and intended behaviour, however it triggers on indeed *any* key, e.g. also for modifiers such as Meta or Alt. 

This can be very frustrating when trying to operate KMail by keyboard: e.g. if I navigate into the main textbox via Tab-ing, I cannot navigate out via shift-tabbing, or if I want to close the composer window via a keyboard shortcut, the external editor launches while the composer has closed/is closing.

I see two possible solutions:
- Do not launch the external editor for any keypress, only for printable characters or similar (but definitely do not spawn if for modifier keys or anything involving a modifier key), or
- add an option to the external editor plugin that can disable the automatic launching of the external editor (on opening and/or on any keypress), which could be instead launched by a dedicated keyboard shortcut.

The second proposed soluton ties in to the comment https://bugs.kde.org/show_bug.cgi?id=25755#c7, as the external editor launching behaviour should indeed be more granularly configurable to accommodate different workflows (which is the whole point of the external editor).