diff options
Diffstat (limited to 'src/shell.c')
-rw-r--r-- | src/shell.c | 37 |
1 files changed, 26 insertions, 11 deletions
diff --git a/src/shell.c b/src/shell.c index 1f8d28d..2d3420f 100644 --- a/src/shell.c +++ b/src/shell.c @@ -105,7 +105,11 @@ GtkWidget *build_shell_panel(GObject *ref) vte_terminal_set_cursor_blinks(VTE_TERMINAL(term), TRUE); - //return result; +#if 0 + vte_terminal_fork_command (term, "/bin/sh", NULL, NULL, "/", 0, 0, 0); + return result; +#endif + openpty(&amaster, &aslave, name, NULL, NULL); @@ -264,6 +268,10 @@ static gpointer python_shell_thread(gpointer data) { FILE *stream; + int stdout2; + FILE *out2; + + printf("==== FE :: '%s'\n", ptsname(amaster)); printf("==== FE :: '%s'\n", ptsname(aslave)); @@ -279,38 +287,45 @@ static gpointer python_shell_thread(gpointer data) /* Mise à jour des entrées/sorties */ - /* + + stdout2 = dup(STDOUT_FILENO); + out2 = fdopen(stdout2, "w"); + + fprintf(out2, ">>> stdout2 :: %d\n", stdout2); + + +#if 1 close(STDIN_FILENO); close(STDOUT_FILENO); close(STDERR_FILENO); dup(aslave); dup(aslave); dup(aslave); - */ - +#endif Py_Initialize(); - amaster = STDIN_FILENO; - + //amaster = STDIN_FILENO; + /* write(amaster, "import pyoida\n", strlen("import pyoida\n")); write(amaster, "from pyoida import *\n", strlen("from pyoida import *\n")); + write(amaster, "logger.log_simple_message(2, 'uhih')\n", strlen("logger.log_simple_message(2, 'uhih')\n")); + write(amaster, "for i in pyoida.current_binary().lines():\n", strlen("for i in pyoida.current_binary().lines():\n")); + write(amaster, "\tprint i\n", strlen("\tprint i\n")); + */ - - write(amaster, "logger.log_simple_message(2, 'uhih')\n", strlen("logger.log_simple_message(2, 'uhih')\n")); - + write(amaster, "execfile('test.py')", strlen("execfile('test.py')")); - write(amaster, "for i in pyoida.current_binary().lines():\n", strlen("for i in pyoida.current_binary().lines():\n")); - write(amaster, "\tprint i\n", strlen("\tprint i\n")); + fprintf(out2, ">>> stdout2 :: %d (inside)\n", stdout2); |