jroimartin / gocui

Minimalist Go package aimed at creating Console User Interfaces.
BSD 3-Clause "New" or "Revised" License
9.92k stars 608 forks source link

The layout is skewed on Windows #105

Closed knqyf263 closed 7 years ago

knqyf263 commented 7 years ago

I built this sample code and ran on Windows 7. https://github.com/jroimartin/gocui#example

The layout is skewed. How can I avoid this?

2017-03-25 16 44 50

Thank you for the awesome library!

eduncan911 commented 7 years ago

i'm not affiliated with the project, just a passer-by...

but, you'll need to supply more details.

what shell are you using? CMD? trying to run from cygwin?

In the past, most of my problems for "alignment" has been the shell didn't have the correct variables set. so, the application just had to make best guesses (120x80? 80x30?, etc). that may have been what happened here?

try making your console Fullscreen, and run it again via command line. most likely it is trying for something wider than your current console, and it is wrapping.

knqyf263 commented 7 years ago

@eduncan911 Thanks for your advice!

I use cmd.exe. The behavior is below.

gocui

I used this sample code. https://github.com/jroimartin/gocui#example

After try making my console fullscreen, the result is the same:cry:

gocui_fullscreen

awnumar commented 7 years ago

I remember someone mentioning this exact issue before, but I can't seem to find it. What version are you using?

knqyf263 commented 7 years ago

I'm using the latest version of gocui. I did go get github.com/jroimartin/gocui a while ago.

The latest commit is 612b0b2987ec1a6af46d7008cef1efd4b3898346

I cross-compiled on Mac. Is it affected?

$ go version
go version go1.7.5 darwin/amd64
$ GOOS=windows GOARCH=386 go build
awnumar commented 7 years ago

Shouldn't be. Cross compiling in Go should be the same as compiling on the target platform.

On Thu, 18 May 2017, 05:27 Teppei Fukuda, notifications@github.com wrote:

I'm using the latest version of gocui. I did go get github.com/jroimartin/gocui a while ago.

The latest commit is 612b0b2987ec1a6af46d7008cef1efd4b3898346

I cross-compiled on Mac. Is it affected?

$ go version go version go1.7.5 darwin/amd64 $ GOOS=windows GOARCH=386 go build

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jroimartin/gocui/issues/105#issuecomment-302297243, or mute the thread https://github.com/notifications/unsubscribe-auth/AIhznxT3fYJfFdCXBLTGWVRv1dl4utehks5r68jCgaJpZM4MpADR .

jroimartin commented 7 years ago

Can you try setting g.ASCII = True?

https://github.com/jroimartin/gocui/blob/master/gui.go#L66-L68

Related: #93, #91

jroimartin commented 7 years ago

I'm closing the issue for now. I think it duplicates the issues linked in my last comment. It that's not the case, feel free to reopen it :)