@@ -975,8 +975,20 @@ cbm_detected_agents_t cbm_detect_agents(const char *home_dir) {
975975
976976#ifdef __APPLE__
977977 snprintf (path , sizeof (path ), "%s/Library/Application Support/Zed" , home_dir );
978+ #elif defined(_WIN32 )
979+ {
980+ const char * zed_local = cbm_app_local_dir ();
981+ if (zed_local ) {
982+ snprintf (path , sizeof (path ), "%s/Zed" , zed_local );
983+ }
984+ }
978985#else
979- snprintf (path , sizeof (path ), "%s/.config/zed" , home_dir );
986+ {
987+ const char * zed_cfg = cbm_app_config_dir ();
988+ if (zed_cfg ) {
989+ snprintf (path , sizeof (path ), "%s/zed" , zed_cfg );
990+ }
991+ }
980992#endif
981993 agents .zed = dir_exists (path );
982994
@@ -996,7 +1008,12 @@ cbm_detected_agents_t cbm_detect_agents(const char *home_dir) {
9961008#ifdef __APPLE__
9971009 snprintf (path , sizeof (path ), "%s/Library/Application Support/Code/User" , home_dir );
9981010#else
999- snprintf (path , sizeof (path ), "%s/.config/Code/User" , home_dir );
1011+ {
1012+ const char * vs_cfg = cbm_app_config_dir ();
1013+ if (vs_cfg ) {
1014+ snprintf (path , sizeof (path ), "%s/Code/User" , vs_cfg );
1015+ }
1016+ }
10001017#endif
10011018 agents .vscode = dir_exists (path );
10021019
@@ -2711,8 +2728,10 @@ static void install_editor_agent_configs(const cbm_detected_agents_t *agents, co
27112728 char cp [CLI_BUF_1K ];
27122729#ifdef __APPLE__
27132730 snprintf (cp , sizeof (cp ), "%s/Library/Application Support/Zed/settings.json" , home );
2731+ #elif defined(_WIN32 )
2732+ snprintf (cp , sizeof (cp ), "%s/Zed/settings.json" , cbm_app_local_dir ());
27142733#else
2715- snprintf (cp , sizeof (cp ), "%s/.config/ zed/settings.json" , home );
2734+ snprintf (cp , sizeof (cp ), "%s/zed/settings.json" , cbm_app_config_dir () );
27162735#endif
27172736 install_generic_agent_config ("Zed" , binary_path , cp , NULL , dry_run , cbm_install_zed_mcp );
27182737 }
@@ -2731,7 +2750,7 @@ static void install_editor_agent_configs(const cbm_detected_agents_t *agents, co
27312750#ifdef __APPLE__
27322751 snprintf (cp , sizeof (cp ), "%s/Library/Application Support/Code/User/mcp.json" , home );
27332752#else
2734- snprintf (cp , sizeof (cp ), "%s/.config/ Code/User/mcp.json" , home );
2753+ snprintf (cp , sizeof (cp ), "%s/Code/User/mcp.json" , cbm_app_config_dir () );
27352754#endif
27362755 install_generic_agent_config ("VS Code" , binary_path , cp , NULL , dry_run ,
27372756 cbm_install_vscode_mcp );
@@ -2983,8 +3002,10 @@ static void uninstall_editor_agents(const cbm_detected_agents_t *agents, const c
29833002 char cp [CLI_BUF_1K ];
29843003#ifdef __APPLE__
29853004 snprintf (cp , sizeof (cp ), "%s/Library/Application Support/Zed/settings.json" , home );
3005+ #elif defined(_WIN32 )
3006+ snprintf (cp , sizeof (cp ), "%s/Zed/settings.json" , cbm_app_local_dir ());
29863007#else
2987- snprintf (cp , sizeof (cp ), "%s/.config/ zed/settings.json" , home );
3008+ snprintf (cp , sizeof (cp ), "%s/zed/settings.json" , cbm_app_config_dir () );
29883009#endif
29893010 uninstall_agent_mcp_instr ((mcp_uninstall_args_t ){"Zed" , cp , NULL }, dry_run ,
29903011 cbm_remove_zed_mcp );
@@ -3004,7 +3025,7 @@ static void uninstall_editor_agents(const cbm_detected_agents_t *agents, const c
30043025#ifdef __APPLE__
30053026 snprintf (cp , sizeof (cp ), "%s/Library/Application Support/Code/User/mcp.json" , home );
30063027#else
3007- snprintf (cp , sizeof (cp ), "%s/.config/ Code/User/mcp.json" , home );
3028+ snprintf (cp , sizeof (cp ), "%s/Code/User/mcp.json" , cbm_app_config_dir () );
30083029#endif
30093030 uninstall_agent_mcp_instr ((mcp_uninstall_args_t ){"VS Code" , cp , NULL }, dry_run ,
30103031 cbm_remove_vscode_mcp );
0 commit comments