docker-baseimage-gui icon indicating copy to clipboard operation
docker-baseimage-gui copied to clipboard

Arrow keys do not work for terminal emulators

Open ShamrockLee opened this issue 4 years ago • 3 comments

Arrow keys passed to the terminal emulator inside the docker image through NoVNC or VNC client does not work. The app shows ^[[A, ^[[B, ^[[C, or ^[[D instead.

Screenshot Eterm

ShamrockLee avatar Dec 07 '20 12:12 ShamrockLee

It seems to be an issue with the terminal itself, which is not handling arrow keys properly. I tried with xterm and it works perfectly.

jlesage avatar Dec 20 '20 14:12 jlesage

@jlesage Thank you for telling me that.

But It does occur to xterm and Debian 10. It can also be reproduced using xfce4-terminal, and it occurs no matter if you connect to it through Firefox, Chromium, or TigerVNC.

Dockerfile

FROM jlesage/baseimage-gui:debian-10
COPY startapp.sh /startapp.sh
RUN \
apt-get update && \
apt-get install -y xterm
ENV APP_NAME="Testarrow"

startapp.sh

#!/bin/sh
exec /usr/bin/xterm

start.sh

#!/usr/bin/env sh
docker build -t docker-xterm .
docker run --rm -p 5800:5800 -p 5900:5900 docker-xterm

Should I try Alpine Linux instead?

ShamrockLee avatar Dec 21 '20 17:12 ShamrockLee

Sorry for the delay. Alpine is working fine. If you want to stick with Debian images, you can use the SHELL variable to set the shell to be used by xterm. So for example, your startapp.sh could be:

#!/bin/sh
export SHELL=/bin/bash
exec /usr/bin/xterm

jlesage avatar Jan 21 '21 03:01 jlesage

Closing this issue. Please re-open if needed.

jlesage avatar Oct 07 '22 12:10 jlesage