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

Goland 2024.1.1 doesn't render correctly in Run/Debug Terminal #204

Open
flyinprogrammer opened this issue Apr 30, 2024 · 6 comments · May be fixed by charmbracelet/bubbletea#1028
Open
Labels
bug Something isn't working

Comments

@flyinprogrammer
Copy link

Describe the bug
huh should work in the Run/Debug console of Goland, it doesn't seem to work consistently. Sometimes, the screens render, and sometimes, they don't.

To Reproduce
Steps to reproduce the behavior:

  1. Clone this repo
  2. Open in Goland
  3. Open examples > burger > main.go
  4. Click the green triangle next to the main() function.

Expected behavior
The Run/Debug Console should display the opening screen of the burger demo app.

Screenshots
Running in the console is broken:
broken_run_console

Running in the terminal works just fine:
working_terminal

Desktop (please complete the following information):

  • OS: macOS 14.4.1
  • Editor: Goland 2024.1.1
  • Version: huh v0.3.0

Additional context
Given that my huh app seems to run in a wide variety of terminals, I have to imagine this is Jetbrains' problem 🤷 but I am a child, I have no idea how any of this actually works.

I have opened a ticket with Jetbrains here: https://youtrack.jetbrains.com/issue/GO-16810/

@shedyfreak
Copy link
Contributor

Hey, I have no idea how the Goland debugger is running but this how I do it
I open terminal and I run this command :
dlv debug --headless --api-version=2 --listen=127.0.0.1:43000 .
to put it simply this will start a debugging server
Now, where you should do some work by yourself is here :
since I use VS code I have a config file called launch.json
and here how it looks like

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Attach to Remote",
            "type": "go",
            "request": "attach",
            "mode": "remote",
            "port": 43000,
            "host": "127.0.0.1",
            "showLog": true,
        }
    ]
}

as you might have seen here, VS code becomes a client to the dlv debugger run previously on terminal,
when I run debug on vs code it get it "attach" directly to the remote terminal debugger and starts debugging
you need now to find the equivalend of this config in Goland, let me know if you're still struggeling

@nervo
Copy link
Contributor

nervo commented May 28, 2024

As far as i can see, this breaks between v0.2.3 and v0.3.0 :(

Edit: 'got it ! This was introduced with #95 by @maaslalani

Let see if i can spot where the problem is...

@shedyfreak
Copy link
Contributor

@nervo Hmmm I think I m missing something here, so in Goland you don't need to run dlv and attach, this is done by Goland debugger itself ?

@nervo
Copy link
Contributor

nervo commented May 28, 2024

@shedyfreak sorry, but are you sure you're on the right issue ? This one is about rendering problems in goland, i'm not convinced this could be related to delve :)

@shedyfreak
Copy link
Contributor

@nervo hmm sorry, I might have misunderstood the issue, but it seems like the issue couldn't be from Goland terminal since, as mentionned in the description of the bug, works fine.

He said that he has an issue when debugging which ( on the Debug Console aka Console as he refers to it) which made me assume something is wrong between running the debugger and attaching Goland debugger client to the debugger server, which made me question how debugging in Bubbletea apps in Goland.
please don't hesitate to correct me if you think I got it wrong.

@flyinprogrammer
Copy link
Author

Hey @shedyfreak thanks for trying to help! This issue is an issue with Goland both with its Run and Debug console.

Hmmm I think I m missing something here, so in Goland you don't need to run dlv and attach, this is done by Goland debugger itself ?

Goland auto-magically creates dlv cli commands and executes them, see an example in this screenshot:

Screenshot 2024-06-06 at 9 27 26 AM

(This terminal is interactive, but all the text was generated by Goland or the CLI tools it calls on your behalf.)

@nervo you're brilliant dude! Sorry for being so uneducated about WindowSizeMsgs or how to further debug this on my own. I sincerely appreciate you and your time in looking into this further!

@caarlos0 caarlos0 added the bug Something isn't working label Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants