commandline (dist): fix #16641 - Listener CommandLine.LengthAction was not registered before or already removed
This was caused by the exitMode() being called on mode change AND on drawing finish.
This patch also improves user feedback when a command errors out. For example, when python isn't installed.