2001-09-13 Gergely Nagy * src/actions.c (cmd_chdir): new command * src/actions.h: prototype for cmd_chdir added diff -urd ratpoison.orig/src/actions.c ratpoison/src/actions.c --- ratpoison.orig/src/actions.c Thu Sep 13 11:24:20 2001 +++ ratpoison/src/actions.c Thu Sep 13 17:43:18 2001 @@ -66,6 +66,7 @@ {"vsplit", cmd_v_split, arg_VOID}, {"windows", cmd_windows, arg_VOID}, {"symbind", cmd_symbind, arg_STRING}, + {"chdir", cmd_chdir, arg_STRING}, /* Commands to set default behavior. */ {"defbarloc", cmd_defbarloc, arg_STRING}, @@ -924,6 +942,20 @@ return NULL; } +char * +cmd_chdir (int interactive, void *data) +{ + if (!data) + { + char *homedir = getenv("HOME"); + if (homedir) + chdir (homedir); + } + + chdir ((char *)data); + return NULL; +} + /* Quit ratpoison. Thanks to "Chr. v. Stuckrad" for the patch. */ char * diff -urd ratpoison.orig/src/actions.h ratpoison/src/actions.h --- ratpoison.orig/src/actions.h Thu Sep 13 11:24:20 2001 +++ ratpoison/src/actions.h Thu Sep 13 17:13:43 2001 @@ -91,6 +91,7 @@ char * cmd_deffgcolor (int interactive, void *data); char * cmd_defbgcolor (int interactive, void *data); char * cmd_symbind (int interactive, void *data); +char * cmd_chdir (int interactive, void *data); /* void cmd_xterm (void *data); */