Ticket #3232: don't owerride fish prompt.

Support for fish subshell didn't show a prompt, because fish_prompt function
was overridden to pass current path to mc.

Now user can specify a fish_prompt_mc function to use a mc specific
prompt, if none is specified fish_prompt is copied to fish_prompt_mc to
use the default prompt. The new implementation of fish_prompt calls
fish_prompt_mc to display a prompt before exit. Cwd is passed to mc as
before.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Chris Owen 2014-07-25 09:18:21 +04:00 committed by Andrew Borodin
parent 4b129bdccf
commit 6d6bc23f25

View File

@ -759,7 +759,7 @@ init_subshell (void)
{
/* This must be remembered across calls to init_subshell() */
static char pty_name[BUF_SMALL];
char precmd[BUF_SMALL];
char precmd[BUF_MEDIUM];
switch (check_sid ())
{
@ -889,8 +889,11 @@ init_subshell (void)
"alias precmd 'echo $cwd:q >>%s;kill -STOP $$'\n", tcsh_fifo);
break;
case FISH:
/* Use fish_prompt_mc function for prompt, if not present then copy fish_prompt to it. */
g_snprintf (precmd, sizeof (precmd),
"function fish_prompt ; pwd>&%d;kill -STOP %%self; end\n",
"if not functions -q fish_prompt_mc;"
"functions -c fish_prompt fish_prompt_mc; end;"
"function fish_prompt; pwd>&%d; fish_prompt_mc; kill -STOP %%self; end\n",
subshell_pipe[WRITE]);
break;