From 0ae1b0e65456db7d01238ef9ab4f5779d5b86693 Mon Sep 17 00:00:00 2001 From: Mike Bourgeous Date: Tue, 17 Jan 2017 00:15:51 -0700 Subject: [PATCH 1/2] Fix history navigation with color prompt Tell Readline to ignore the color codes in the default color prompt. See https://wiki.hackzine.org/development/misc/readline-color-prompt.html --- gdbinit | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gdbinit b/gdbinit index 84d2a88..955edb6 100644 --- a/gdbinit +++ b/gdbinit @@ -2,10 +2,10 @@ # # DESCRIPTION: A user-friendly gdb configuration file, for x86/x86_64 and ARM platforms. # -# REVISION : 8.0.5 (18/08/2013) +# REVISION : 8.0.6 (17/01/2017) # # CONTRIBUTORS: mammon_, elaine, pusillus, mong, zhang le, l0kit, -# truthix the cyberpunk, fG!, gln +# truthix the cyberpunk, fG!, gln, nitrogen # # FEEDBACK: http://reverse.put.as - reverser@put.as # @@ -213,8 +213,10 @@ end source ~/.gdbinit.local # can't use the color functions because we are using the set command +# The \001 and \002 tell Readline to ignore the color codes when calculating +# the prompt width, and are usually invisible without Readline if $COLOREDPROMPT == 1 - set prompt \033[31mgdb$ \033[0m + set prompt \001\033[31m\002gdb$ \001\033[0m\002 end # Initialize these variables else comparisons will fail for coloring From a075b8c74bade9e1b63251b3577f2f5f70201ad3 Mon Sep 17 00:00:00 2001 From: Mike Bourgeous Date: Tue, 17 Jan 2017 00:18:50 -0700 Subject: [PATCH 2/2] Add note to changelog section --- gdbinit | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gdbinit b/gdbinit index 955edb6..33caee0 100644 --- a/gdbinit +++ b/gdbinit @@ -30,6 +30,9 @@ # # CHANGELOG: (older changes at the end of the file) # +# Version 8.0.7 (17/01/2017) +# - Fix color prompt when using up/down arrow to view command history +# # Version 8.0.6 (05/09/2013) # - Add patch command to convert bytes to little-endian and patch memory #