On 2016-10-06, Steve D'Aprano <steve+pyt...@pearwood.info> wrote: > On Thu, 6 Oct 2016 10:03 pm, BartC wrote: > >> I'd quite like to know too. However I've just tried a test sequence >> ("<esc>[P1d" to move the cursor to row 1) and it didn't work. If there's >> reason why something so basic won't work (hence the need for curses etc) >> then that would be useful to know too. (And how does curses manage it?!) > > I believe that curses uses a large database of terminal types and > associated escape sequences. So when you start it up, it determines > what terminal type you have (that's black magic itself) and then > works out what escape sequences you need.
Nothing magic, it just looks at the 'TERM' enviroment varible and looks up that value in the terminfo database. -- Grant Edwards grant.b.edwards Yow! I wonder if there's at anything GOOD on tonight? gmail.com -- https://mail.python.org/mailman/listinfo/python-list