doujian1954 2018-05-20 19:16
浏览 381
已采纳

在GoLand控制台中运行termbox-go应用

I want to create a Go app with a console UI using the termui library (which is built on top of the termbox-go library). I can build the app and run it from the command line, but it will not start inside the GoLand IDE (2018.1.3) on Windows 10.

It fails during the termbox-go init when calling syscall.Syscall with SetConsoleScreenBufferSize parameter. The size for the screen buffer is 80x25. Error message is just "The parameter is incorrect."

How can I debug a termbox-go app in the GoLand or other IDE?

  • 写回答

1条回答 默认 最新

  • dongyuan8024 2018-05-21 17:30
    关注

    I think the way to solve this is to build your executable with Go 1.10 or newer, compile it with the following flags: -gcflags="all=-N -l" (these are very important and will allow the debugger to work a lot better, and then use the Run | Attach to Local Process... option from GoLand and attach to the local process.

    I'll see if I can replicate the bug and update this accordingly.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?