Save keys automatically on connect.

This will be needed when we want to reconnect to running instances
Can in theory reconnect, but not extensively tested
Fixes to make reconnecting work
Merge branch 'feature/reconnect' into develop

* feature/reconnect:
  Fixes to make reconnecting work
  Can in theory reconnect, but not extensively tested
  Save keys automatically on connect.
Strip color codes from shell input
If reconnecting and don't have key on file, prompt for it
Tweak UI re reconnect/terminate