Fix port on interactive login (Fix #12228)

Primary cause was a typo "prt" (which would have been
detected by flake8!) While trying to track this down,
I went ahead and added a more proper regex for the
server string parsing.
Merge pull request #2360 from joshmoore/rebased/develop/12228-cli-login

Fix port on interactive login (Fix #12228) (rebased onto develop)