Open trufae opened 8 months ago
@docds are you on windows? or which terminal is this that doesnt support ansi?
can you try appluing this patch and see if at least the 2K disappears?
diff --git a/libr/cons/dietline.c b/libr/cons/dietline.c
index 229aaf451d..25a1e6d65d 100644
--- a/libr/cons/dietline.c
+++ b/libr/cons/dietline.c
@@ -1760,7 +1752,7 @@ R_API const char *r_line_readline_cb(RLineReadCallback cb, void *user) {
bool o_do_setup_match = I.history.do_setup_match;
I.history.do_setup_match = true;
if (I.echo && cons->context->color_mode) {
- r_cons_clear_line (0);
+ // r_cons_clear_line (0);
}
(void) r_cons_get_size (&rows);
switch (*buf) {
I make build on Debian 12.5 with default terminal (VirtualBox), but testing from Windows 10 (cmd) I clone master "git clone https://github.com/radareorg/radare2.git" and rebuild project.
After start r2 in cmd through "adb shell" terminal looks like that:
./r2 --
←[0m[0x00000000]> ←[0m
Wen I pres first key "d":
./r2 --
←[0m[0x00000000]> ←[0md[0m←[2K
"dc" pressed
./r2 --
←[0m[0x00000000]> ←[0mdc[0m←[2K
"Enter" pressed
./r2 --
[0x00000000]> ←[0mdc←[0m[0m←[2K
ERROR: Cannot continue, run ood?
←[0m[0x00000000]> ←[0m
Ah that makes sense, those escape codes are ANSI and windows terminal doesnt support them, so i would suggest you to do the following thing:
adb shell r2 -e scr.fgets=true --
this will use fgets instead of the dietline input method, which will not have autocompletion or ansi escape codes. but i would suggest you to try another terminal that supports this or just use ssh into the device.
are the colors working? or you need to do -e scr.color=0 too?
Thanks. Cmd indeed was culprit. When use -e scr.fgets=true parameter no weird chars appear. Colors works just fine.
I found brand new replacement for CMD from Microsoft. Leave it here for feather generations. :-). ANSI Terminal support The ANSI features are designed to be compatible with the xterm-based terminals. For more information, see xterm in Wikipedia. On Windows 10 and higher, the Windows Console Host is xterm compatible. The Windows Terminal application is also xterm compatible.
Start just "r2 --"
I will going to get some Raspberry Pi (4/5) device and put there Android and do some experiment. When I run Android arm emulator on x86 platform it work really slow and I don’t wont to root my personal cell phone.
But still. its weird because the colors work in cmd->adb, the issue seems to be only in the repl prompt 🤔
maybe it is unrelated. I tried use my build on emulator and xiaomi android 14 device through adb shell On both appear artifacts around cursor:
by @docds
reported https://github.com/radareorg/radare2/issues/22750#issuecomment-2019200923