9

I've always just used boot2docker ssh and in that I'd run

    docker exec -it container bash

and it would work fine.

Now I'm using the new windows client and while docker exec -it container bash will get me to a bash prompt, from there if I type, left/right/up/down/home/end/page up/page down won't work. Not sure what windows is missing in it's config to not properly work with those keys.

Any suggestions?

phazei
  • 5,323
  • 5
  • 42
  • 46
  • Possibly, either terminal properties get changed (try comparing `stty -g` output, with/without docker) or the readline behavior changes (see if `rlwrap` helps), when you run it via docker. – anishsane Jun 04 '15 at 04:46
  • A long shot: try `set -o emacs`. – cdarke Jun 04 '15 at 08:06
  • stty -g shows the same thing when in the container with exec bash in windows or boot2docker. stty freezes git bash in windows, but in cmd it returns a different line. – phazei Jun 04 '15 at 19:06

2 Answers2

4

try /bin/bash within shell before doing anything else.

It always work like a charm

0

While it does not seem possible to configure docker, as a workaround, you can symlink sh to bash inside the container, so that bash is used by default, supporting arrow key actions:

ln -sf /bin/bash /bin/sh

Also see

How to change the default /bin/sh to /bin/bash on opening CLI for selected container in Docker Desktop?

Stefan
  • 10,010
  • 7
  • 61
  • 117