Skip to content

Commit

Permalink
tty-win: fix absolute cursor positioning
Browse files Browse the repository at this point in the history
  • Loading branch information
piscisaureus committed Sep 27, 2011
1 parent b0a9d60 commit f5f005d
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/win/tty.c
Expand Up @@ -1319,13 +1319,21 @@ static int uv_tty_write_bufs(uv_tty_t* handle, uv_buf_t bufs[], int bufcnt,
uv_tty_move_caret(handle, 0, 0, y, 1, error);
break;

case 'G':
/* cursor horizontal move absolute */
FLUSH_TEXT();
x = (handle->ansi_csi_argc >= 1 && handle->ansi_csi_argv[0])
? handle->ansi_csi_argv[0] - 1 : 0;
uv_tty_move_caret(handle, x, 0, 0, 1, error);
break;

case 'H':
case 'f':
/* Cursor absolute */
/* cursor move absolute */
FLUSH_TEXT();
x = (handle->ansi_csi_argc >= 1 && handle->ansi_csi_argv[0])
y = (handle->ansi_csi_argc >= 1 && handle->ansi_csi_argv[0])
? handle->ansi_csi_argv[0] - 1 : 0;
y = (handle->ansi_csi_argc >= 2 && handle->ansi_csi_argv[1])
x = (handle->ansi_csi_argc >= 2 && handle->ansi_csi_argv[1])
? handle->ansi_csi_argv[1] - 1 : 0;
uv_tty_move_caret(handle, x, 0, y, 0, error);
break;
Expand Down

0 comments on commit f5f005d

Please sign in to comment.