cs01 / gdbgui

Browser-based frontend to gdb (gnu debugger). Add breakpoints, view the stack, visualize data structures, and more in C, C++, Go, Rust, and Fortran. Run gdbgui from the terminal and a new tab will open in your browser.
https://gdbgui.com
GNU General Public License v3.0
9.9k stars 499 forks source link

The font in terminal changes every time when I open gdbgui #298

Open ghost opened 5 years ago

ghost commented 5 years ago

Hi,

I'm using Win10 Linux subsystem Ubuntu 18. Before I open gdbgui, the terminal is like: image

Once I open gdbgui, the font changes automatically and looks very ugly: image

How can I solve the issue? Thanks!

bjorn3 commented 5 years ago

How is it even possible for a program to change the font of a terminal emulator? Only the user should be able to change the font.

cs01 commented 5 years ago

@bjorn3 I agree this seems unexpected. I did a quick search and found https://stackoverflow.com/questions/3592673/change-console-font-in-windows, so it is technically possible for a program to change the font in Windows.

That said, this is certainly not something gdbgui is doing intentionally.

It might somehow be done in one of the dependencies of gdbgui. These are the packages that are installed and used by gdbgui:

Click==7.0
Flask==0.12.4
Flask-Compress==1.4.0
Flask-SocketIO==2.9.6
gdbgui==0.13.2.0
gevent==1.4.0
greenlet==0.4.15
itsdangerous==1.1.0
Jinja2==2.10.3
MarkupSafe==1.1.1
pkg-resources==0.0.0
pygdbmi==0.9.0.2
Pygments==2.4.2
python-engineio==3.9.3
python-socketio==4.3.1
six==1.12.0
Werkzeug==0.16.0

I don't know specifically what is causing it to behave this way. What you might want to do is insert a breakpoint in the Python code with an interactive debugger like pdb or ipdb, and step through the code line-by-line until you can pin down the exact line that modifies the font in your terminal. The file to do this in is gdbgui/backend.py.

Depending on which line is causing the issue, we can then consider next steps on how to fix the issue.

bjorn3 commented 5 years ago

I did a quick search and found https://stackoverflow.com/questions/3592673/change-console-font-in-windows, so it is technically possible for a program to change the font in Windows.

I think that would only work when using real Windows programs, and not Linux programs with WSL.

cs01 commented 5 years ago

That might be the case. I don't use either so I don't know.