Skip to content

terminal updates; dashboard rewrite; use tailwind css; other updates #346

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

Merged
merged 15 commits into from
Aug 23, 2020

Conversation

cs01
Copy link
Owner

@cs01 cs01 commented Aug 16, 2020

  • I have added an entry to docs/changelog.md

screenshot

Bottom left: gdb pty, middle: gdbgui console logs (read only), right: debugged program's IO
pty

Summary of changes

  • Rewrite of terminal code. Create three terminals on frontend: Use actual xterm on the frontend running gdb (using xterm.js), a read-only gdbgui console, and a dedicated terminal connected to I/O of the program being debugged. Using the gdb terminal in the browser now will feel exactly like running it in an actual terminal, because it actually is! A pty is being rendered with xterm.js. Tab completions, ctrl+c, and gdb's behavior are all identical.
  • The terminal rewrite uses modules that are not supported on windows: pty, fcntl and termios. Despite this, I still plan to land this PR because the UX is so much better for non-windows users. Windows users will be forced to use v0.13.x until a fix lands in 0.14.x (which may or may not happen). Tracking in issue terminals do not work on windows for gdbgui 0.14+ #348.
  • Use tailwind css in some places
  • Add more types (both TypeScript and mypy)
  • Use pytests for tests
  • Updates to docs
  • Updates to nox sessions
  • Relies on new version of pygdbmi (update GdbController API, add IoMangager, other dev improvements pygdbmi#44)
  • Replaced --gdb flag with --gdb-cmd. The --gdb-cmd argument specifies the gdb executable as well as all arguments you wish to pass to gdb at startup, for example --gdb-cmd "gdb -nx".
  • Removed --rr flag. Use --gdb-cmd rr replay instead.
  • Use ts-migrate to change all files to typescript

See changelog for more details.

Testers Wanted!

There are quite a few changes in this PR, so a beta version was published to PyPI to test this out.

If you are able to test and provide feedback, it would be appreciated!

You can test from PyPI with:

pipx run --no-cache --pip-args='--pre' gdbgui

Or you can download a build for mac/linux in the "assest" section of https://github.com/cs01/gdbgui/releases.

Feel free to add a comment to this PR with any feedback and the gdbgui version number, from pipx run gdbgui --version.

Test plan

Tested by running

> python -m gdbgui -g "rr replay"
> python -m gdbgui
> nox -s lint
> nox -s ...  # several different sessions

closes #295
closes #345
closes #293
closes #239
closes #208
closes #215
closes #336
closes #210
closes #229
closes #333
advances #312

@cs01 cs01 force-pushed the cs01/terminal-update branch from b4579b7 to 8d4384d Compare August 16, 2020 04:45
@cs01
Copy link
Owner Author

cs01 commented Aug 16, 2020

@pfmoore sorry for the random ping, but you have been so helpful in the past, and no good deed goes unpunished :).

This is a big update, but my question is focused on pty's on windows, so don't get scared away by the size of this PR :). In this PR I introduce pty's for a better end user experience. All of the problems are limited to the file gdbgui/ptylib.py, which is less than 100 lines.

https://docs.python.org/3/library/pty.html mentions

Because pseudo-terminal handling is highly platform dependent, there is code to do it only for Linux. (The Linux code is supposed to work on other platforms, but hasn’t been tested yet.)

I am testing it here using GitHub Actions, and can confirm it does not work on Windows.

I know you are a windows user and I think a core Python dev, so I was wondering if you had any advice on how I can make any progress here. If it's hopeless, I will have to drop windows support, but I figured I'd reach out to you first for any advice or ideas.

cc @uranusjr just in case you have any suggestions

Update: https://twitter.com/zooba/status/1294932765675335681

@pfmoore
Copy link

pfmoore commented Aug 16, 2020

I know you are a windows user and I think a core Python dev, so I was wondering if you had any advice on how I can make any progress here

I think @zooba's tweet pretty much covered it - Windows didn't have a pty interface until Windows 10, and the stdlib pty module doesn't support Windows yet (except maybe by accident, I guess, if the Windows 10 interface is sufficiently similar to Linux). I don't know much about how ptys work, so I can't really say much more than that, though.

Copy link

@ElectricRCAircraftGuy ElectricRCAircraftGuy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs/gettingstarted.md looks fine to me.

I'm guessing you are using GitHub pages to host your documentation on gdbgui.com? You have to buy a custom domain for this, no? Any advice on the process? I need to get my own github pages up and running.

@cs01
Copy link
Owner Author

cs01 commented Aug 22, 2020

I'm guessing you are using GitHub pages to host your documentation on gdbgui.com?

Yes

You have to buy a custom domain for this, no?

Yes

Any advice on the process? I need to get my own github pages up and running.

I use namecheap for domain names. It has a good UI and the prices seem pretty reasonable.

Setting it up was a little tricky, but not too bad after doing some internet searches. I believe the summary is you need to set up "A Records" in namecheap to point the domain to github's servers, add a CNAME record to the gh-pages branch of the gdbgui, and set the custom domain (in this case gdbgui.com) in the Settings section of the gdbgui repo on github.

tbh I'd probably just recommend using gh pages directly and not buying a custom domain name. The gh pages one will never go away, and the custom domain requires indefinite payments.

@cs01 cs01 merged commit ad576ad into master Aug 23, 2020
@cs01 cs01 deleted the cs01/terminal-update branch August 23, 2020 02:06
espressif-bot pushed a commit to espressif/esp-idf that referenced this pull request Sep 16, 2020
gdbgui intentionally (cs01/gdbgui#346) introduced dependencies that are incompatible with windows, and don't seem to have plans to resolve them anytime soon

Closes #5782
Closes #5787
Merges #5794
espressif-bot pushed a commit to espressif/esp-idf that referenced this pull request Sep 22, 2020
gdbgui intentionally (cs01/gdbgui#346) introduced dependencies that are incompatible with windows, and don't seem to have plans to resolve them anytime soon

Closes #5782
Closes #5787
Merges #5794
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment