Event to focus and unfocus to a tab (EditorView)?


I am trying to implement a httpServer to interact a browser Client, and the server instance with a specific port (say 3000) should be bind to each current active tabs.

To do that, I need to obtain every focus/unfocus event to a tab (the cursor blinking content).

I have read


then noticed
atom.workspaceView.on 'focusout’
is the one to catch an event unfocus, but cannot find one for focus.

My question is as follows:

is the atom.workspaceView proper object to catch an event for every tab, and what is the ‘focus’ event?


Is There An Event Triggered When Tabs Are Changed / Active Editor Changes

I think this can help https://gist.github.com/ardcore/9262498



This list is helpful to see what events are possible. But what objects are these triggered on? What is the best way to bind to them?