+ }
+
+ printf("starting filter program using %s...\n",
+ i_option ? "initscr" : "newterm");
+ filter();
+ if (i_option) {
+ initscr();
+ } else {
+ (void) newterm((char *) 0, stdout, stdin);
+ }
+ cbreak();
+ keypad(stdscr, TRUE);
+
+ if (has_colors()) {
+ int background = COLOR_BLACK;
+ start_color();
+#if HAVE_USE_DEFAULT_COLORS
+ if (use_default_colors() != ERR)
+ background = -1;
+#endif
+ init_pair(1, COLOR_CYAN, background);
+ underline = COLOR_PAIR(1);
+ } else {
+ underline = A_UNDERLINE;
+ }
+
+ while (new_command(buffer, sizeof(buffer) - 1, underline) != ERR
+ && strlen(buffer) != 0) {
+ reset_shell_mode();
+ printf("\n");
+ fflush(stdout);
+ system(buffer);
+ reset_prog_mode();
+ touchwin(stdscr);
+ erase();