GUAC-718: Advance cursor by column width of echo'd characters.

This commit is contained in:
Michael Jumper 2014-06-02 12:53:40 -07:00
parent b5087a2a6f
commit 122a8095e4

View File

@ -28,6 +28,7 @@
#include "terminal_handlers.h"
#include <stdlib.h>
#include <wchar.h>
/**
* Response string sent when identification is requested.
@ -46,6 +47,8 @@
int guac_terminal_echo(guac_terminal* term, unsigned char c) {
int width;
static int bytes_remaining = 0;
static int codepoint = 0;
@ -206,8 +209,12 @@ int guac_terminal_echo(guac_terminal* term, unsigned char c) {
term->cursor_col,
codepoint);
width = wcwidth(codepoint);
if (width < 0)
width = 1;
/* Advance cursor */
term->cursor_col++;
term->cursor_col += width;
}