mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
move do_load_prompt() and load_prompt() from src/main.c to src/filemanager/layout.c
Signed-off-by: Slava Zanko <slavazanko@gmail.com>
This commit is contained in:
parent
d6478b8b41
commit
6d4c3828af
@ -1287,3 +1287,44 @@ get_panel_dir_for (const WPanel * widget)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
#ifdef HAVE_SUBSHELL_SUPPORT
|
||||||
|
gboolean
|
||||||
|
do_load_prompt (void)
|
||||||
|
{
|
||||||
|
gboolean ret = FALSE;
|
||||||
|
|
||||||
|
if (!read_subshell_prompt ())
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
/* Don't actually change the prompt if it's invisible */
|
||||||
|
if (top_dlg != NULL && ((Dlg_head *) top_dlg->data == midnight_dlg) && command_prompt)
|
||||||
|
{
|
||||||
|
setup_cmdline ();
|
||||||
|
|
||||||
|
/* since the prompt has changed, and we are called from one of the
|
||||||
|
* tty_get_event channels, the prompt updating does not take place
|
||||||
|
* automatically: force a cursor update and a screen refresh
|
||||||
|
*/
|
||||||
|
update_cursor (midnight_dlg);
|
||||||
|
mc_refresh ();
|
||||||
|
ret = TRUE;
|
||||||
|
}
|
||||||
|
update_subshell_prompt = TRUE;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
int
|
||||||
|
load_prompt (int fd, void *unused)
|
||||||
|
{
|
||||||
|
(void) fd;
|
||||||
|
(void) unused;
|
||||||
|
|
||||||
|
do_load_prompt ();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif /* HAVE_SUBSHELL_SUPPORT */
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------- */
|
||||||
|
@ -81,6 +81,11 @@ void set_hintbar (const char *str);
|
|||||||
void use_dash (gboolean flag); /* Disable/Enable rotate_dash routines */
|
void use_dash (gboolean flag); /* Disable/Enable rotate_dash routines */
|
||||||
void rotate_dash (void);
|
void rotate_dash (void);
|
||||||
|
|
||||||
|
#ifdef HAVE_SUBSHELL_SUPPORT
|
||||||
|
gboolean do_load_prompt (void);
|
||||||
|
int load_prompt (int fd, void *unused);
|
||||||
|
#endif
|
||||||
|
|
||||||
/*** inline functions ****************************************************************************/
|
/*** inline functions ****************************************************************************/
|
||||||
|
|
||||||
#endif /* MC__LAYOUT_H */
|
#endif /* MC__LAYOUT_H */
|
||||||
|
41
src/main.c
41
src/main.c
@ -274,47 +274,6 @@ init_sigchld (void)
|
|||||||
/*** public functions ****************************************************************************/
|
/*** public functions ****************************************************************************/
|
||||||
/* --------------------------------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------------------------------- */
|
||||||
|
|
||||||
#ifdef HAVE_SUBSHELL_SUPPORT
|
|
||||||
gboolean
|
|
||||||
do_load_prompt (void)
|
|
||||||
{
|
|
||||||
gboolean ret = FALSE;
|
|
||||||
|
|
||||||
if (!read_subshell_prompt ())
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
/* Don't actually change the prompt if it's invisible */
|
|
||||||
if (top_dlg != NULL && ((Dlg_head *) top_dlg->data == midnight_dlg) && command_prompt)
|
|
||||||
{
|
|
||||||
setup_cmdline ();
|
|
||||||
|
|
||||||
/* since the prompt has changed, and we are called from one of the
|
|
||||||
* tty_get_event channels, the prompt updating does not take place
|
|
||||||
* automatically: force a cursor update and a screen refresh
|
|
||||||
*/
|
|
||||||
update_cursor (midnight_dlg);
|
|
||||||
mc_refresh ();
|
|
||||||
ret = TRUE;
|
|
||||||
}
|
|
||||||
update_subshell_prompt = TRUE;
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
int
|
|
||||||
load_prompt (int fd, void *unused)
|
|
||||||
{
|
|
||||||
(void) fd;
|
|
||||||
(void) unused;
|
|
||||||
|
|
||||||
do_load_prompt ();
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif /* HAVE_SUBSHELL_SUPPORT */
|
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
void
|
void
|
||||||
title_path_prepare (char **path, char **login)
|
title_path_prepare (char **path, char **login)
|
||||||
{
|
{
|
||||||
|
@ -85,11 +85,6 @@ extern GArray *macros_list;
|
|||||||
|
|
||||||
/*** declarations of public functions ************************************************************/
|
/*** declarations of public functions ************************************************************/
|
||||||
|
|
||||||
#ifdef HAVE_SUBSHELL_SUPPORT
|
|
||||||
gboolean do_load_prompt (void);
|
|
||||||
int load_prompt (int fd, void *unused);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void update_xterm_title_path (void);
|
void update_xterm_title_path (void);
|
||||||
|
|
||||||
void title_path_prepare (char **path, char **login);
|
void title_path_prepare (char **path, char **login);
|
||||||
|
Loading…
Reference in New Issue
Block a user