GUAC-718: Advance cursor by column width of echo'd characters.
This commit is contained in:
parent
b5087a2a6f
commit
122a8095e4
@ -28,6 +28,7 @@
|
|||||||
#include "terminal_handlers.h"
|
#include "terminal_handlers.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <wchar.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Response string sent when identification is requested.
|
* Response string sent when identification is requested.
|
||||||
@ -46,6 +47,8 @@
|
|||||||
|
|
||||||
int guac_terminal_echo(guac_terminal* term, unsigned char c) {
|
int guac_terminal_echo(guac_terminal* term, unsigned char c) {
|
||||||
|
|
||||||
|
int width;
|
||||||
|
|
||||||
static int bytes_remaining = 0;
|
static int bytes_remaining = 0;
|
||||||
static int codepoint = 0;
|
static int codepoint = 0;
|
||||||
|
|
||||||
@ -206,8 +209,12 @@ int guac_terminal_echo(guac_terminal* term, unsigned char c) {
|
|||||||
term->cursor_col,
|
term->cursor_col,
|
||||||
codepoint);
|
codepoint);
|
||||||
|
|
||||||
|
width = wcwidth(codepoint);
|
||||||
|
if (width < 0)
|
||||||
|
width = 1;
|
||||||
|
|
||||||
/* Advance cursor */
|
/* Advance cursor */
|
||||||
term->cursor_col++;
|
term->cursor_col += width;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user