Comments (11)
This is sort of a race condition between the time taken for docker to complete allocation of psuedo terminal and go-prompts initial window calculations.
Fix submitted in #32
from go-prompt.
ok let me create a test project and create docker container with it and will give you source code
from go-prompt.
Hi @harshapic ! Could you tell me your source code using go-prompt?
I can't help you without it.
from go-prompt.
yes its using go-prompt
/home/sdp/go/src/github.com/xxxxx/sdp-cli-client/vendor/github.com/c-bata/go-prompt/prompt.go:50 +0xe0
main.main()
/home/sdp/go/src/github.com/xxxxx/sdp-cli-client/main.go:78 +0x764
Tried to run on docker container with base "ubuntu:16.04"
docker version: Docker version 17.03.2-ce, build f5ec1e2
from go-prompt.
import (
"fmt"
"github.com/c-bata/go-prompt"
)
Actually if i run it on ubuntu machine my code is working fine when i copy executable to docker container and if i try to run it it giving me error
from go-prompt.
Sorry, It's difficult to help you from these information.
Is sdp-cli-client
your private project? If I help you, I need to check the source code and understand how you use go-prompt.
from go-prompt.
this is my sample test project, it has everything even with dockerfile.
Steps to replicate issue:
- CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o yang-cli
- docker build -t yang-cli .
- docker run -it yang-cli /bin/sh
from go-prompt.
you will get this issue:
yangcli (rev-)
Please use exit
or Ctrl-D
to exit this program..
Bye!
panic: runtime error: integer divide by zero
goroutine 1 [running]:
github.com/yang-cli/vendor/github.com/c-bata/go-prompt.(*Render).Render(0xc4200d6000, 0xc420069d80, 0xc4200cc810)
/home/sdp/go/src/github.com/yang-cli/vendor/github.com/c-bata/go-prompt/render.go:134 +0x50c
github.com/yang-cli/vendor/github.com/c-bata/go-prompt.(*Prompt).Run(0xc42008bce0)
/home/sdp/go/src/github.com/yang-cli/vendor/github.com/c-bata/go-prompt/prompt.go:50 +0xe0
main.main()
/home/sdp/go/src/github.com/yang-cli/main.go:44 +0x5a3
from go-prompt.
but same thing it works properly on my developer machine
from go-prompt.
@c-bata ru able to reproduce issue on docker container?
from go-prompt.
thank you @bcicen
from go-prompt.
Related Issues (20)
- [Feature Request] Example for Simple Yes/No/Quit question?
- Update README: `aws-sso` uses go-prompt
- [Feature Request] Option to escape special characters or quote strings containing special characters
- [Feature Request] MacOS keyboard support is not complete
- Sorry for the delayed response. I've just pushed v0.2.6 tag.
- [Feature Request] Need a way to terminate unresponsive executors HOT 1
- [Bug]Strange bug when using `fmt.Scanln` after upgrade to v0.2.6 HOT 1
- [Bug] `prompt.Input` leaks file descriptor of "/dev/tty"
- [Question] Force prompt.Input() redraw during goroutine
- Allow specifiying arbitrary io.ReadWriters to read input and write output to (including escape codes)
- [Bug] Unexpected behavior of log output HOT 1
- How to customize suggestion rendering?
- [Bug] Terminal Colors not reset after application exists HOT 2
- [Bug] In the v0.2.6 , the icnl attribute of the stty is modified, but the attribute is not restored. v0.2.5 is ok HOT 5
- A CI/CD Observability Solution Suggestion
- Project FireQL using go-prompt HOT 1
- GPT cli An interactive ChatGPT client featuring shortcuts and auto-complete - thanks to go-prompt
- [Feature Request]
- [Feature Request] Allow for TTYs other than STDIN
- [Bug] panic: runtime error: integer divide by zero
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-prompt.