Terminaal - cursor position

Hey everyone,

The way progressbars will be rendered by Term.jl, I need to be moving the cursor in the terminal around, do some stuff and then restore its position. All of this is done by printing ANSI codes.

Now, my problem is that when I restore the cursor I need to put it on a different line from where it originally was, but on the same colon. This means I can’t just save/restore the position with \e[s and \e[u, but rather I need to use something like \e[6n to get the position and then extract the column information. But I can’t get this to work, I can’t find a way to capture the position information transmitted by \e[6n.

I’ve tried writing to stdout and reading bites from sdtin or using a IOBuffer object but nothing works, instead of reading bytes with the position information I just read \e[6n as bytes.

I’ve seen this and have tried Ansillaryjl and they both work in the repl, but I can’t get them to work if I run stuff in a .jl file.

Any idea? Anyone that got this to work?