Use a dictionary instead of 3 global vars
Cleanup
Set empty vars with defaults earlier

i.e., allow the pane completion to work after hitting enter
Default to first pane/window on empty input
Better window autocompletion