diff --git a/input.c b/input.c index 2f3b3dceb..2e744cd02 100644 --- a/input.c +++ b/input.c @@ -133,7 +133,8 @@ static const wchar_t *name_arr[] = L"vi-arg-digit", L"execute", L"beginning-of-buffer", - L"end-of-buffer" + L"end-of-buffer", + L"repaint" } ; @@ -214,6 +215,7 @@ static const wchar_t code_arr[] = R_EXECUTE, R_BEGINNING_OF_BUFFER, R_END_OF_BUFFER, + R_REPAINT } ; @@ -255,7 +257,6 @@ static int inputrc_error = 0; */ static int is_init = 0; - /** This is the variable telling us how many timew the next command should bne repeated. Only actually used in vi-mode. diff --git a/input.h b/input.h index d3a9d695e..fbb991daf 100644 --- a/input.h +++ b/input.h @@ -48,7 +48,8 @@ enum R_VI_DELETE_TO, R_EXECUTE, R_BEGINNING_OF_BUFFER, - R_END_OF_BUFFER + R_END_OF_BUFFER, + R_REPAINT } ; diff --git a/reader.c b/reader.c index 6753037c9..d8d9c902d 100644 --- a/reader.c +++ b/reader.c @@ -2164,6 +2164,16 @@ wchar_t *reader_readline() case R_NULL: { // exec_prompt(); + write( 1, "\r", 1 ); + s_reset( &data->screen ); + repaint(); + break; + } + + case R_REPAINT: + { + exec_prompt(); + write( 1, "\r", 1 ); s_reset( &data->screen ); repaint(); break; diff --git a/share/config_interactive.fish.in b/share/config_interactive.fish.in index 4d40381cb..1f802c1cc 100644 --- a/share/config_interactive.fish.in +++ b/share/config_interactive.fish.in @@ -166,7 +166,7 @@ functions -e set_default function __fish_repaint --on-variable fish_color_cwd -d (N_ "Event handler, repaints the prompt when fish_color_cwd changes") set -e __fish_prompt_cwd - commandline -f null + commandline -f repaint end #