Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] When starting docker image with CMD it panics #154

Open
JesterOrNot opened this issue Jan 17, 2020 · 5 comments
Open

[Bug] When starting docker image with CMD it panics #154

JesterOrNot opened this issue Jan 17, 2020 · 5 comments
Labels

Comments

@JesterOrNot
Copy link

JesterOrNot commented Jan 17, 2020

Bug reports

Please file a bug report here.

Expected Behavior

program works as expected

Current Behavior and Steps to Reproduce

image
I start docker image

FROM homebrew/brew as build

RUN brew install gosh-terminal/gosh/gosh

RUN useradd -s /home/linuxbrew/.linuxbrew/bin/gosh gosh-user
USER gosh-user
ENV SHELL=/home/linuxbrew/.linuxbrew/bin/gosh
CMD ["/bin/bash", "-c", "gosh"]

starts and I am unable to use input when you click enter it crashes

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

  • Operating System: Docker
  • Terminal Emulator: (i.e. iTerm2)
  • tag of go-prompt or commit revision:

here is the code

command := prompt.Input("", Completer, prompt.OptionHistory(GetCommandHist()), prompt.OptionSuggestionBGColor(prompt.DefaultColor),
			prompt.OptionInputTextColor(prompt.Cyan),
			prompt.OptionMaxSuggestion(6),
			prompt.OptionTitle("gosh"),
			prompt.OptionAddKeyBind(prompt.KeyBind{
				Key: prompt.ControlC,
				Fn: func(buf *prompt.Buffer) {
					ThePrompt()
				}}),
@JesterOrNot
Copy link
Author

Any updates on this issue?

@JesterOrNot
Copy link
Author

Any updates on this?

@mceloud
Copy link

mceloud commented Mar 9, 2020

I hit the same issue using KVM in vnc console. Also tried to run from latest revision, but with no luck. Is there any update?

have the issue with just starting the binary inside:

[vesbkp@master-0 ~]$ vpmu
panic: runtime error: integer divide by zero

goroutine 1 [running]:
marek/vpm/vendor/github.com/c-bata/go-prompt.(*Render).toPos(...)
	/go/src/marek/vpm/vendor/github.com/c-bata/go-prompt/render.go:268
marek/vpm/vendor/github.com/c-bata/go-prompt.(*Render).move(0xc000028000, 0x1a, 0x0, 0x4)
	/go/src/marek/vpm/vendor/github.com/c-bata/go-prompt/render.go:257 +0xcc
marek/vpm/vendor/github.com/c-bata/go-prompt.(*Render).clear(0xc000028000, 0x1a)
	/go/src/marek/vpm/vendor/github.com/c-bata/go-prompt/render.go:244 +0x3e
marek/vpm/vendor/github.com/c-bata/go-prompt.(*Render).BreakLine(0xc000028000, 0xc000328040)
	/go/src/marek/vpm/vendor/github.com/c-bata/go-prompt/render.go:231 +0x209
marek/vpm/vendor/github.com/c-bata/go-prompt.(*Prompt).feed(0xc00015e000, 0xc000365400, 0x1, 0x400, 0x1, 0x5)
	/go/src/marek/vpm/vendor/github.com/c-bata/go-prompt/prompt.go:120 +0x2a6
marek/vpm/vendor/github.com/c-bata/go-prompt.(*Prompt).Run(0xc00015e000)
	/go/src/marek/vpm/vendor/github.com/c-bata/go-prompt/prompt.go:72 +0x570
main.main()
	/go/src/marek/vpm/cmd/vpmu/main.go:77 +0x206

@JesterOrNot
Copy link
Author

So it errors during any kind of virtualization hmm.

@mceloud
Copy link

mceloud commented Mar 9, 2020

I debugged a little and to root cause is that rows and cols are set to 0 size in console

$ stty size
0 0

changing the size worked for me $ stty cols 83 rows 40

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants