ssh-connect is not working for zsh environment with extended_history flag enabled, because it's changing $HISTFILE format. From the docs:
EXTENDED_HISTORY
Save each command’s beginning timestamp (in seconds since the epoch) and the duration (in seconds) to the history file. The format of this prefixed data is:
: <beginning time>:<elapsed seconds>;<command>