Giter Club home page Giter Club logo

Comments (11)

bcicen avatar bcicen commented on May 16, 2024 3

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.

harshapic avatar harshapic commented on May 16, 2024 1

ok let me create a test project and create docker container with it and will give you source code

from go-prompt.

c-bata avatar c-bata commented on May 16, 2024

Hi @harshapic ! Could you tell me your source code using go-prompt?
I can't help you without it.

from go-prompt.

harshapic avatar harshapic commented on May 16, 2024

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.

harshapic avatar harshapic commented on May 16, 2024

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.

c-bata avatar c-bata commented on May 16, 2024

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.

harshapic avatar harshapic commented on May 16, 2024

this is my sample test project, it has everything even with dockerfile.
Steps to replicate issue:

  1. CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o yang-cli
  2. docker build -t yang-cli .
  3. docker run -it yang-cli /bin/sh

yang-cli.tar.gz

from go-prompt.

harshapic avatar harshapic commented on May 16, 2024

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.

harshapic avatar harshapic commented on May 16, 2024

but same thing it works properly on my developer machine

from go-prompt.

harshapic avatar harshapic commented on May 16, 2024

@c-bata ru able to reproduce issue on docker container?

from go-prompt.

c-bata avatar c-bata commented on May 16, 2024

thank you @bcicen

from go-prompt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.