| Summary: | The Enter key is not always respected by Krunner. | ||
|---|---|---|---|
| Product: | [Plasma] krunner | Reporter: | Little Girl <littlergirl> |
| Component: | general | Assignee: | Plasma Bugs List <plasma-bugs-null> |
| Status: | CLOSED INTENTIONAL | ||
| Severity: | normal | CC: | alexander.lohnau, nate |
| Priority: | NOR | ||
| Version First Reported In: | 5.24.6 | ||
| Target Milestone: | --- | ||
| Platform: | Kubuntu | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Little Girl
2022-09-30 15:30:38 UTC
That summary wasn't quite clear. I've rewritten it, but can't figure out how to edit the existing one, so I'll post it in the next comment. UPDATED: SUMMARY The "Issue (shell) commands" section of the https://userbase.kde.org/Plasma/Krunner#Issue_.28shell.29_commands page in the KDE UserBase Wiki says that we can run shell commands from Krunner. I've tested it in an up-to-date copy of Kubuntu 22.04 LTS and have found that pressing the Enter key after putting a shell command into Krunner doesn't always cause the shell command to run. The failure can be consistently repeated by attempting to run shell commands that are expected to produce output and comparing that with the consistent success achieved by running shell commands that are not expected to produce output. STEPS TO REPRODUCE 01. Press alt+F2 to open Krunner. 02. Type this shell command that's not expected to produce output: kate 03. Press the Enter key. 04. Observe the expected result (and don't close Kate). 05. Type this shell command that's expected to produce output: which kate 06. Press the Enter key. 07. Observe the unexpected result. 08. Press alt+F2 to open Krunner again. 09. Type this shell command that's expected to produce output: which kate 10. Click the Konsole icon in Krunner's "Run which kate" search result. 11. Observe the expected result. 12. Press alt+F2 to open Krunner again. 13. Type this shell command that's not expected to produce output: pkill kate 14. Press the Enter key. 15. Observe the expected result. OBSERVED RESULT Step 04 result: Success: Krunner closes and Kate opens (successful press of the Enter key). Step 07 result: Failure: Krunner closes (unsuccessful press of the Enter key). Step 11 result: Success: Krunner closes and Konsole opens with output (successful click of the Konsole icon). Step 15 result: Success: Krunner closes and Kate closes (successful press of the Enter key). EXPECTED RESULT In step 07, Konsole should open with output when the Enter key is pressed. SOFTWARE/OS VERSIONS Linux/KDE Plasma: KDE Plasma Version: 5.24.6 KDE Frameworks Version: 5.92.0 Qt Version: 5.15.3 ADDITIONAL INFORMATION As a result of testing this issue, I found the additional Krunner issues below that may be related. I'm not sure if they belong here or in two separate additional bug reports, so I'm leaving them here for now. * If you type which kate into Krunner and click the "Run which Kate" entry in its search results, Krunner closes and nothing else happens. * If you use the Krunner textbox in the K menu instead of opening Krunner with alt+F2, there's no way to run the which kate shell command because there's no Konsole button in the search result and neither pressing the Enter key nor clicking on the "Run which kate" search result do anything. The default action for the enter key silently drops output; to see output, you use Shift+Enter, or click on the little terminal window icon on the right of the list item for the command. I can't think of a way we could detect whether a command is going to produce output automatically without running the command and looking for STDOUT, and at that point it's too late. I think we'll have to use the tools we already have here, unless you think of something super clever. Did you have something in mind? Thank you for looking into this issue and considering it. Maybe this will help: The https://userbase.kde.org/Plasma/Krunner#Issue_.28shell.29_commands page doesn't mention any exclusive or forbidden behaviors (like not being allowed to press the Enter key when output is expected or having to find and click on an icon in the search instead of clicking on the search result itself), so it's understandable that I'd assume I could use the Enter key, especially since it works some of the time. There are additional inconsistent behaviors depending on whether you invoke Krunner with alt+F2, use it inside the K menu, or use it via the Search widget on the panel. Below is a simple, detailed summary that anyone can pretty quickly follow for testing and that makes the inconsistencies in behavior obvious at a glance: ==================== Using Krunner from alt+F2: Success: Open Krunner with alt+F2, type kate, press Enter. Success: Open Krunner with alt+F2, type kate, click its search result. Success: Open Krunner with alt_F2, type kate, click the Konsole icon. Failure: Open Krunner with alt+F2, type which kate, press Enter. Failure: Open Krunner with alt+F2, type which kate, click its search result. Success: Open Krunner with alt+F2, type which kate, click the Konsole icon. ==================== Using Krunner in the K menu: Success: Open K menu, type kate, press Enter. Success: Open K menu, type kate, click its search result. Failure: Open K menu, type kate, try to find a Konsole icon to click. Failure: Open K menu, type which kate, press Enter. Failure: Open K menu, type which kate, click its search result. Failure: Open K menu, type which kate, try to find a Konsole icon to click. ==================== Using Krunner from the Search widget on the panel: Success: Click Search icon in panel, type kate, press Enter. Success: Click Search icon in panel, type kate, click its search result. Success: Click Search icon in panel, type kate, click the Konsole icon. Failure: Click Search icon in panel, type which kate, press Enter. Failure: Click Search icon in panel, type which kate, click its search result. Success: Click Search icon in panel, type which kate, click the Konsole icon. ==================== In all of those cases, the pattern is what I already mentioned: when you run a command that you're expecting to produce terminal output, you need to explicitly invoke the "Run in terminal window" action -- either by clicking on the little Konsole icon in the list item, or by hitting Shift-Enter. The default action simply runs the command and discards output. If https://userbase.kde.org/Plasma/Krunner#Issue_.28shell.29_commands is outdated, someone should update it. Maybe you? :) It is a wiki, after app. |