},
(Rule[]){ /* Look it up in ctags database */
{ ISFILE, "tags", NULL },
- { EXEC, "grep -q '^$data\\s\\+' tags", NULL },
- { LAUNCH, "picktag fetch tags '$data' | xargs -r edit", NULL },
+ { EXEC, "grep -q \"^$data\\s\\+\" tags", NULL },
+ { LAUNCH, "picktag fetch tags \"$data\" | xargs -r edit", NULL },
{ COMPLETE, NULL, NULL }
},
(Rule[]){ /* Look up .c or .h files in Code/ */
#include <libutil.h>
#endif
-
/* XEMBED messages */
#define XEMBED_FOCUS_IN 4
#define XEMBED_FOCUS_OUT 5
static int borderpx = 2;
#define histsize 5000
-/*
- * What program is execed by st depends of these precedence rules:
- * 1: program passed with -e
- * 2: utmp option
- * 3: SHELL environment variable
- * 4: value of shell in /etc/passwd
- * 5: value of shell in config.h
- */
-static char shell[] = "/bin/sh";
-static char *utmp = NULL;
+/* shell */
+static char* shell[] = { "/bin/bash", "-l", 0 };
/* identification sequence returned in DA and DECID */
static char vtiden[] = "\033[?6c";
*/
static unsigned int cursorthickness = 2;
-/*
- * bell volume. It must be a value between -100 and 100. Use 0 for disabling
- * it
- */
-static int bellvolume = 0;
-
/* default TERM value */
static char termname[] = "st-256color";
void
execsh(void)
{
- char **args, *sh, *prog;
- const struct passwd *pw;
char buf[sizeof(long) * 8 + 1];
-
- errno = 0;
- if ((pw = getpwuid(getuid())) == NULL) {
- if (errno)
- die("getpwuid:%s\n", strerror(errno));
- else
- die("who are you?\n");
- }
-
- if ((sh = getenv("SHELL")) == NULL)
- sh = (pw->pw_shell[0]) ? pw->pw_shell : shell;
-
- if (utmp)
- prog = utmp;
- else
- prog = sh;
- args = (char *[]) {prog, NULL};
-
snprintf(buf, sizeof(buf), "%lu", xw.win);
unsetenv("COLUMNS");
unsetenv("LINES");
unsetenv("TERMCAP");
- setenv("LOGNAME", pw->pw_name, 1);
- setenv("USER", pw->pw_name, 1);
- setenv("SHELL", sh, 1);
- setenv("HOME", pw->pw_dir, 1);
+ setenv("SHELL", shell[0], 1);
setenv("TERM", termname, 1);
setenv("WINDOWID", buf, 1);
signal(SIGTERM, SIG_DFL);
signal(SIGALRM, SIG_DFL);
- execvp(prog, args);
+ execvp(shell[0], shell);
_exit(1);
}
} else {
if (!(xw.state & WIN_FOCUSED))
xseturgency(1);
- if (bellvolume)
- XkbBell(xw.dpy, xw.win, bellvolume, (Atom)NULL);
}
break;
case '\033': /* ESC */