sandy

text editor
git clone git://git.suckless.org/sandy
Log | Files | Refs | README | LICENSE

commit 22ab2145bdb3a01e07fe8119ac7b8d7bcd9e8b01
parent 58c5c0bfb19caaa4b6cdb319357cf208830ef0d0
Author: Rafael Garcia <rafael.garcia.gallego@gmail.com>
Date:   Sun, 21 Aug 2011 16:57:44 +0200

Remove setsid and change config for the (upcoming) dmenu console implementation.
Diffstat:
config.def.h | 3++-
sandy.c | 4++--
2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/config.def.h b/config.def.h @@ -30,7 +30,8 @@ static void f_pipenull(const Arg*); #define PROMPT(prompt, default, cmd) { .v = (const char *[]){ "/bin/sh", "-c", \ "dmenu -v >/dev/null 2>&1 || DISPLAY=\"\";"\ "if [ -n \"$DISPLAY\" ]; then arg=\"`echo \\\"" default "\\\" | dmenu -p '" prompt "'`\";" \ - "else printf \"\033[0;0H\033[7m"prompt"\033[K\033[0m \" >&2; read arg; fi &&" \ + "else if slmenu -v >/dev/null 2>&1; then arg=\"`echo \\\"" default "\\\" | slmenu -p '" prompt "'`\";" \ + "else printf \"\033[0;0H\033[7m"prompt"\033[K\033[0m \" >&2; read arg; fi; fi &&" \ "echo " cmd "\"$arg\" > ${SANDY_FIFO}", NULL } } #define FIND PROMPT("Find:", "${SANDY_FIND}", "/") diff --git a/sandy.c b/sandy.c @@ -444,7 +444,7 @@ f_spawn(const Arg *arg) { int pid=-1; reset_shell_mode(); if((pid=fork()) == 0) { - setsid(); + /* setsid() used to be called here, but it does not look as a good idea anymore. TODO: test and delete! */ execvp(((char **)arg->v)[0], (char **)arg->v); fprintf(stderr, "sandy: execvp %s", ((char **)arg->v)[0]); perror(" failed"); @@ -452,7 +452,7 @@ f_spawn(const Arg *arg) { } else if(pid>0) waitpid(pid, NULL, 0); reset_prog_mode(); if(titlewin) redrawwin(titlewin); - redrawwin(textwin); + redrawwin(textwin); /* TODO: make this work! */ } void