summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto E. Vargas Caballero2012-08-29 19:59:43 +0200
committerRoberto E. Vargas Caballero2012-08-29 19:59:43 +0200
commit93901ca4fee8a1ab71cb8b918f3d65404460f9ce (patch)
treedca9c5766a56ef85b8047b624c76b58927289503
parentee7fd748ac7bfabda2ac37251d230b45adb3e138 (diff)
downloadst-93901ca4fee8a1ab71cb8b918f3d65404460f9ce.tar.gz
st-93901ca4fee8a1ab71cb8b918f3d65404460f9ce.tar.xz
st-93901ca4fee8a1ab71cb8b918f3d65404460f9ce.zip
Add HTS sequence
This sequence adds a new tab stop in the current horizontal position. This means that tputtab must be look for the next tab stop in the tabs array instead of using a hard coded value offset. Also, CHT sequence XXX message is removed because it is not a vt10x sequence (as far as I know it is a vt50x sequence), and it is not implemented by linux virtual terminal neither by xterm. Signed-off-by: Roberto E. Vargas Caballero <k0ga@shike2.com> --- st.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
-rw-r--r--st.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/st.c b/st.c
index d169ddf..4b7e4eb 100644
--- a/st.c
+++ b/st.c
@@ -1214,7 +1214,6 @@ csihandle(void) {
DEFAULT(escseq.arg[1], 1);
tmoveto(escseq.arg[1]-1, escseq.arg[0]-1);
break;
- /* XXX: (CSI n I) CHT -- Cursor Forward Tabulation <n> tab stops */
case 'J': /* ED -- Clear screen */
sel.bx = -1;
switch(escseq.arg[0]) {
@@ -1429,8 +1428,11 @@ csireset(void) {
void
tputtab(void) {
- int space = TAB - term.c.x % TAB;
- tmoveto(term.c.x + space, term.c.y);
+ unsigned x;
+
+ for (x = term.c.x + 1; x < term.col && !term.tabs[x]; ++x)
+ /* nothing */ ;
+ tmoveto(x, term.c.y);
}
void
@@ -1491,6 +1493,10 @@ tputc(char *c) {
tnewline(1); /* always go to first col */
term.esc = 0;
break;
+ case 'H': /* HTS -- Horizontal tab stop */
+ term.tabs[term.c.x] = 1;
+ term.esc = 0;
+ break;
case 'M': /* RI -- Reverse index */
if(term.c.y == term.top)
tscrolldown(term.top, 1);