don't allow empty messages to be sent to channels/queries
refactor window input and command handling a bit