mgunyho / tere

Terminal file explorer
European Union Public License 1.2
1.68k stars 38 forks source link

Reduce redundant escape codes #99

Open mgunyho opened 8 months ago

mgunyho commented 8 months ago

Currently, tere outputs a lot of redundant escape codes. When starting tere in a folder containing two subfolders bar and foo, the following escape codes are printed:

^[[?25l^M
^[[1;1H^[[2K^[[1;1H^M
^[[0m^[[1m^[[4m/tmp/xxxxxxxxxx^[[0m^M
^[[1;1H^[[2K^[[1;1H^M
^[[0m^[[1m^[[4m/tmp/xxxxxxxxxx^[[0m^M
^[[23;1H^[[2K^[[23;1H^[[0m^[[1mtere 1.5.1 - Type something to search, press '?' to view help or Esc to exit.^[[0m^M
^[[24;1H^[[2K^[[24;27H^[[0m^[[1mgap search from start - smart case - sort:name - 2 / 3^[[0m^M
^[[24;1H^[[0m^[[1msearch: ^[[0m^M
^[[2;1H^[[0m^[[0m^[[1m^M
^[[24m^[[49m^[[39m.^M
^[[24m^[[49m^[[39m.^M
^[[0m^[[0m^[[K^[[0m^[[0m^[[3;1H^[[0m^[[0m^[[1m^M
^[[24m^[[48;5;7m^[[38;5;0mb^M
^[[24m^[[48;5;7m^[[38;5;0ma^M
^[[24m^[[48;5;7m^[[38;5;0mr^M
^[[0m^[[48;5;7m                                                                             ^[[0m^[[0m^[[4;1H^[[0m^[[0m^[[1m^M
^[[24m^[[49m^[[39mf^M
^[[24m^[[49m^[[39mo^M
^[[24m^[[49m^[[39mo^M
^[[0m^[[0m^[[K^[[0m^[[0m^[[5;1H^[[0m^[[0m^[[2m^M
^[[0m^[[0m^[[K^[[0m^[[0m^[[6;1H^[[0m^[[0m^[[2m^M
^[[0m^[[0m^[[K^[[0m^[[0m^[[7;1H^[[0m^[[0m^[[2m^M
^[[0m^[[0m^[[K^[[0m^[[0m^[[8;1H^[[0m^[[0m^[[2m^M
^[[0m^[[0m^[[K^[[0m^[[0m^[[9;1H^[[0m^[[0m^[[2m^M
^[[0m^[[0m^[[K^[[0m^[[0m^[[10;1H^[[0m^[[0m^[[2m^M
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