go-prompt
go-prompt copied to clipboard
Try to avoid panicking in PosixParser if there's no /dev/tty
When using go-prompt before /dev/
is populated, it will panic()
from
NewStandardInputParser()
because /dev/
isn't populated yet.
This will use stdin (file descriptor 0) as a fallback if /dev/tty
doesn't exist.
Furthermore GetWinSize()
will return the default console size if the
ioctl()
call fails. This can happen if the default stdin is not a
terminal, but a pipe as fixed in commit 846777c and described in
issue #88.
This will enable us to close the following issues if merged:
#39 runtime error : integer divided by zero. Facing this issue when I am trying to run go-prompt as a docker container #71 Panic while debugging using VSCODE linux #154 [Bug] When starting docker image with CMD it panics
@abrander @c-bata any updates on this?
hi @c-bata when this MR could be merged? Thanks!
@trantaiBD Unfortunately no one has been maintaining it for the last 2/3 years.
I've created a fork and merged lots of PRs from this repo. I've addressed this issue and merged this PR in my fork: https://github.com/elk-language/go-prompt/pull/8.
There's lots of new functionalities like customisable syntax highlighting, multiline editing, customisable automatic indentation.
I use it to build a REPL for my programming language, but I want to maintain it as an independent library.
https://github.com/elk-language/go-prompt