I want to handle \x1b[6n terminal sequence in python (it returns cursor position). When I tried:
import subprocess as sp
proc = sp.Popen(["echo", "-e", "\\x1b[6n"], stdin=sp.PIPE)
print(proc.communicate()[0])
It gives me b'\x1b[6n'. But when I typed in bash:
echo -e "\x1b[6n"
It gives to me what I expected. How to handle it correctly in Python?