fix: delay shell command indicator to avoid flashes

This commit is contained in:
2026-10-18 01:19:07 +02:00
parent a5f92452b3
commit 00207b5526
3 changed files with 10 additions and 5 deletions
+5 -2
View File
@@ -1782,9 +1782,12 @@ impl EditorSession {
self.editor.show_command_output(command, result);
return true;
}
let elapsed = now.saturating_duration_since(*started);
if elapsed < Duration::from_millis(200) {
return false;
}
const FRAMES: [char; 4] = ['|', '/', '-', '\\'];
let frame =
FRAMES[((now.saturating_duration_since(*started).as_millis() / 100) % 4) as usize];
let frame = FRAMES[((elapsed.as_millis() / 100) % 4) as usize];
if self.editor.shell_label().ends_with(frame) {
return false;
}