fixed creation mc-wrapper.csh & mc-wrapper.sh
[midnight-commander.git] / src / subshell.h
blob351eb975ee14a046919df31c0643dc30874d4fe9
1 #ifndef __SUBSHELL_H
2 #define __SUBSHELL_H
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 /* The key to switch back to MC from the subshell */
17 extern char subshell_switch_key;
19 /* State of the subshell; see subshell.c for an explanation */
20 enum subshell_state_enum {INACTIVE, ACTIVE, RUNNING_COMMAND};
21 extern enum subshell_state_enum subshell_state;
23 /* Holds the latest prompt captured from the subshell */
24 extern char *subshell_prompt;
26 /* For the `how' argument to various functions */
27 enum {QUIETLY, VISIBLY};
29 /* Exported functions */
30 void init_subshell (void);
31 int invoke_subshell (const char *command, int how, char **new_dir);
32 int read_subshell_prompt (void);
33 void resize_subshell (void);
34 int exit_subshell (void);
35 void do_subshell_chdir (const char *directory, int update_prompt, int reset_prompt);
36 void subshell_get_console_attributes (void);
37 void sigchld_handler (int sig);
39 #else
40 #define use_subshell 0
41 #endif /* not HAVE_SUBSHELL_SUPPORT */
43 #endif /* __SUBSHELL_H */