File tree Expand file tree Collapse file tree 2 files changed +14
-10
lines changed Expand file tree Collapse file tree 2 files changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ use crate::history_cell::HistoryCell;
8
8
use crate :: render:: highlight:: highlight_bash_to_lines;
9
9
use crate :: render:: line_utils:: prefix_lines;
10
10
use crate :: render:: line_utils:: push_owned_lines;
11
+ use crate :: shimmer:: shimmer_spans;
11
12
use crate :: wrapping:: RtOptions ;
12
13
use crate :: wrapping:: word_wrap_line;
13
14
use codex_ansi_escape:: ansi_escape_line;
@@ -116,10 +117,16 @@ pub(crate) fn output_lines(
116
117
}
117
118
118
119
pub ( crate ) fn spinner ( start_time : Option < Instant > ) -> Span < ' static > {
119
- let blink_on = start_time
120
- . map ( |st| ( ( st. elapsed ( ) . as_millis ( ) / 600 ) % 2 ) == 0 )
121
- . unwrap_or ( false ) ;
122
- if blink_on { "•" . into ( ) } else { "◦" . dim ( ) }
120
+ let elapsed = start_time. map ( |st| st. elapsed ( ) ) . unwrap_or_default ( ) ;
121
+ if supports_color:: on_cached ( supports_color:: Stream :: Stdout )
122
+ . map ( |level| level. has_16m )
123
+ . unwrap_or ( false )
124
+ {
125
+ shimmer_spans ( "•" ) [ 0 ] . clone ( )
126
+ } else {
127
+ let blink_on = ( elapsed. as_millis ( ) / 600 ) . is_multiple_of ( 2 ) ;
128
+ if blink_on { "•" . into ( ) } else { "◦" . dim ( ) }
129
+ }
123
130
}
124
131
125
132
impl HistoryCell for ExecCell {
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ use ratatui::widgets::WidgetRef;
15
15
16
16
use crate :: app_event:: AppEvent ;
17
17
use crate :: app_event_sender:: AppEventSender ;
18
+ use crate :: exec_cell:: spinner;
18
19
use crate :: key_hint;
19
20
use crate :: shimmer:: shimmer_spans;
20
21
use crate :: tui:: FrameRequester ;
@@ -163,15 +164,11 @@ impl WidgetRef for StatusIndicatorWidget {
163
164
let now = Instant :: now ( ) ;
164
165
let elapsed_duration = self . elapsed_duration_at ( now) ;
165
166
let pretty_elapsed = fmt_elapsed_compact ( elapsed_duration. as_secs ( ) ) ;
166
- let blink_on = ( elapsed_duration. as_millis ( ) / 600 ) . is_multiple_of ( 2 ) ;
167
167
168
168
// Plain rendering: no borders or padding so the live cell is visually indistinguishable from terminal scrollback.
169
169
let mut spans = Vec :: with_capacity ( 5 ) ;
170
- if blink_on {
171
- spans. push ( "• " . into ( ) ) ;
172
- } else {
173
- spans. push ( "◦ " . dim ( ) ) ;
174
- }
170
+ spans. push ( spinner ( Some ( self . last_resume_at ) ) ) ;
171
+ spans. push ( " " . into ( ) ) ;
175
172
spans. extend ( shimmer_spans ( & self . header ) ) ;
176
173
spans. extend ( vec ! [
177
174
" " . into( ) ,
You can’t perform that action at this time.
0 commit comments