Remove attachment of terminal's thread input (needs to be thoroughly tested).
Defer the hiding of dock window to prevent flickering