As Ghost-lit Warder has stated, modify the code to:
This checks if the input isn\'t a command and makes sure the active window isn\'t your status window. ;)