summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--config.def.h3
-rw-r--r--st.13
-rw-r--r--st.c16
-rw-r--r--st.h1
4 files changed, 15 insertions, 8 deletions
diff --git a/config.def.h b/config.def.h
index 546edda..dfcbda9 100644
--- a/config.def.h
+++ b/config.def.h
@@ -11,13 +11,14 @@ static int borderpx = 2;
11/* 11/*
12 * What program is execed by st depends of these precedence rules: 12 * What program is execed by st depends of these precedence rules:
13 * 1: program passed with -e 13 * 1: program passed with -e
14 * 2: utmp option 14 * 2: scroll and/or utmp
15 * 3: SHELL environment variable 15 * 3: SHELL environment variable
16 * 4: value of shell in /etc/passwd 16 * 4: value of shell in /etc/passwd
17 * 5: value of shell in config.h 17 * 5: value of shell in config.h
18 */ 18 */
19static char *shell = "/bin/sh"; 19static char *shell = "/bin/sh";
20char *utmp = NULL; 20char *utmp = NULL;
21char *scroll = NULL;
21char *stty_args = "stty raw pass8 nl -echo -iexten -cstopb 38400"; 22char *stty_args = "stty raw pass8 nl -echo -iexten -cstopb 38400";
22 23
23/* identification sequence returned in DA and DECID */ 24/* identification sequence returned in DA and DECID */
diff --git a/st.1 b/st.1
index e8d6059..39120b4 100644
--- a/st.1
+++ b/st.1
@@ -170,7 +170,8 @@ See the LICENSE file for the terms of redistribution.
170.SH SEE ALSO 170.SH SEE ALSO
171.BR tabbed (1), 171.BR tabbed (1),
172.BR utmp (1), 172.BR utmp (1),
173.BR stty (1) 173.BR stty (1),
174.BR scroll (1)
174.SH BUGS 175.SH BUGS
175See the TODO file in the distribution. 176See the TODO file in the distribution.
176 177
diff --git a/st.c b/st.c
index 3e48410..5f2352a 100644
--- a/st.c
+++ b/st.c
@@ -664,7 +664,7 @@ die(const char *errstr, ...)
664void 664void
665execsh(char *cmd, char **args) 665execsh(char *cmd, char **args)
666{ 666{
667 char *sh, *prog; 667 char *sh, *prog, *arg;
668 const struct passwd *pw; 668 const struct passwd *pw;
669 669
670 errno = 0; 670 errno = 0;
@@ -678,13 +678,17 @@ execsh(char *cmd, char **args)
678 if ((sh = getenv("SHELL")) == NULL) 678 if ((sh = getenv("SHELL")) == NULL)
679 sh = (pw->pw_shell[0]) ? pw->pw_shell : cmd; 679 sh = (pw->pw_shell[0]) ? pw->pw_shell : cmd;
680 680
681 if (args) 681 if (args) {
682 prog = args[0]; 682 prog = args[0];
683 else if (utmp) 683 arg = NULL;
684 prog = utmp; 684 } else if (scroll || utmp) {
685 else 685 prog = scroll ? scroll : utmp;
686 arg = scroll ? utmp : NULL;
687 } else {
686 prog = sh; 688 prog = sh;
687 DEFAULT(args, ((char *[]) {prog, NULL})); 689 arg = NULL;
690 }
691 DEFAULT(args, ((char *[]) {prog, arg, NULL}));
688 692
689 unsetenv("COLUMNS"); 693 unsetenv("COLUMNS");
690 unsetenv("LINES"); 694 unsetenv("LINES");
diff --git a/st.h b/st.h
index a1928ca..d978458 100644
--- a/st.h
+++ b/st.h
@@ -113,6 +113,7 @@ char *xstrdup(char *);
113 113
114/* config.h globals */ 114/* config.h globals */
115extern char *utmp; 115extern char *utmp;
116extern char *scroll;
116extern char *stty_args; 117extern char *stty_args;
117extern char *vtiden; 118extern char *vtiden;
118extern wchar_t *worddelimiters; 119extern wchar_t *worddelimiters;