fusesource / jansi

Jansi is a small java library that allows you to use ANSI escape sequences to format your console output which works even on windows.
http://fusesource.github.io/jansi/
Apache License 2.0
1.12k stars 139 forks source link

cursor(x, y) generates wrong escape sequence #115

Closed tukez closed 6 years ago

tukez commented 6 years ago

Escape sequence to set cursor position is CSI n ; m H. From https://en.wikipedia.org/wiki/ANSI_escape_code

Moves the cursor to row n, column m. The values are 1-based, and default to 1 (top left corner) if omitted. A sequence such as CSI ;5H is a synonym for CSI 1;5H as well as CSI 17;H is the same as CSI 17H and CSI 17;1H

Ansi.cursor(x,y) generates "CSI< x >;< y >H", it should generate "CSI< y + 1 >;< x + 1 >H" (x,y switched and 1-based, I'm assuming Ansi.cursor(x, y) is 0-based).