From 0b5917560b95f435a9b6770e77163b3ab5e2df89 Mon Sep 17 00:00:00 2001 From: Michail Koreshkov Date: Wed, 24 Jan 2024 23:36:55 +0300 Subject: [PATCH] Update tncon.c Some proprietary SSH servers use default code for backpace as 0x08 (^H) if ssh client does not provide option ERASE option. Putty has option to specify code of backspace but OpenSSH hasn't. One solution is to replace 0x7F (^?) by 0x08(^H) on client side. --- contrib/win32/win32compat/tncon.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contrib/win32/win32compat/tncon.c b/contrib/win32/win32compat/tncon.c index d4773131196..fa81a15cd5b 100644 --- a/contrib/win32/win32compat/tncon.c +++ b/contrib/win32/win32compat/tncon.c @@ -198,6 +198,10 @@ ReadConsoleForTermEmul(HANDLE hInput, char *destin, int destinlen) 20, NULL, NULL); + + // When terminal sends backspace as 0x7F replace with '\b' (0x08) + if (n == 1 && octets[0] == VK_F16) + octets[0] = VK_BACK; WriteToBuffer((char *)octets, n); }