Commit 46333c98 authored by Chris Wilson's avatar Chris Wilson Committed by Chris Wilson

RedHat Bug 123845: gnome-terminal not parsing cursor position escape

2007-02-20  Chris Wilson  <chris@chris-wilson.co.uk>

	 RedHat Bug 123845: gnome-terminal not parsing cursor position escape sequence properly

	* src/caps.c:
	* src/vteseq.c: (vte_sequence_handler_cm):
		Add 'ESC [ Pn H' to cursor-position and provide default
		values.


svn path=/trunk/; revision=1707
parent 83f80298
2007-02-20 Chris Wilson <chris@chris-wilson.co.uk>
RedHat Bug 123845: gnome-terminal not parsing cursor position escape sequence properly
* src/caps.c:
* src/vteseq.c: (vte_sequence_handler_cm):
Add 'ESC [ Pn H' to cursor-position and provide default
values.
2007-02-19 Chris Wilson <chris@chris-wilson.co.uk>
Bug 409055 Terminal stays blank
......
......@@ -431,6 +431,7 @@ struct _vte_capability_string _vte_xterm_capability_strings[] = {
{CSI "G", "cursor-character-absolute", 0},
{CSI "%dG", "cursor-character-absolute", 0},
{CSI ";H", "cursor-position", 0},
{CSI "%dH", "cursor-position", 0},
{CSI "%d;H", "cursor-position", 0},
{CSI ";%dH", "cursor-position", 0},
{CSI "%d;%dH", "cursor-position", 0},
......
......@@ -1206,12 +1206,11 @@ vte_sequence_handler_cm(VteTerminal *terminal,
screen = terminal->pvt->screen;
/* We need at least two parameters. */
if ((params != NULL) && (params->n_values >= 2)) {
rowval = colval = 0;
if (params != NULL && params->n_values >= 1) {
/* The first is the row, the second is the column. */
row = g_value_array_get_nth(params, 0);
col = g_value_array_get_nth(params, 1);
if (G_VALUE_HOLDS_LONG(row) &&
G_VALUE_HOLDS_LONG(col)) {
if (G_VALUE_HOLDS_LONG(row)) {
if (screen->origin_mode &&
screen->scrolling_restricted) {
origin = screen->scrolling_region.start;
......@@ -1219,14 +1218,18 @@ vte_sequence_handler_cm(VteTerminal *terminal,
origin = 0;
}
rowval = g_value_get_long(row) + origin;
colval = g_value_get_long(col);
rowval = CLAMP(rowval, 0, terminal->row_count - 1);
colval = CLAMP(colval, 0, terminal->column_count - 1);
screen->cursor_current.row = rowval +
screen->insert_delta;
screen->cursor_current.col = colval;
}
if (params->n_values >= 2) {
col = g_value_array_get_nth(params, 1);
if (G_VALUE_HOLDS_LONG(col)) {
colval = g_value_get_long(col);
colval = CLAMP(colval, 0, terminal->column_count - 1);
}
}
}
screen->cursor_current.row = rowval + screen->insert_delta;
screen->cursor_current.col = colval;
return FALSE;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment