@@ -143,10 +143,14 @@ while (!line_complete) { Tcl_DoOneEvent (0); } Tcl_DeleteFileHandler (0); + + if (line_complete < 0) { + Tcl_Eval(interp, "exit"); + } status = history_expand (line, &expansion); if (status == 1) printf ("%s\n", expansion); else if (status == -1) @@ -212,11 +216,14 @@ rl_callback_read_char (); } void TclReadlineLineCompleteHandler (char *ptr) { - if (ptr && *ptr) { + if (!ptr) { + line_complete = -1; + rl_callback_handler_remove (); + } else if (*ptr) { line_complete = 1; rl_callback_handler_remove (); line = ptr; } }