morassman/process-palette

Output panel steals focus

Opened this issue · 4 comments

If running a process (via a hotkey) opens an output panel or writes into an existing one, the current editor panel loses focus and has to be clicked into with the mouse. This issue came in one of the recent updates.
Previously, the focus would return to the editor and one could code and compile conveniently using only the keyboard.

I've tried to reproduce this, but haven't been able to. I configured the command

cat {fileAbsPath}

with keystroke cmd-shift-h.

The content of the editor is shown in the output panel, but the focus remains in the editor.

What is the hotkey that you configured for your command? It may that it is one of Atom's predefined hotkeys. Even if not, it may help me to reproduce the problem.

I have used the hotkeys F9 and Ctrl-B. I also added the new command cat {fileAbsPath} with the same keystroke as yours and the command worked, but still stole the focus.

I experimented and opened Atom with no project loaded, and a fresh editor window for a new file.
Here, Process Palette showed the commands Defaults Example, Echo Example, and Stream Example.
Starting either of them with the "Play" button steals the focus from the editor window.
Starting the Echo Example with its hotkey (Ctrl-Alt-E) steals the focus, too.

Then I changed the default configuration: The Echo command does not steal the focus if the output is sent to Void, Clipboard, Active Editor, or File.
In these cases, the focus remains even if I start the command by clicking on the Play button, and even if Notifications are displayed by the plugin.
As soon as the output is sent to the Panel, streamed or not, the focus again disappears on command execution.

What OS are you using? I don't think it would make a difference, but one can't be too sure. I'm on OSX 10.11.6. I also assume you're on the latest version of Atom, 1.23.3?

I could reproduce the issue on two fresh Atom 1.23.3 x64 installs with process palette 0.16.1, one on Windows 7, one on Ubuntu 17.10.
In both cases, starting the Echo Example (with either the button or the hotkey) steals the focus from the editor window.