]> git.mdlowis.com Git - projs/tide.git/commitdiff
fixed a bug in fetch and simplified shell-picking logic in term
authorMichael D. Lowis <mike.lowis@gentex.com>
Fri, 21 Dec 2018 15:55:03 +0000 (10:55 -0500)
committerMichael D. Lowis <mike.lowis@gentex.com>
Fri, 21 Dec 2018 15:55:03 +0000 (10:55 -0500)
config.h
src/term.c

index 58bff13a7e46899277c245a42422de9f7d5902b0..ac52cbfc61a81ab85cceb6cc553d4236e2f74a3c 100644 (file)
--- a/config.h
+++ b/config.h
@@ -112,8 +112,8 @@ static Rule* BuiltinRules[] = {
     },
     (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/ */
index 2b415d1a8ca06ba7a8a0f6f128c1b940fc03d86b..6b27d9c513160bf1af77d410d2dcbe8cb2c903b7 100644 (file)
@@ -48,7 +48,6 @@
  #include <libutil.h>
 #endif
 
-
 /* XEMBED messages */
 #define XEMBED_FOCUS_IN  4
 #define XEMBED_FOCUS_OUT 5
@@ -331,16 +330,8 @@ static char font[] = "Liberation Mono:pixelsize=14:antialias=true:autohint=true"
 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";
@@ -378,12 +369,6 @@ static unsigned int blinktimeout = 800;
  */
 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";
 
@@ -1730,36 +1715,13 @@ die(const char *errstr, ...)
 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);
 
@@ -1770,7 +1732,7 @@ execsh(void)
     signal(SIGTERM, SIG_DFL);
     signal(SIGALRM, SIG_DFL);
 
-    execvp(prog, args);
+    execvp(shell[0], shell);
     _exit(1);
 }
 
@@ -3092,8 +3054,6 @@ tcontrolcode(uchar ascii)
         } else {
             if (!(xw.state & WIN_FOCUSED))
                 xseturgency(1);
-            if (bellvolume)
-                XkbBell(xw.dpy, xw.win, bellvolume, (Atom)NULL);
         }
         break;
     case '\033': /* ESC */