Earlier quoted context omitted.
It does not. open ssh linux to mac, typing ~ just types it on fish shell prompt. It works after`cat` followed by ENTER
In newer versions, it's disabled by default and you have to do something like this to enable in ~/.ssh/config: Host * EnableEscapeCommandline yes
The reason that is disabled in current OpenSSH by default is OpenBSD `pledge` support:
https://security.stackexchange.com/questions/280793/what-att...
On my Linux,
cat~.
closes the connection as expected, and no ~ is shown in the terminal.