add primitive way of executing commands

This commit is contained in:
Daniel Micay 2012-05-23 22:50:01 -04:00
parent 484fea0cfb
commit 7d13c20f5a
1 changed files with 11 additions and 2 deletions

View File

@ -178,8 +178,17 @@ int main(int argc, char **argv) {
GtkWidget *vte = vte_terminal_new();
char *command_argv[2] = {vte_get_user_shell(), NULL};
if (!command_argv[0]) command_argv[0] = "/bin/sh";
char **command_argv;
char *default_argv[2] = {NULL, NULL};
if (argc > 1) {
command_argv = &argv[1];
} else {
default_argv[0] = vte_get_user_shell();
if (!default_argv[0]) default_argv[0] = "/bin/sh";
command_argv = default_argv;
}
VtePty *pty = vte_terminal_pty_new(VTE_TERMINAL(vte), 0, &error);