(x: number, y: number)
| 167 | * Positive y = down, negative y = up |
| 168 | */ |
| 169 | export function cursorMove(x: number, y: number): string { |
| 170 | let result = '' |
| 171 | // Horizontal first (matches ansi-escapes behavior) |
| 172 | if (x < 0) { |
| 173 | result += cursorBack(-x) |
| 174 | } else if (x > 0) { |
| 175 | result += cursorForward(x) |
| 176 | } |
| 177 | // Then vertical |
| 178 | if (y < 0) { |
| 179 | result += cursorUp(-y) |
| 180 | } else if (y > 0) { |
| 181 | result += cursorDown(y) |
| 182 | } |
| 183 | return result |
| 184 | } |
| 185 | |
| 186 | // Save/restore cursor position |
| 187 |
no test coverage detected