term.getCursorPos

From ComputerCraft
Jump to: navigation, search

term.getCursorPos
Function
Syntax
term.getCursorPos()
Returns number x, number y
API term
Source CC:Tweaked (source)

Returns the current X and Y position of the cursor of the terminal object.

ExampleExampleGet cursor pos
Prints the cursor position of the current term.
Code
local x, y = term.getCursorPos()
print(x, y)
Output
1, 3