blink icon indicating copy to clipboard operation
blink copied to clipboard

Windows 10 OpenSSH server arrow keys do not work

Open zedtools opened this issue 5 years ago • 16 comments

I have configured Windows 10 with an OpenSSH server, to run PowerShell as per the instructions here:

https://docs.microsoft.com/en-us/windows-server/administration/openssh/openssh_server_configuration

I can connect fine, and run commands. However, pressing the up/down/left/right cursor movement keys on the iOS on-screen keyboard do nothing. Normally these keys cycle through the command history.

These keys work when I use Blink to ssh to a Linux OpenSSH server. It is just PowerShell via OpenSSH that does not work for me.

If I use other terminal clients, such as Shelly on iOS, it works fine, so Blink must be doing something different to cause it not to work.

Is this a configuration issue, or is it a problem in Blink?

zedtools avatar May 05 '19 06:05 zedtools

I’m seeing similar behavior with SSH connections to some network switches. It appears that Blink is sending the key sequence ESC,O,A-D (application mode) for the arrows, while other programs send/expect ESC,[,A-D (normal mode). You can see this without even using an external system by comparing the output of “showkey” and “cat -v” in Blink. Probably application mode shouldn’t be used unless it’s requested (e.g. by a full-screen program like vi).

tdobes avatar Aug 23 '19 06:08 tdobes

I’ve been dealing with the same issue on Windows 10. Going to bump this thread and see if it’s a known issue.

metherul avatar Mar 05 '20 19:03 metherul

Same issue here with Windows 10 OpenSSH when using bash instead of PowerShell.

alisdair avatar May 01 '20 00:05 alisdair

Same issue. Can’t use arrow keys when remoting to any Windows shell (whether PowerShell, PowerShell 7, or bash). However, arrow keys work fine - no surprise there - when connecting to WSL 2’s bash or PowerShell.

natemardini avatar May 18 '20 22:05 natemardini

Any update on this? I am seeing the same issue. Is it best to SSH into WSL directly?

MarkLangford avatar Jul 24 '20 08:07 MarkLangford

Can confirm, I’m also having the same issue. Is there any known workaround?

jfb-h avatar Nov 09 '20 17:11 jfb-h

You can type command config then go to Keyboard > Custom Presses to set arrow keys’ HEX sequence

chen870914 avatar Jan 11 '21 08:01 chen870914

Something similar happens to me connecting to a Windows Server using SSH.

If I connect from my local PC using a Powershell console all works fine but if I connect using an Ubuntu WSL console I get wrong mappings, ex [A when doing arrow up.

guillemsola avatar Jan 13 '21 08:01 guillemsola

What are the proper mappings for Arrows in Powershell? This sounds like we could just create a simple compatible layer for it.

carloscabanero avatar Jan 17 '21 18:01 carloscabanero

Here are my keyboard "Custom Presses" that work well when connected to an OpenSSH server on a Windows Server 2019:

  • Ctrl+Space - Hex code 00
  • Up arrow key - Hex code 1b5b41
  • Down arrow key - Hex code 1b5b42
  • Right arrow key - Hex code 1b5b43
  • Left arrow key - Hex code 1b5b44

I've been using them successfully in programs such as fish, bash, tmux, emacs.

HouzuoGuo avatar Feb 24 '21 05:02 HouzuoGuo

Here are my keyboard "Custom Presses" that work well when connected to an OpenSSH server on a Windows Server 2019:

Thanks @HouzuoGuo! Would be nice to have these as a Windows specific preset in Blink.

aetha avatar Apr 22 '21 09:04 aetha

Also having this issue when connecting to Windows 10 via SSH. The "Custom Presses" fix above does fix the problem.

nozzlegear avatar May 16 '21 01:05 nozzlegear

Here are my keyboard "Custom Presses" that work well when connected to an OpenSSH server on a Windows Server 2019:

  • Ctrl+Space - Hex code 00
  • Up arrow key - Hex code 1b5b41
  • Down arrow key - Hex code 1b5b42
  • Right arrow key - Hex code 1b5b43
  • Left arrow key - Hex code 1b5b44

I've been using them successfully in programs such as fish, bash, tmux, emacs.

Do you know why this is required in the first place?

chancez avatar Sep 04 '21 01:09 chancez

Here are my keyboard "Custom Presses" that work well when connected to an OpenSSH server on a Windows Server 2019:

  • Ctrl+Space - Hex code 00
  • Up arrow key - Hex code 1b5b41
  • Down arrow key - Hex code 1b5b42
  • Right arrow key - Hex code 1b5b43
  • Left arrow key - Hex code 1b5b44

I've been using them successfully in programs such as fish, bash, tmux, emacs.

Do you happen to know what the hex code is of the delete character? (opposed to backspace, i.e.: delete the character after the cursor).

kooskaspers avatar Nov 21 '22 20:11 kooskaspers

Here are my keyboard "Custom Presses" that work well when connected to an OpenSSH server on a Windows Server 2019:

  • Ctrl+Space - Hex code 00
  • Up arrow key - Hex code 1b5b41
  • Down arrow key - Hex code 1b5b42
  • Right arrow key - Hex code 1b5b43
  • Left arrow key - Hex code 1b5b44

I've been using them successfully in programs such as fish, bash, tmux, emacs.

hi. where do i put these?

These will come now as "by default" in 17.3.0.

But if you need to send them in the meantime, you can redefine them under config > keyboard > custom presses. See for example: https://github.com/blinksh/blink/discussions/1941

carloscabanero avatar Apr 08 '24 03:04 carloscabanero

Fixed on 17.3.0 to be more consistent.

carloscabanero avatar Jul 01 '24 17:07 carloscabanero