Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use colors in GDB with TUI or CGDB?

Tags:

colors

gdb

tui

cgdb

I set a color for the GDB prompt by adding this line to ~/.gdbinit:

set prompt \033[0;32m(gdb) \033[0m

This works fine in GDB, until I open the TUI. It then discards the colors and shows the raw color codes. The same thing happens if I use CGDB.

This is 2015. Is there any way I can have both colors in GDB and also view the source code I'm debugging in a subwindow (like in TUI/CGDB) at the terminal?

like image 513
Ashwin Nanjappa Avatar asked May 13 '15 03:05

Ashwin Nanjappa


1 Answers

This gdb bug was fixed a while ago (2018). Also, gdb added colorizing to the CLI and to the TUI. This first showed up, I believe, in GDB 9.1.

like image 149
Tom Tromey Avatar answered Oct 05 '22 11:10

Tom Tromey