From a4ac134e0ff2bb787a098f7ff62aa335dd96db85 Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Fri, 25 Feb 2022 14:27:05 -0500 Subject: [PATCH] docs: add delve instructions --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index 381feeb..cfdd66d 100644 --- a/README.md +++ b/README.md @@ -255,6 +255,23 @@ there are [Go Docs][docs]. [examples]: http://github.com/charmbracelet/bubbletea/tree/master/examples [docs]: https://pkg.go.dev/github.com/charmbracelet/bubbletea?tab=doc +## Debugging with Delve + +Since Bubble Tea apps assume control of of stdin and stdout, you’ll need to run +delve in headless mode and then connect to it: + +```bash +# Start the debugger +$ dlv debug --headless . +API server listening at: 127.0.0.1:34241 + +# Connect to it from another terminal +$ dlv connect 127.0.0.1:34241 +``` + +Note that the default port used will vary on your system and per run, so +actually watch out what address the first `dlv` run tells you to connect to. + ## Libraries we use with Bubble Tea * [Bubbles][bubbles]: Common Bubble Tea components such as text inputs, viewports, spinners and so on