3 * \brief Header: concurrent shell support
9 /* Used to distinguish between a normal MC termination and */
10 /* one caused by typing `exit' or `logout' in the subshell */
11 #define SUBSHELL_EXIT 128
13 #ifdef HAVE_SUBSHELL_SUPPORT
15 /* If using a subshell for evaluating commands this is true */
16 extern int use_subshell
;
18 /* File descriptor of the pseudoterminal used by the subshell */
19 extern int subshell_pty
;
21 /* State of the subshell; see subshell.c for an explanation */
22 enum subshell_state_enum
{INACTIVE
, ACTIVE
, RUNNING_COMMAND
};
23 extern enum subshell_state_enum subshell_state
;
25 /* Holds the latest prompt captured from the subshell */
26 extern char *subshell_prompt
;
28 /* For the `how' argument to various functions */
29 enum {QUIETLY
, VISIBLY
};
31 /* Exported functions */
32 void init_subshell (void);
33 int invoke_subshell (const char *command
, int how
, char **new_dir
);
34 int read_subshell_prompt (void);
35 void resize_subshell (void);
36 int exit_subshell (void);
37 void do_subshell_chdir (const char *directory
, int update_prompt
, int reset_prompt
);
38 void subshell_get_console_attributes (void);
39 void sigchld_handler (int sig
);
42 #define use_subshell 0
43 #endif /* not HAVE_SUBSHELL_SUPPORT */