Function shouldSetFocusToTerminal