summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2015-04-15 13:08:02 -0400
committerMatthew Barnes <mbarnes@redhat.com>2015-04-15 13:08:58 -0400
commit2ae5d113a29a2aa883f5597bf575dcd6c82141bc (patch)
tree741c97700abfe27a6aa13ca1160f0035d0501ee5
parent8e42581f4d03c8911f17304e8097a0e6147292c5 (diff)
downloadlibgsystem-2ae5d113a29a2aa883f5597bf575dcd6c82141bc.tar.gz
console: Further clarify escape codes
Found the flippin' manual.
-rw-r--r--src/gsystem-console.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gsystem-console.c b/src/gsystem-console.c
index 46b48af..806d619 100644
--- a/src/gsystem-console.c
+++ b/src/gsystem-console.c
@@ -346,9 +346,12 @@ gs_console_begin_status_line (GSConsole *console,
out = gs_console_get_stdout ();
+ /* This uses private DEC escape codes, defined at:
+ * http://vt100.net/docs/vt220-rm/chapter4.html#S4.7 */
+
if (!console->in_status_line)
{
- /* See http://en.wikipedia.org/wiki/ANSI_escape_code, using the DEC codes */
+ /* Save Cursor (DECSC) - ESC 7 */
guint8 buf[3] = { (guint8)'\n', 0x1B, 0x37 };
if (!g_output_stream_write_all (out, buf, sizeof (buf), &bytes_written,
cancellable, error))
@@ -358,6 +361,7 @@ gs_console_begin_status_line (GSConsole *console,
}
{
+ /* Restore Cursor (DECRC) - ESC 8 */
guint8 buf[2] = { 0x1B, 0x38 };
if (!g_output_stream_write_all (out, buf, sizeof (buf), &bytes_written,
cancellable, error))