awesome-gocui / gocui

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

[BUG]Err Fprintln #94

Open gczgcz2015 opened 3 years ago

gczgcz2015 commented 3 years ago

Describe the bug when i run hello example somting wrong

To Reproduce run hello example

Expected behavior correct print

Screenshots image

Environment (please complete the following information): Linux version 5.10.7-3-MANJARO (builduser@LEGION) (gcc (GCC) 10.2.0, GNU ld (GNU Binutils) 2.35.1) #1 SMP PREEMPT Fri Jan 15 21:11:34 UTC 2021

mjarkk commented 3 years ago

From your screenshot it looks like you're using GoLand's integrated terminal and from prior experience they seem to have a bit of a buggy terminal.
Does this also happen in the dedicated terminal application?

gczgcz2015 commented 3 years ago

From your screenshot it looks like you're using GoLand's integrated terminal and from prior experience they seem to have a bit of a buggy terminal. Does this also happen in the dedicated terminal application?

image i tried 2 different terminal(konsole,alacritty), still has problem

dankox commented 3 years ago

Hi, do you use monospace font on your terminals? The text seems to take less space than the frame characters.

Another question is, what version of gocui are you using. From the IDE screenshot, it seems like you have old version v0.4.0 or v0.3.1. Can you check if you build with the latest one?

gczgcz2015 commented 2 years ago

Hi, do you use monospace font on your terminals? The text seems to take less space than the frame characters.

Another question is, what version of gocui are you using. From the IDE screenshot, it seems like you have old version v0.4.0 or v0.3.1. Can you check if you build with the latest one?

version is 1.0.1

mjarkk commented 2 years ago

Which terminal font are you using?

gczgcz2015 commented 2 years ago

Which terminal font are you using?

font is Source Code Pro when i use jroimartin/gocui, it's OK

mjarkk commented 2 years ago

Can you try to run the tcell demos and check if they work?

https://github.com/gdamore/tcell/tree/master/_demos

dankox commented 2 years ago

Can you also try the hello.go example and set the frame to be ascii? You can do that by updating main() function like this:

func main() {
    g, err := gocui.NewGui(gocui.OutputNormal, true)
    if err != nil {
        log.Panicln(err)
    }
    defer g.Close()
    g.ASCII = true  // <- this line was added

    g.SetManagerFunc(layout)

Also I would like you to try this command in the terminal (alacritty or whatever you are using and seeing the problems):

printf "┌─────────────┐\n│Hello world! │\n└─────────────┘\n"

Let us know how the output looks like. This is the same as hello.go is producing, so we might be sure if the problem is in the underlying library, or in the terminal setup.

gczgcz2015 commented 2 years ago

Can you also try the hello.go example and set the frame to be ascii? You can do that by updating main() function like this:

func main() {
  g, err := gocui.NewGui(gocui.OutputNormal, true)
  if err != nil {
      log.Panicln(err)
  }
  defer g.Close()
  g.ASCII = true  // <- this line was added

  g.SetManagerFunc(layout)

Also I would like you to try this command in the terminal (alacritty or whatever you are using and seeing the problems):

printf "┌─────────────┐\n│Hello world! │\n└─────────────┘\n"

Let us know how the output looks like. This is the same as hello.go is producing, so we might be sure if the problem is in the underlying library, or in the terminal setup.

when add ascII = true it's OK

image

dankox commented 2 years ago

Ok and what about the printf command? Did it work?
From the ASCII=true sample, it seems that the problem might be the monospace font which you are using. So to confirm this, if you could try that printf to see if it displays correctly or not. Thanks