commit - 5703aa0390484dd7da4bd9c388c85708d8fcd339
commit + 21e0d6e8b8d20903494386e7e6f43201b3761154
blob - 546edda1a03d26447d62a15bc6c99a12872af427
blob + dfcbda999eb362ff7d64a2bd14e42d7caebe8d2b
--- config.def.h
+++ config.def.h
/*
* What program is execed by st depends of these precedence rules:
* 1: program passed with -e
- * 2: utmp option
+ * 2: scroll and/or utmp
* 3: SHELL environment variable
* 4: value of shell in /etc/passwd
* 5: value of shell in config.h
*/
static char *shell = "/bin/sh";
char *utmp = NULL;
+char *scroll = NULL;
char *stty_args = "stty raw pass8 nl -echo -iexten -cstopb 38400";
/* identification sequence returned in DA and DECID */
blob - e8d6059a9d531d24a6221d0d084c3474e1512687
blob + 39120b4848c1dd055724e0d8345c515d641ec7d4
--- st.1
+++ st.1
.SH SEE ALSO
.BR tabbed (1),
.BR utmp (1),
-.BR stty (1)
+.BR stty (1),
+.BR scroll (1)
.SH BUGS
See the TODO file in the distribution.
blob - 3e4841079a90ce76e83a9cbe361b7a46e71ff9a2
blob + 5f2352af2f10fc7e97d6d127f5d2e8244cb02722
--- st.c
+++ st.c
void
execsh(char *cmd, char **args)
{
- char *sh, *prog;
+ char *sh, *prog, *arg;
const struct passwd *pw;
errno = 0;
if ((sh = getenv("SHELL")) == NULL)
sh = (pw->pw_shell[0]) ? pw->pw_shell : cmd;
- if (args)
+ if (args) {
prog = args[0];
- else if (utmp)
- prog = utmp;
- else
+ arg = NULL;
+ } else if (scroll || utmp) {
+ prog = scroll ? scroll : utmp;
+ arg = scroll ? utmp : NULL;
+ } else {
prog = sh;
- DEFAULT(args, ((char *[]) {prog, NULL}));
+ arg = NULL;
+ }
+ DEFAULT(args, ((char *[]) {prog, arg, NULL}));
unsetenv("COLUMNS");
unsetenv("LINES");
blob - a1928cae4b818f03d220adb015f70a2e424c610f
blob + d978458425934fa1db8c5c03a62c917e244d8933
--- st.h
+++ st.h
/* config.h globals */
extern char *utmp;
+extern char *scroll;
extern char *stty_args;
extern char *vtiden;
extern wchar_t *worddelimiters;