peterh / liner

Pure Go line editor with history, inspired by linenoise
MIT License
1.05k stars 132 forks source link

Liner seems not work well in docker #138

Open jievince opened 4 years ago

jievince commented 4 years ago

In docker, all keyboard shortcuts will not work.

peterh commented 4 years ago

There are no details here, so I can only make wild guesses.

I suspect you are running docker without a TTY, so liner goes into "dumb terminal" mode. Try docker -t.

If that doesn't resolve the issue, pretend I've never heard of docker and provide complete instructions to reproduce the issue.

jievince commented 4 years ago

There are no details here, so I can only make wild guesses.

I suspect you are running docker without a TTY, so liner goes into "dumb terminal" mode. Try docker -t.

If that doesn't resolve the issue, pretend I've never heard of docker and provide complete instructions to reproduce the issue.

Hi peterh, Sorry for not describing my question clearly. I use -t to start docker, sudo docker run --rm -ti --network=host vesoft/nebula-console:v2-preview-nightly -u user -p password --addr=127.0.0.1 --port=36987 image In this photo, I typed up/down/left/right arrow key, and then didn't work and just printed some strange characters like ^[[A^[[A^[[B^[[D^[[C^A^E^E. Auto completer via Tab also doesn't work, and the terminal just print's a real tab(4 spaces). All other keyboard shortcuts don't' work.

tiborvass commented 4 years ago

@jievince Are you able to reproduce this with the example demo from https://github.com/peterh/liner#getting-started in an alpine or debian container?

peterh commented 4 years ago

Fail to connect server, dial tcp 127.0.0.1:36987: connect: connection refused

No, seriously. I know precisely nothing about docker. I don't even know what went wrong with your command line.