aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.def.h3
-rw-r--r--st.14
-rw-r--r--st.c13
3 files changed, 16 insertions, 4 deletions
diff --git a/config.def.h b/config.def.h
index 693bdbd..2c97266 100644
--- a/config.def.h
+++ b/config.def.h
@@ -13,6 +13,9 @@ static char shell[] = "/bin/sh";
13static unsigned int doubleclicktimeout = 300; 13static unsigned int doubleclicktimeout = 300;
14static unsigned int tripleclicktimeout = 600; 14static unsigned int tripleclicktimeout = 600;
15 15
16/* alt screens */
17static bool allowaltscreen = true;
18
16/* frames per second st should at maximum draw to the screen */ 19/* frames per second st should at maximum draw to the screen */
17static unsigned int xfps = 60; 20static unsigned int xfps = 60;
18static unsigned int actionfps = 30; 21static unsigned int actionfps = 30;
diff --git a/st.1 b/st.1
index 1c100c0..fc7703d 100644
--- a/st.1
+++ b/st.1
@@ -3,6 +3,7 @@
3st \- simple terminal 3st \- simple terminal
4.SH SYNOPSIS 4.SH SYNOPSIS
5.B st 5.B st
6.RB [ \-a ]
6.RB [ \-c 7.RB [ \-c
7.IR class ] 8.IR class ]
8.RB [ \-f 9.RB [ \-f
@@ -23,6 +24,9 @@ st \- simple terminal
23is a simple terminal emulator. 24is a simple terminal emulator.
24.SH OPTIONS 25.SH OPTIONS
25.TP 26.TP
27.B \-a
28disable alternate screens in terminal
29.TP
26.BI \-c " class" 30.BI \-c " class"
27defines the window class (default $TERM). 31defines the window class (default $TERM).
28.TP 32.TP
diff --git a/st.c b/st.c
index 8b1fc56..18935d4 100644
--- a/st.c
+++ b/st.c
@@ -43,7 +43,7 @@
43 43
44#define USAGE \ 44#define USAGE \
45 "st " VERSION " (c) 2010-2013 st engineers\n" \ 45 "st " VERSION " (c) 2010-2013 st engineers\n" \
46 "usage: st [-v] [-c class] [-f font] [-g geometry] [-o file]" \ 46 "usage: st [-a] [-v] [-c class] [-f font] [-g geometry] [-o file]" \
47 " [-t title] [-w windowid] [-e command ...]\n" 47 " [-t title] [-w windowid] [-e command ...]\n"
48 48
49/* XEMBED messages */ 49/* XEMBED messages */
@@ -1615,7 +1615,10 @@ tsetmode(bool priv, bool set, int *args, int narg) {
1615 break; 1615 break;
1616 case 1049: /* = 1047 and 1048 */ 1616 case 1049: /* = 1047 and 1048 */
1617 case 47: 1617 case 47:
1618 case 1047: { 1618 case 1047:
1619 if (!allowaltscreen)
1620 break;
1621
1619 alt = IS_SET(MODE_ALTSCREEN); 1622 alt = IS_SET(MODE_ALTSCREEN);
1620 if(alt) { 1623 if(alt) {
1621 tclearregion(0, 0, term.col-1, 1624 tclearregion(0, 0, term.col-1,
@@ -1625,8 +1628,7 @@ tsetmode(bool priv, bool set, int *args, int narg) {
1625 tswapscreen(); 1628 tswapscreen();
1626 if(*args != 1049) 1629 if(*args != 1049)
1627 break; 1630 break;
1628 } 1631 /* FALLTRU */
1629 /* pass through */
1630 case 1048: 1632 case 1048:
1631 tcursor((set) ? CURSOR_SAVE : CURSOR_LOAD); 1633 tcursor((set) ? CURSOR_SAVE : CURSOR_LOAD);
1632 break; 1634 break;
@@ -3316,6 +3318,9 @@ main(int argc, char *argv[]) {
3316 3318
3317 for(i = 1; i < argc; i++) { 3319 for(i = 1; i < argc; i++) {
3318 switch(argv[i][0] != '-' || argv[i][2] ? -1 : argv[i][1]) { 3320 switch(argv[i][0] != '-' || argv[i][2] ? -1 : argv[i][1]) {
3321 case 'a':
3322 allowaltscreen = false;
3323 break;
3319 case 'c': 3324 case 'c':
3320 if(++i < argc) 3325 if(++i < argc)
3321 opt_class = argv[i]; 3326 opt_class = argv[i];