gdb-colour-filter icon indicating copy to clipboard operation
gdb-colour-filter copied to clipboard

KeyboardInterrupt breaks the shell formatting

Open sashanicolas opened this issue 7 years ago • 4 comments

When a backtrace print is too long, it will ask if you wanna continue printing or quit, this is normal behavior of GDB. Although if you interrrupt with Ctrl+C it will generate an exception which seems not being caught properly and therefore not resetting the colors and format of the shell. Leaving the letters bold and white.

sashanicolas avatar Oct 04 '18 21:10 sashanicolas

Could you attach screenshot, stacktrace, or whatever?

daskol avatar Oct 04 '18 22:10 daskol

I'm attaching a very small screenshot cause I don't want to reveal some directories (for security). But you can see how the terminal color and format change in the first image, when I pressed Ctrl+C after one or two ENTER to print more of the stack. Note that (gdb) should be printed as the bottom terminal. In the second image, when I finish printing the full backtrace, it correctly sets the colors and format back.

Each image is a screenshot of the bottom and the top of two terminal windows, so one can compare the default colors.

screenshot from 2018-10-10 15-42-09

path3399

sashanicolas avatar Oct 10 '18 20:10 sashanicolas

Also this filter is great, so useful. Another thing, but this is as improvement. The colors should not be hard coded, as if you change the terminal colors you might not be able to read the white in a white background, or the other colors depending on the background color.

Cheers!

sashanicolas avatar Oct 10 '18 21:10 sashanicolas

The issue is due to gdb page lister which is less on default. The issue is that gdb slices colored output by bytes and it is not aware of escape sequencies in output. I will try to figure out solution.

Thank you!

daskol avatar Oct 11 '18 22:10 daskol