Skip to content
This repository was archived by the owner on Jul 13, 2026. It is now read-only.

Commit 183693c

Browse files
committed
Version 1.2.0 Released
1 parent a3a290e commit 183693c

13 files changed

Lines changed: 191 additions & 13 deletions

File tree

C/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
CC = gcc
55
CFLAGS = -Wall -Wextra -std=c99 -O2
66
LDFLAGS =
7-
LIBS = -lcurl -ljson-c
7+
LIBS = -lcurl -ljson-c -lpthread
88

99
# Platform detection
1010
ifeq ($(OS),Windows_NT)

C/config.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,11 @@ config_t* load_config(void) {
125125
config->enable_streaming = json_object_get_boolean(enable_streaming);
126126
}
127127

128+
json_object *show_progress_animation;
129+
if (json_object_object_get_ex(json_obj, "show_progress_animation", &show_progress_animation)) {
130+
config->show_progress_animation = json_object_get_boolean(show_progress_animation);
131+
}
132+
128133
if (json_object_object_get_ex(json_obj, "llm_services", &llm_services)) {
129134
// Parse Ollama config
130135
if (json_object_object_get_ex(llm_services, LLM_SERVICE_OLLAMA, &ollama_config)) {
@@ -223,6 +228,8 @@ bool save_config(config_t *config) {
223228
json_object_new_int(config->interactive_history_limit));
224229
json_object_object_add(json_obj, "enable_streaming",
225230
json_object_new_boolean(config->enable_streaming));
231+
json_object_object_add(json_obj, "show_progress_animation",
232+
json_object_new_boolean(config->show_progress_animation));
226233

227234
// Create llm_services object
228235
json_object *llm_services = json_object_new_object();

C/deepshell

4.76 KB
Binary file not shown.

C/deepshell.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include <ctype.h>
1515

1616
// Version
17-
#define DEEPSHELL_VERSION "1.1.0-C"
17+
#define DEEPSHELL_VERSION "1.1.2"
1818

1919
// Configuration constants
2020
#define CONFIG_DIR_NAME ".deepshell"
@@ -106,6 +106,7 @@ bool change_active_model(config_t *config);
106106
bool switch_llm_service(config_t *config);
107107
bool toggle_markdown_rendering(config_t *config);
108108
bool toggle_streaming(config_t *config);
109+
bool toggle_progress_animation(config_t *config);
109110
bool set_history_limit(config_t *config);
110111
bool delete_config_file(void);
111112
void show_active_configuration(config_t *config);
@@ -135,6 +136,10 @@ json_object* create_gemini_payload(const char *model, const char *query,
135136
void display_message(const char *message, const char *color);
136137
void animate_progress(const char *status_text);
137138
void animate_progress_conditional(const char *status_text, bool show_animation);
139+
140+
// Non-blocking progress animation controls
141+
void start_progress_animation(const char *status_text, bool enable_animation);
142+
void stop_progress_animation(void);
138143
void print_colored(const char *text, const char *color);
139144
void print_markdown(const char *text);
140145
char* get_home_directory(void);
@@ -171,6 +176,7 @@ typedef struct {
171176
bool model_change;
172177
bool version;
173178
bool help;
179+
bool no_animation;
174180
char *query_text;
175181
} cli_args_t;
176182

61.6 KB
Binary file not shown.
61.1 KB
Binary file not shown.
65.9 KB
Binary file not shown.
66.4 KB
Binary file not shown.

C/gemini.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ char* send_gemini_query(const char *api_key, const char *model_name,
9595
snprintf(status_message, sizeof(status_message),
9696
"Using active LLM service: Gemini. Sending query to %s...", model_name);
9797

98-
// Show progress animation
99-
animate_progress_conditional(status_message, config->show_progress_animation);
98+
// Start concurrent progress animation
99+
start_progress_animation(status_message, config->show_progress_animation);
100100

101101
// Create JSON payload
102102
json_object *payload = create_gemini_payload(model_name, user_query, history, history_count);
@@ -119,6 +119,7 @@ char* send_gemini_query(const char *api_key, const char *model_name,
119119
json_object_put(payload);
120120

121121
if (!success || !response) {
122+
stop_progress_animation();
122123
display_message("Failed to send query to Gemini API.", COLOR_RED);
123124
return NULL;
124125
}
@@ -128,6 +129,7 @@ char* send_gemini_query(const char *api_key, const char *model_name,
128129
free(response);
129130

130131
if (!response_obj) {
132+
stop_progress_animation();
131133
display_message("Failed to parse response from Gemini API.", COLOR_RED);
132134
return NULL;
133135
}
@@ -136,9 +138,12 @@ char* send_gemini_query(const char *api_key, const char *model_name,
136138
json_object_put(response_obj);
137139

138140
if (!response_text) {
141+
stop_progress_animation();
139142
display_message("Failed to extract response from Gemini API.", COLOR_RED);
140143
return NULL;
141144
}
145+
// Stop animation right before returning the text so caller can print immediately
146+
stop_progress_animation();
142147

143148
// The caller is responsible for printing and freeing response_text
144149
return response_text;

C/main.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,12 @@ int main(int argc, char *argv[]) {
223223

224224
// Handle query
225225
if (args.query) {
226+
// Temporarily disable animation if --no-animation flag is used
227+
bool original_animation_setting = config->show_progress_animation;
228+
if (args.no_animation) {
229+
config->show_progress_animation = false;
230+
}
231+
226232
// Send query to appropriate service
227233
if (strcmp(config->active_llm_service, LLM_SERVICE_OLLAMA) == 0) {
228234
if (strlen(config->ollama.server_address) == 0) {
@@ -274,6 +280,11 @@ int main(int argc, char *argv[]) {
274280
curl_global_cleanup();
275281
return 1;
276282
}
283+
284+
// Restore original animation setting if it was temporarily changed
285+
if (args.no_animation) {
286+
config->show_progress_animation = original_animation_setting;
287+
}
277288
} else {
278289
// No query provided and no other action flags
279290
print_help();
@@ -305,10 +316,12 @@ void print_help(void) {
305316
printf(" -v, --version Show program's version number and exit\n");
306317
printf(" -j, --jump-llm Quickly switch to the previously used LLM service\n");
307318
printf(" -m, --model-change Change the default model for the active LLM service\n");
319+
printf(" --no-animation Disable progress animation for this run\n");
308320
printf(" -h, --help Show this help message and exit\n\n");
309321
printf("Examples:\n");
310322
printf(" deepshell -q \"What is the capital of France?\"\n");
311323
printf(" deepshell -q \"Tell me about adam sandler's movies\"\n");
324+
printf(" deepshell --no-animation -q \"Quick query without animation\"\n");
312325
printf(" deepshell -s\n");
313326
printf(" deepshell -i\n");
314327
printf("\nNote: Use quotes around queries containing spaces or special characters.\n");

0 commit comments

Comments
 (0)