]> git.armaanb.net Git - st.git/commitdiff
Add TBC sequence
authorRoberto E. Vargas Caballero <k0ga@shike2.com>
Wed, 29 Aug 2012 17:59:47 +0000 (19:59 +0200)
committerRoberto E. Vargas Caballero <k0ga@shike2.com>
Wed, 29 Aug 2012 17:59:47 +0000 (19:59 +0200)
This sequence clears tab stops in the terminal. If the argument is not present
or is zero, then removes the tab stop of the current horizontal position. If
the argument is 3 then removes all the tab stops of the terminal. It was
necessary modify the terminfo entry tbc, because it has \E[2g instead of the
correct \E[3g.

Signed-off-by: Roberto E. Vargas Caballero <k0ga@shike2.com>
---
 st.c    |   12 ++++++++++++
 st.info |    2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)

st.c
st.info

diff --git a/st.c b/st.c
index 4b7e4ebd1b87e2123029f34737165553b0d72b32..b7dfd559ab211369fa866304735910f225ae8170 100644 (file)
--- a/st.c
+++ b/st.c
@@ -1203,6 +1203,18 @@ csihandle(void) {
                DEFAULT(escseq.arg[0], 1);
                tmoveto(0, term.c.y-escseq.arg[0]);
                break;
+       case 'g': /* TBC -- Tabulation clear */
+               switch (escseq.arg[0]) {
+               case 0: /* clear current tab stop */
+                       term.tabs[term.c.x] = 0;
+                       break;
+               case 3: /* clear all the tabs */
+                       memset(term.tabs, 0, term.col * sizeof(*term.tabs));
+                       break;
+               default:
+                       goto unknown;
+               }
+               break;
        case 'G': /* CHA -- Move to <col> */
        case '`': /* XXX: HPA -- same? */
                DEFAULT(escseq.arg[0], 1);
diff --git a/st.info b/st.info
index ea67039df02e287508448edf6f1055d27141683e..d8e3d0d61b048c2a246b5d8eee5e701d1f24f7c3 100644 (file)
--- a/st.info
+++ b/st.info
@@ -97,7 +97,7 @@ st| simpleterm,
        smcup=\E[?1049h,
        smso=\E[7m,
        smul=\E[4m,
-       tbc=\E[2g,
+       tbc=\E[3g,
        tsl=\E]0;,
        ul,
        xenl,