aboutsummaryrefslogtreecommitdiff
path: root/st.c
diff options
context:
space:
mode:
authorRoberto E. Vargas Caballero <k0ga@shike2.com>2012-08-29 19:59:47 +0200
committerRoberto E. Vargas Caballero <k0ga@shike2.com>2012-08-29 19:59:47 +0200
commit67d809776f23bbbd777d974a9346370e8e9b7c0b (patch)
treeba821f615c95a380ff5376f60dbbc12093caba6a /st.c
parent94ce8a71846514694106ea304e59811bcf85b156 (diff)
downloadst-67d809776f23bbbd777d974a9346370e8e9b7c0b.tar.gz
st-67d809776f23bbbd777d974a9346370e8e9b7c0b.tar.bz2
Add TBC sequence
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(-)
Diffstat (limited to 'st.c')
-rw-r--r--st.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/st.c b/st.c
index 4b7e4eb..b7dfd55 100644
--- 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);