草,PowerShell OpenSSH fork 把 ws_xpixel、ws_ypixel 硬编码成了 640480,无论终端窗口多大,TIOCGWINSZ 永远报告 640480。
https://github.com/PowerShell/openssh-portable/blob/efa17c848b3e579d8a4a0e71edf6d233b5e30917/contrib/win32/win32compat/misc.c#L500-L501
就算 ws_xpixel、ws_ypixel 是未定义的,也不能硬编码个假值啊。。
我见过的所有终端、SSH client 要么设置终端真实像素大小,要么设置 0 表示不支持,这样 client app 可以检查是否 0 决定能否使用它。
这几乎是事实标准,PowerShell OpenSSH 这操作我还第一次见。
https://github.com/PowerShell/openssh-portable/blob/efa17c848b3e579d8a4a0e71edf6d233b5e30917/contrib/win32/win32compat/misc.c#L500-L501
就算 ws_xpixel、ws_ypixel 是未定义的,也不能硬编码个假值啊。。
我见过的所有终端、SSH client 要么设置终端真实像素大小,要么设置 0 表示不支持,这样 client app 可以检查是否 0 决定能否使用它。
这几乎是事实标准,PowerShell OpenSSH 这操作我还第一次见。