4 /* Used to distinguish between a normal MC termination and */
5 /* one caused by typing `exit' or `logout' in the subshell */
6 #define SUBSHELL_EXIT 128
8 #ifdef HAVE_SUBSHELL_SUPPORT
10 /* If using a subshell for evaluating commands this is true */
11 extern int use_subshell
;
13 /* File descriptor of the pseudoterminal used by the subshell */
14 extern int subshell_pty
;
16 /* If true, the child forked in init_subshell will wait in a loop to be attached by gdb */
17 extern int debug_subshell
;
19 /* The key to switch back to MC from the subshell */
20 extern char subshell_switch_key
;
22 /* State of the subshell; see subshell.c for an explanation */
23 enum subshell_state_enum
{INACTIVE
, ACTIVE
, RUNNING_COMMAND
};
24 extern enum subshell_state_enum subshell_state
;
26 /* Holds the latest prompt captured from the subshell */
27 extern char *subshell_prompt
;
29 /* For the `how' argument to various functions */
30 enum {QUIETLY
, VISIBLY
};
32 /* Exported functions */
33 void init_subshell (void);
34 int invoke_subshell (const char *command
, int how
, char **new_dir
);
35 int read_subshell_prompt (int how
);
36 void resize_subshell (void);
37 int exit_subshell (void);
38 void do_subshell_chdir (const char *directory
, int update_prompt
, int reset_prompt
);
39 void subshell_get_console_attributes (void);
40 void sigchld_handler (int sig
);
43 #define use_subshell 0
44 #endif /* not HAVE_SUBSHELL_SUPPORT */
46 #endif /* __SUBSHELL_H */