Shell Integration/SCP download error with hostnames containing hyphens

Detailed steps to reproduce the problem:

  1. install Shell Integration (with additional utilities)
  2. ssh into a remote machine
  3. right click a file name and click "Download with scp from hostname-with-hyphen"

What happened: Error message "Failed to connect to hostname-with-hyphen:22. Double-check that the host name is correct." shows up.

scp command on a terminal to the same machine with hostname-with-hyphen works fine. iTerm2-scp to a hostname without any hyphen also works fine. My current workaround is adding a line export iterm2_hostname=xxx.xxx.xx.xxx in ~/.zshrc.

What should have happened: iTerm2-scp should work with hostnames containing hyphens, just like scp.