bus-stop / Termination

Integrated terminal for Atom. Looks like terminal-plus, acts like your native terminal (except every other Friday). Looking for collaborators! :-)
https://atom.io/packages/termination
MIT License
86 stars 7 forks source link

When closing the terminal by keyboard shortcut, the text editor does always gain focus again. #93

Open trusktr opened 5 years ago

trusktr commented 5 years ago

Sometime the text editor does gain focus again, but I'm not sure what I did in the cases when it doesn't.

So I end up having to go the touchpad or mouse and then click on the editor to use it.

It'd be nice if maybe there was an option to force termination:toggle command to always focus the current tab's editor (or if there's multiple panes, maybe the last used tab?).

trusktr commented 5 years ago

Ah, think I found what causes it: when the window loses focus!

When it works: If I open the terminal while I am in a text editor, then close the terminal, the editor gains focus again as expected.

When it doesn't work: If I open the terminal while I am in a text editor, then switch to another window (another app, or even just another Atom window), then return, then close the terminal, the editor does not gain focus after closing the terminal. At this point, nothing seems to be focused, or at least I don't know what's focused. Then I click on the editor to continue.

I'm in macOS Mojave.

trusktr commented 5 years ago

I can confirm exactly the same thing with the file explorer. For example, without switching windows, if I start in the file explorer, open terminal then close terminal, I end up back in the file explorer. But if I switch windows then come back before closing the terminal, then focus goes nowhere (or somewhere but I've no idea where).

trusktr commented 5 years ago

One way I can work around this is to just always close the terminal when I'm done with it. That way any time I need it, I open it, use it, close it. Then I return to where I was focused. At this point switching windows will not lose the focus.

Fred-Barclay commented 5 years ago

Hi @trusktr Sorry about that. I'll see if I can figure out what's going on. :smile:

trusktr commented 5 years ago

I noticed another way to trigger it: using only keyboard shortcuts (haven't tested with mouse) do the following: toggle terminal open, switch to next or previous terminal, toggle terminal closed. Then notice the panel you return to has no focus. The focus seems to have gone into oblivion until we click somewhere with the mouse.