MCPcopy Create free account
hub / github.com/appdevforall/CodeOnTheGo / set_display

Function set_display

subprojects/llama.cpp/common/console.cpp:171–196  ·  view source on GitHub ↗

Keep track of current display and only emit ANSI code if it changes

Source from the content-addressed store, hash-verified

169
170 // Keep track of current display and only emit ANSI code if it changes
171 void set_display(display_type display) {
172 if (advanced_display && current_display != display) {
173 common_log_flush(common_log_main());
174 switch(display) {
175 case DISPLAY_TYPE_RESET:
176 fprintf(out, ANSI_COLOR_RESET);
177 break;
178 case DISPLAY_TYPE_INFO:
179 fprintf(out, ANSI_COLOR_MAGENTA);
180 break;
181 case DISPLAY_TYPE_PROMPT:
182 fprintf(out, ANSI_COLOR_YELLOW);
183 break;
184 case DISPLAY_TYPE_REASONING:
185 fprintf(out, ANSI_COLOR_GRAY);
186 break;
187 case DISPLAY_TYPE_USER_INPUT:
188 fprintf(out, ANSI_BOLD ANSI_COLOR_GREEN);
189 break;
190 case DISPLAY_TYPE_ERROR:
191 fprintf(out, ANSI_BOLD ANSI_COLOR_RED);
192 }
193 current_display = display;
194 fflush(out);
195 }
196 }
197
198 static char32_t getchar32() {
199#if defined(_WIN32)

Callers 6

mainFunction · 0.85
mainFunction · 0.85
generate_completionMethod · 0.85
mainFunction · 0.85
cleanupFunction · 0.85
errorFunction · 0.85

Calls 2

common_log_flushFunction · 0.85
common_log_mainFunction · 0.85

Tested by

no test coverage detected