About text-based user interface for Windows and Linux

412 views
Skip to first unread message

洪嘉鴻

unread,
Apr 30, 2020, 3:55:36 AM4/30/20
to golang-nuts
Hello everyone:
I use golang with Win10.
I want to make some text-based user interface executables for Windows and Linux.
There are sure many libraries about text-based user interface, such as tcell, termbox, gocui, termui, tui, tview, and so on.
However, the boxes and some words are cut while executing.
The followings are the pictures which execute "tview" on Windows and Linux(VMware Ubuntu 18.04).

Windows.PNG VMware (Ubuntu).PNG


The problem always happen while executing on Windows whatever using any libraries mentioned above, while some happen while executing on Linux.
I have no idea what causes the results.
Does anyone know why and how to solve?


Any help is appreciated.
Thank you very much!
Max

Jason E. Aten

unread,
May 1, 2020, 11:01:57 PM5/1/20
to golang-nuts
All the terminal emulators I've seen on Windows are garbage. I've only tried the free ones though. You could go through a
list like this https://www.slant.co/topics/1552/~best-terminal-emulators-for-windows systematically and try them all. Who knows,
maybe one of the paid-for ones will work. 

Whether Quick-Edit mode is on or off in the cmd.exe windows can make a difference for things like mouse clicks (https://github.com/gdamore/tcell/issues/182 ),

 But really, write a web page instead.

洪嘉鴻

unread,
May 3, 2020, 9:24:37 PM5/3/20
to golang-nuts
I'm looking for cross-compile source code examples about text-based user interface for Windows and Linux, not the terminal emulators.
I think it might be difficult to find the examples that could work on both Windows and Linux.

Thanks for your replying!
Max

Jason E. Aten於 2020年5月2日星期六 UTC+8上午11時01分57秒寫道:

Jason E. Aten

unread,
May 3, 2020, 9:45:57 PM5/3/20
to golang-nuts
You didn't take my meaning. The reason the examples don't work on Windows is because the terminal emulator on Windows is messing them up.

https://github.com/gdamore/proxima5 is an example. Tcell is cross platform.

洪嘉鴻

unread,
May 4, 2020, 12:05:35 AM5/4/20
to golang-nuts
I see.
Actually I only want to make a simple application.
The application is about segmenting two text-boxes for input and output.
I've tried this and it seems good, except for the complicated example such as "demo".
(The terminal emulator on Windows really mess "demo" up.)
However, it seems that there is not any functions to scan input with "termui".
The answer I found from this could't solve the problem because the the type "Attribute" and "TextBuilder" are undefined within "input.go".
I've just asked the author.
Besides, I've also tried Tcell.
However, there is not more examples for learning.
Did you find any examples and could you offer the link?

Thanks for your replying.
Max

Jason E. Aten於 2020年5月4日星期一 UTC+8上午9時45分57秒寫道:

Robert Engels

unread,
May 4, 2020, 9:06:08 AM5/4/20
to 洪嘉鴻, golang-nuts

It has a nice example of using gcui 

On May 3, 2020, at 11:06 PM, 洪嘉鴻 <max1...@gmail.com> wrote:


--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/3aaf75d8-d992-4612-91c4-ae73094f8157%40googlegroups.com.

洪嘉鴻

unread,
May 4, 2020, 10:12:58 PM5/4/20
to golang-nuts
I tried to get and install the package.
However, when I use "go get github.com/robaho/go-trader", it displayed "package github.com/robaho/go-trader: no Go files in "$GOPATH\src\github.com\robaho\go-trader".
I use 1.12.9 of go version on Windows 10.
Is the version that I used not suitable?

Thanks for your replying.
Max

Robert Engels於 2020年5月4日星期一 UTC+8下午9時06分08秒寫道:

It has a nice example of using gcui 

On May 3, 2020, at 11:06 PM, 洪嘉鴻 <max1...@gmail.com> wrote:


I see.
Actually I only want to make a simple application.
The application is about segmenting two text-boxes for input and output.
I've tried this and it seems good, except for the complicated example such as "demo".
(The terminal emulator on Windows really mess "demo" up.)
However, it seems that there is not any functions to scan input with "termui".
The answer I found from this could't solve the problem because the the type "Attribute" and "TextBuilder" are undefined within "input.go".
I've just asked the author.
Besides, I've also tried Tcell.
However, there is not more examples for learning.
Did you find any examples and could you offer the link?

Thanks for your replying.
Max

Jason E. Aten於 2020年5月4日星期一 UTC+8上午9時45分57秒寫道:
You didn't take my meaning. The reason the examples don't work on Windows is because the terminal emulator on Windows is messing them up.

https://github.com/gdamore/proxima5 is an example. Tcell is cross platform.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golan...@googlegroups.com.

Kurtis Rader

unread,
May 4, 2020, 10:25:05 PM5/4/20
to 洪嘉鴻, golang-nuts
On Mon, May 4, 2020 at 7:13 PM 洪嘉鴻 <max1...@gmail.com> wrote:
I tried to get and install the package.
However, when I use "go get github.com/robaho/go-trader", it displayed "package github.com/robaho/go-trader: no Go files in "$GOPATH\src\github.com\robaho\go-trader".
I use 1.12.9 of go version on Windows 10.
Is the version that I used not suitable?

Works for me. If you're doing that at work there is probably a firewall that is disrupting the "go get" network traffic. Regardless, since all you want to do is download the source to review it just do "git clone https://github.com/robaho/go-trader". And if that doesn't work you need to figure out what is wrong with your connection to the Internet.

--
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank

洪嘉鴻

unread,
May 4, 2020, 11:15:12 PM5/4/20
to golang-nuts
I've downloaded from git clone.
However, there was a message that displayed "use of internal package github.com/robaho/go-trader/internal/exchange not allowed" with "algo.go".
I'm sure that there does a file "exchange" in the directory.
Therefore, I have no idea what causes the problem and how to edit.

Thanks for your replying.
Max
 



Kurtis Rader於 2020年5月5日星期二 UTC+8上午10時25分05秒寫道:

robert engels

unread,
May 4, 2020, 11:26:02 PM5/4/20
to 洪嘉鴻, golang-nuts
There is no file algo.go in the repo so I am not sure what you are doing.

I just tested cmd/algo with Intellij and it ran fine.

You would be interested in the file cmd/client/main.go to see how to use gocui.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/51c049be-bdd3-468b-9d2a-ec307698fd9b%40googlegroups.com.

Kurtis Rader

unread,
May 4, 2020, 11:33:15 PM5/4/20
to 洪嘉鴻, golang-nuts
On Mon, May 4, 2020 at 8:15 PM 洪嘉鴻 <max1...@gmail.com> wrote:
I've downloaded from git clone.
However, there was a message that displayed "use of internal package github.com/robaho/go-trader/internal/exchange not allowed" with "algo.go".
I'm sure that there does a file "exchange" in the directory.
Therefore, I have no idea what causes the problem and how to edit.

 There is no way that "git clone" produced that error message. You need to tell us what command you ran that resulted in that error. However, I suspect you ran "go build" or something similar. My suggestion to run "git clone" was predicated on you wanting to just review the source code; not build it. If you want to be able to build it, and import it into other projects, then you need to figure out why "go get" doesn't work on your system.

Message has been deleted

洪嘉鴻

unread,
May 5, 2020, 2:33:34 AM5/5/20
to golang-nuts
Here are the pictures that I tested and displayed panic error.
I have no idea what causes the problem.

client.PNGalgo.PNG


Thank you very much!
Max


robert engels於 2020年5月5日星期二 UTC+8上午11時26分02秒寫道:
To unsubscribe from this group and stop receiving emails from it, send an email to golan...@googlegroups.com.

洪嘉鴻

unread,
May 5, 2020, 2:37:38 AM5/5/20
to golang-nuts
I didn't run "go build".
The message was displayed under the problem of Visual Studio Code.
However, the message was disappeared after I restart the source code.

Thank you very much!
Max

Kurtis Rader於 2020年5月5日星期二 UTC+8上午11時33分15秒寫道:
Reply all
Reply to author
Forward
0 new messages