dvtm

dynamic virtual terminal manager - with my changes
git clone https://pi.duncano.de/git/dvtm.git
Log | Files | Refs | README | LICENSE

commit 5e31596b6c0f102ffd8db71d2e60ed5a138694e0
parent 77fe6b64dd991a337b9d1b5d0de052755cc8f4f3
Author: Greg Reagle <greg.reagle@umbc.edu>
Date:   Tue, 24 Nov 2015 09:28:26 -0500

Fix Mod-C and eliminate redundant shell process

Diffstat:
dvtm.c | 15+++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/dvtm.c b/dvtm.c @@ -989,14 +989,25 @@ static char *getcwd_by_pid(Client *c) { static void create(const char *args[]) { - const char *cmd = (args && args[0]) ? args[0] : shell; - const char *pargs[] = { shell, "-c", cmd, NULL }; + const char *cmd; + const char *pargs[4]; char buf[8], *cwd = NULL; const char *env[] = { "DVTM_WINDOW_ID", buf, NULL }; + if (args && args[0]) { + cmd = args[0]; + pargs[0] = shell; + pargs[1] = "-c"; + pargs[2] = cmd; + pargs[3] = NULL; + } else { + cmd = shell; + pargs[0] = cmd; + pargs[1] = NULL; + } Client *c = calloc(1, sizeof(Client)); if (!c) return;