diff options
Diffstat (limited to 'Src/Zle/zle_main.c')
-rw-r--r-- | Src/Zle/zle_main.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c index 0cfb8d9f6..6f66aa104 100644 --- a/Src/Zle/zle_main.c +++ b/Src/Zle/zle_main.c @@ -150,6 +150,8 @@ int kungetct; /**/ mod_export char *zlenoargs[1] = { NULL }; +static char *raw_lp, *raw_rp; + #ifdef FIONREAD static int delayzsetterm; #endif @@ -785,8 +787,10 @@ zleread(char *lp, char *rp, int flags, int context) insmode = unset(OVERSTRIKE); eofsent = 0; resetneeded = 0; + raw_lp = lp; lpromptbuf = promptexpand(lp, 1, NULL, NULL); pmpt_attr = txtchange; + raw_rp = rp; rpromptbuf = promptexpand(rp, 1, NULL, NULL); rpmpt_attr = txtchange; free_prepostdisplay(); @@ -1307,6 +1311,18 @@ recursiveedit(UNUSED(char **args)) } /**/ +int +resetprompt(UNUSED(char **args)) +{ + free(lpromptbuf); + lpromptbuf = promptexpand(raw_lp, 1, NULL, NULL); + free(rpromptbuf); + rpromptbuf = promptexpand(raw_rp, 1, NULL, NULL); + + return redisplay(NULL); +} + +/**/ mod_export void trashzle(void) { |