mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-21 03:21:16 -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:
@@ -23,3 +23,10 @@ sendline(
|
||||
expect_prompt()
|
||||
sendline("echo one \"two three\" four'five six'{7} 'eight~")
|
||||
expect_prompt("\r\n@GUARD:2@\r\n(.*)\r\n@/GUARD:2@\r\n")
|
||||
|
||||
# Check that we don't infinitely loop here.
|
||||
sendline("function fish_mode_prompt; commandline -f repaint; end")
|
||||
expect_prompt()
|
||||
|
||||
sendline("echo foo")
|
||||
expect_prompt("foo")
|
||||
|
||||
Reference in New Issue
Block a user