Cursor positioning in TeraTerm

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
s_hatch
Posts: 24
Joined: Wed Nov 25, 2015 6:50 pm

Cursor positioning in TeraTerm

Post by s_hatch » Sun May 13, 2018 11:56 pm

I use TeraTerm and would like to use cursor positioning when using my pyboard. How does one send escape sequences to the TeraTerm terminal emulating a VT100?

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Cursor positioning in TeraTerm

Post by Roberthh » Mon May 14, 2018 5:41 am

For instance:

Code: Select all

import sys
def goto(row, col):
    sys.stdout.write("\x1b[{};{}H".format(row + 1, col + 1))

s_hatch
Posts: 24
Joined: Wed Nov 25, 2015 6:50 pm

Re: Cursor positioning in TeraTerm

Post by s_hatch » Mon May 14, 2018 11:40 am

Thank you for responding. It works perfectly.

Post Reply