The getApplication() returns the application itself, so that it can be scripted. Actions like https://github.com/autoplot/dev/blob/master/demos/tools/editor/commit.jy use it to get a reference to the script itself to add actions to the editor.
Sadie and I noticed where the new commit action doesn't work because getApplication() doesn't work in new windows, and a runtime error occurs.
To demo:
This is an old problem, really, where the ScriptContext is a static context, so there can really only be one script running. Since scripts usually don't use the getApplication command, we haven't noticed. The context is automatically set when two windows are running, which gives the sense that multiple contexts are supported but this isn't completely true, and some squirrelly behavior can occur, like where the consoles don't have the same thing or where setStatus called in one resets the status in another.
I did "fix" it though by making sure that the application is set when running within a second window. I need to see that this works properly with the Git commands.
I verified that this fixes the git commands in a second window.