3 var tty = require('tty')
4 var cursor = require('../')(process.stdout)
6 // listen for the queryPosition report on stdin
10 process.stdin.once('data', function (b) {
11 var match = /\[(\d+)\;(\d+)R$/.exec(b.toString())
13 var xy = match.slice(1, 3).reverse().map(Number)
17 // cleanup and close stdin
23 // send the query position request code to stdout
24 cursor.queryPosition()
27 if (process.stdin.setRawMode) {
28 process.stdin.setRawMode(mode)