Remove confusing and misleading error message when trying to repaint the prompt during startup, reported by Chris Rebert.

darcs-hash:20070801180901-ac50b-43abf47182fcaa19fdbd993d480ac07f2915b6ed.gz
This commit is contained in:
axel 2007-08-02 04:09:01 +10:00
parent cd19320ab2
commit 782a739736
2 changed files with 19 additions and 7 deletions

View file

@ -235,13 +235,23 @@ static int builtin_commandline( wchar_t **argv )
if( !get_buffer() )
{
if (is_interactive_session)
{
/*
Prompt change requested while we don't have
a prompt, most probably while reading the
init files. Just ignore it.
*/
return 1;
}
sb_append2( sb_err,
argv[0],
L": Can not set commandline in non-interactive mode\n",
(void *)0 );
argv[0],
L": Can not set commandline in non-interactive mode\n",
(void *)0 );
builtin_print_help( argv[0], sb_err );
return 1;
}
return 1;
}
woptind=0;

View file

@ -165,8 +165,10 @@ functions -e set_default
#
function __fish_repaint --on-variable fish_color_cwd --description "Event handler, repaints the prompt when fish_color_cwd changes"
set -e __fish_prompt_cwd
commandline -f repaint
if status --is-interactive
set -e __fish_prompt_cwd
commandline -f repaint ^/dev/null
end
end
#