1

I'm running ubuntu 1804 on windows using the WSL. Everything is set up fine and works correctly. I've also installed ZSH and oh-my-zsh, again this is all good and everything looks like its working fine. Everything except the arrow keys whilst using vim or man pages or some other command line tools.

The up and down keys work on the command line when scrolling through history and also for select commands like nano. Also if I boot into bash rather than zsh the arrow keys do work in vim and man pages, in fact they work everywhere.

If i boot into bash, then switch to zsh on the command line manually the arrow keys then work everywhere.

So my cmder config for zsh

c:/_distros/ubuntu1804/ubuntu1804.exe -c zsh -cur_console:pm

and for bash

set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe --wsl -cur_console:pm:/mnt

The one for bash uses the conemu-cyg-64.exe program that comes from conemu which is a symbiont of POSIX enabled pty and WinAPI full-featured terminal.

Apparently you can use this tool with zsh but i cant manage to make it work i get the error

{PID:10592} failed to run shell (2): No such file or directory
{PID:10592} shell: `/usr/bin/zsh` `-l` `-i`
{PID:10592}   dir: `/cygdrive/c/Program Files/cmder`
ConEmuC: Root process was alive less than 10 sec, ExitCode=0.
Press Enter or Esc to close console...

and this is the task in cmder

set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe /usr/bin/zsh -l -i -cur_console:pm:/mnt

So I think that if i can boot into zsh using conemu-cyg-64 that the cursor keys will probably work in commands like vim and the man pages. Any help or advice getting that working would be brilliant.

EDIT: On my ubuntu install zsh is installed at /usr/bin/zsh, but there is no file or folder /cygdrive/c/Program Files/cmder

Damo
  • 5,698
  • 3
  • 37
  • 55
  • And where is your zsh? – Maximus Dec 02 '18 at 20:50
  • ~ which zsh returns /usr/bin/zsh – Damo Dec 02 '18 at 22:11
  • But i do not have the folder /cygdrive/c/Program Files/cmder in my wsl ubuntu file system. maybe it is this causing the error? – Damo Dec 03 '18 at 07:48
  • `which zsh` returns "virtual" location. But I've asked you about real one. Which zsh you are trying? Wsl? Cygwin? – Maximus Dec 03 '18 at 11:11
  • i think im using the real zsh that i installed in ubuntu using sudo apt-get install zsh ive not installed cygwin other than installing and using cmder. When i start bash and then at the bash command line i type zsh this is the one im trying to use. – Damo Dec 03 '18 at 13:01
  • When i look at zsh in the folder /usr/bin i see that its a simlink /bin/zsh – Damo Dec 03 '18 at 13:03
  • 1
    Docs have an example blue to run wsl shells properly. https://conemu.github.io/en/BashOnWindows.html#wsl-shell – Maximus Dec 03 '18 at 17:30

1 Answers1

3

Many thanks to @Maximus for pointing me in the right direction. The answer was right under my nose at the bash on windows page of conemu. A small change to the command i was using before. the zsh needs to go on the end rather than before the --wsl.

The correct task to ensure that cursor keys work on all apps in the terminal is:

set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe --wsl -cur_console:pnm:/mnt -t zsh -l
Damo
  • 5,698
  • 3
  • 37
  • 55