mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-10 21:11:15 -03:00
Don't enqueue a repaint in the middle of one
This can easily lead to an infinite loop, if a variable handler
triggers a repaint and the variable is set in the prompt, e.g. some of
the git variables.
A simple way to reproduce:
function fish_mode_prompt
commandline -f repaint
end
Repainting executes the mode prompt, which triggers a repaint, which
triggers the mode prompt, ....
So we just set a flag and check it.
Fixes #7324.
This commit is contained in:
@@ -151,6 +151,10 @@ struct library_data_t {
|
||||
/// Number of recursive calls to builtin_complete().
|
||||
uint32_t builtin_complete_recursion_level{0};
|
||||
|
||||
/// If we're currently repainting the commandline.
|
||||
/// Useful to stop infinite loops.
|
||||
bool is_repaint{false};
|
||||
|
||||
/// Whether we called builtin_complete -C without parameter.
|
||||
bool builtin_complete_current_commandline{false};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user