radareorg / radare2

UNIX-like reverse engineering framework and command-line toolset
https://www.radare.org/
GNU Lesser General Public License v3.0
20.7k stars 3.01k forks source link

Visual mode highlight does not support backspace. #2313

Closed ghost closed 9 years ago

ghost commented 9 years ago

The highlight command (/) responds to delete (ascii 0x7F) but not backspace/\b (ascii 0x7). Most modern terminals translate the 'Backspace' key to delete. Some older terminals translate it to backspace. For compatibility reasons, both are usually supported. Perhaps we could make highlight use dietline.

radare commented 9 years ago

what? do you want backspace to be considered a valid char in the input instead of removing the last char?

ghost commented 9 years ago

Preferably it would remove the last character. Currently, backspace is just echoed back. For example:

highlight: acd^H^Hbcd
radare commented 9 years ago

Not for me. I tried on several terminals and operating systems. Can you provide more details of your setup?

On 06 Apr 2015, at 14:54, Evan Teitelman notifications@github.com wrote:

Preferably it would remove the last character. Currently, backspace is just echoed back. For example:

highlight: acd^H^Hbcd — Reply to this email directly or view it on GitHub.

ghost commented 9 years ago

Apparently the function uses fgets, leaving any processing up to the terminal. The problem occurs with line disciplines that process delete but not backspace (most modern line disciplines behave in this manner). Also, it would be nice if highlight processed arrow keys and such. Using some sort of readline implementation for highlight would fix this.

radare commented 9 years ago

nope its not, its already using dietline

radare commented 9 years ago

can you provide arch/os/r2version?

ghost commented 9 years ago

Version is:

radare2 0.9.9-git 7535 @ linux-little-x86-64 git.0.9.8-1186-g560e983
commit: 560e983d6a9a328aa26662a90b7b1b317edc5db8 build: 2015-04-07
dequis commented 9 years ago

Also, would help to mention the name of terminal which behaves like this.

radare commented 9 years ago

Iirc i already fixed this

On 07 Apr 2015, at 16:28, Evan Teitelman notifications@github.com wrote:

Apparently the function uses fgets, leaving any processing up to the terminal. The problem occurs with line disciplines that process delete but not backspace (most modern line disciplines behave in this manner). Also, it would be nice if highlight processed arrow keys and such. Using some sort of readline implementation for highlight would fix this.

— Reply to this email directly or view it on GitHub.