all repos — st @ 580c8bbd4691218849c9a809acaa4c95f65cb846

st (suckless terminal) config

Add an option to disable alternative screens.
Christoph Lohmann 20h@r-36.net
commit

580c8bbd4691218849c9a809acaa4c95f65cb846

parent

502911e55442a89602bd5681763f68250bff330b

3 files changed, 16 insertions(+), 4 deletions(-)

jump to
M config.def.hconfig.def.h

@@ -13,6 +13,9 @@ /* timeouts (in milliseconds) */

static unsigned int doubleclicktimeout = 300; static unsigned int tripleclicktimeout = 600; +/* alt screens */ +static bool allowaltscreen = true; + /* frames per second st should at maximum draw to the screen */ static unsigned int xfps = 60; static unsigned int actionfps = 30;
M st.1st.1

@@ -3,6 +3,7 @@ .SH NAME

st \- simple terminal .SH SYNOPSIS .B st +.RB [ \-a ] .RB [ \-c .IR class ] .RB [ \-f

@@ -22,6 +23,9 @@ .SH DESCRIPTION

.B st is a simple terminal emulator. .SH OPTIONS +.TP +.B \-a +disable alternate screens in terminal .TP .BI \-c " class" defines the window class (default $TERM).
M st.cst.c

@@ -43,7 +43,7 @@ #endif

#define USAGE \ "st " VERSION " (c) 2010-2013 st engineers\n" \ - "usage: st [-v] [-c class] [-f font] [-g geometry] [-o file]" \ + "usage: st [-a] [-v] [-c class] [-f font] [-g geometry] [-o file]" \ " [-t title] [-w windowid] [-e command ...]\n" /* XEMBED messages */

@@ -1615,7 +1615,10 @@ MODBIT(term.mode, set, MODE_MOUSESGR);

break; case 1049: /* = 1047 and 1048 */ case 47: - case 1047: { + case 1047: + if (!allowaltscreen) + break; + alt = IS_SET(MODE_ALTSCREEN); if(alt) { tclearregion(0, 0, term.col-1,

@@ -1625,8 +1628,7 @@ if(set ^ alt) /* set is always 1 or 0 */

tswapscreen(); if(*args != 1049) break; - } - /* pass through */ + /* FALLTRU */ case 1048: tcursor((set) ? CURSOR_SAVE : CURSOR_LOAD); break;

@@ -3316,6 +3318,9 @@ xw.isfixed = False;

for(i = 1; i < argc; i++) { switch(argv[i][0] != '-' || argv[i][2] ? -1 : argv[i][1]) { + case 'a': + allowaltscreen = false; + break; case 'c': if(++i < argc) opt_class = argv[i];