From e6460e2ddef845096d90ca39289ae6d724c5770e Mon Sep 17 00:00:00 2001 From: Keith Winstein Date: Tue, 1 Feb 2011 01:42:15 -0500 Subject: [PATCH] HPA and VPA -- necessary to run emacs with xterm terminfo entry --- terminalfunctions.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/terminalfunctions.cpp b/terminalfunctions.cpp index 4cf4086..d0715a5 100644 --- a/terminalfunctions.cpp +++ b/terminalfunctions.cpp @@ -366,3 +366,21 @@ void CSI_DCH( Framebuffer *fb, Dispatcher *dispatch ) static Function func_CSI_DCH( CSI, "P", CSI_DCH ); +/* line position absolute */ +void CSI_VPA( Framebuffer *fb, Dispatcher *dispatch ) +{ + int row = dispatch->getparam( 0, 1 ); + fb->ds.move_row( row - 1 ); +} + +static Function func_CSI_VPA( CSI, "d", CSI_VPA ); + +/* character position absolute */ +void CSI_HPA( Framebuffer *fb, Dispatcher *dispatch ) +{ + int col = dispatch->getparam( 0, 1 ); + fb->ds.move_col( col - 1 ); +} + +static Function func_CSI_CHA( CSI, "G", CSI_HPA ); /* ECMA-48 name: CHA */ +static Function func_CSI_HPA( CSI, "\x60", CSI_HPA ); /* ECMA-48 name: HPA */