Comment 5 for bug 1197582

Revision history for this message
Antonio Terceiro (terceiro) wrote : Re: UEFI shell color codes makes it impossible to parse output with pexpect.

for a test case, it's not enough to send one character at a time. You also have to add some delay in the middle (time.sleep(0.1) once every 10 characters seem to do the trick).

The test case:

-----------------8<-----------------8<-----------------8<-----------------8<-----------------8<-----------------
import sys
import time

chars = 0
for char in "\033[23;01H2.0 \033[1m\033[33m\033[40mShell> \033[0m\033[37m\033[40m":
    sys.stdout.write(char)
    sys.stdout.flush()
    chars += 1
    if chars % 10 == 0:
        time.sleep(0.1)
-----------------8<-----------------8<-----------------8<-----------------8<-----------------8<-----------------