From 77a743d702bff9308de9e194b141014cf5fb0e9a Mon Sep 17 00:00:00 2001 From: Zach Riggle Date: Mon, 21 Dec 2015 10:28:12 -0800 Subject: [PATCH] Revert "should fix the issue with home and end keys not working if the prompt is colorized" This reverts commit 1dc48464904872ca4e7e82734548254a21c32c0b. --- pwndbg/__init__.py | 10 ++++++++-- pwndbg/color.py | 25 ++++++++++++------------- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/pwndbg/__init__.py b/pwndbg/__init__.py index 461f07a3d..303bda922 100644 --- a/pwndbg/__init__.py +++ b/pwndbg/__init__.py @@ -80,8 +80,14 @@ __all__ = [ 'vmmap' ] -prompt = pwndbg.color.red('pwn> ') -prompt = pwndbg.color.bold(prompt) +# If the prompt is colorized, then the home and end keys +# don't work properly when on the prompt line. +# +# Instead, we set the prompt to be very plain. +# +# prompt = pwndbg.color.red('pwn> ') +# prompt = pwndbg.color.bold(prompt) +prompt = 'pwn> ' pre_commands = """ set confirm off diff --git a/pwndbg/color.py b/pwndbg/color.py index f26990079..a73b0ba2f 100644 --- a/pwndbg/color.py +++ b/pwndbg/color.py @@ -2,19 +2,17 @@ import gdb import pwndbg.enhance import pwndbg.vmmap -SOH = "\x01" -STX = "\x02" -NORMAL = SOH + "\x1b[0m" + STX -BLACK = SOH + "\x1b[30m" + STX -RED = SOH + "\x1b[31m" + STX -GREEN = SOH + "\x1b[32m" + STX -YELLOW = SOH + "\x1b[33m" + STX -BLUE = SOH + "\x1b[34m" + STX -PURPLE = SOH + "\x1b[35m" + STX -CYAN = SOH + "\x1b[36m" + STX -GREY = GRAY = SOH + "\x1b[90m" + STX -BOLD = SOH + "\x1b[1m" + STX -UNDERLINE = SOH + "\x1b[4m" + STX +NORMAL = "\x1b[0m" +BLACK = "\x1b[30m" +RED = "\x1b[31m" +GREEN = "\x1b[32m" +YELLOW = "\x1b[33m" +BLUE = "\x1b[34m" +PURPLE = "\x1b[35m" +CYAN = "\x1b[36m" +GREY = GRAY = "\x1b[90m" +BOLD = "\x1b[1m" +UNDERLINE = "\x1b[4m" STACK = YELLOW HEAP = BLUE @@ -67,3 +65,4 @@ def legend(): UNDERLINE + 'RWX' + NORMAL, 'RODATA' )) +