TragicWarrior / libvterm

Based on libROTE, libvterm is a color terminal emulator. It mimics vt100, rxvt, xterm, and xterm 256 color mode
Other
38 stars 7 forks source link

libvterm doesn't handle escape sequence `\eD` correctly (it is ignored) #135

Closed okbob closed 5 years ago

okbob commented 5 years ago

see code:

#include "stdio.h"                                                                                                                     

void main()                                                                                                                            
{                                                                                                                                      
  int i;                                                                                                                               

  printf("first line\n");                                                                                                              
  for (i = 0; i < 10; i++)                                                                                                             
    printf("\eD");                                                                                                                     
  printf("last line\n");                                                                                                               
} 

libvterm result:

[pavel@nemesis ~]$ ./a.out                                                                                                           │
first line                                                                                                                           │
last line   

expected result:

[pavel@nemesis ~]$ ./a.out 
first line

last line
TragicWarrior commented 5 years ago

@okbob , good job finding some old code :) try branch escD-IND-fix and let me know if it fixes it. seems to in my test cases. easier than writing C code you can just do something like:

echo -n "test"; echo -n -e "\eD"; echo -n "test"

okbob commented 5 years ago

the fix is working.

pspg use it for some trick (although it is not necessary now, because any other related function was broken in Fedora29 and now I use workaround that doesn't need this trick :).

TragicWarrior commented 5 years ago

Great! Merged into master. Closing.