Skip to content

Commit 616a430

Browse files
committed
Fix Windows agent detection paths to use home_dir consistently
Zed: AppData/Local/Zed, Kilocode/VSCode: AppData/Roaming/Code/... Tests now have #ifdef _WIN32 branches matching the detection paths.
1 parent 74c5697 commit 616a430

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

src/cli/cli.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -990,12 +990,7 @@ cbm_detected_agents_t cbm_detect_agents(const char *home_dir) {
990990
#ifdef __APPLE__
991991
snprintf(path, sizeof(path), "%s/Library/Application Support/Zed", home_dir);
992992
#elif defined(_WIN32)
993-
{
994-
const char *zed_local = cbm_app_local_dir();
995-
if (zed_local) {
996-
snprintf(path, sizeof(path), "%s/Zed", zed_local);
997-
}
998-
}
993+
snprintf(path, sizeof(path), "%s/AppData/Local/Zed", home_dir);
999994
#else
1000995
snprintf(path, sizeof(path), "%s/.config/zed", home_dir);
1001996
#endif
@@ -1014,13 +1009,18 @@ cbm_detected_agents_t cbm_detect_agents(const char *home_dir) {
10141009
#ifdef __APPLE__
10151010
snprintf(path, sizeof(path),
10161011
"%s/Library/Application Support/Code/User/globalStorage/kilocode.kilo-code", home_dir);
1012+
#elif defined(_WIN32)
1013+
snprintf(path, sizeof(path), "%s/AppData/Roaming/Code/User/globalStorage/kilocode.kilo-code",
1014+
home_dir);
10171015
#else
10181016
snprintf(path, sizeof(path), "%s/.config/Code/User/globalStorage/kilocode.kilo-code", home_dir);
10191017
#endif
10201018
agents.kilocode = dir_exists(path);
10211019

10221020
#ifdef __APPLE__
10231021
snprintf(path, sizeof(path), "%s/Library/Application Support/Code/User", home_dir);
1022+
#elif defined(_WIN32)
1023+
snprintf(path, sizeof(path), "%s/AppData/Roaming/Code/User", home_dir);
10241024
#else
10251025
snprintf(path, sizeof(path), "%s/.config/Code/User", home_dir);
10261026
#endif

tests/test_cli.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1438,6 +1438,8 @@ TEST(cli_detect_agents_finds_zed) {
14381438
char dir[512];
14391439
#ifdef __APPLE__
14401440
snprintf(dir, sizeof(dir), "%s/Library/Application Support/Zed", tmpdir);
1441+
#elif defined(_WIN32)
1442+
snprintf(dir, sizeof(dir), "%s/AppData/Local/Zed", tmpdir);
14411443
#else
14421444
snprintf(dir, sizeof(dir), "%s/.config/zed", tmpdir);
14431445
#endif
@@ -1478,6 +1480,9 @@ TEST(cli_detect_agents_finds_kilocode) {
14781480
#ifdef __APPLE__
14791481
snprintf(dir, sizeof(dir),
14801482
"%s/Library/Application Support/Code/User/globalStorage/kilocode.kilo-code", tmpdir);
1483+
#elif defined(_WIN32)
1484+
snprintf(dir, sizeof(dir),
1485+
"%s/AppData/Roaming/Code/User/globalStorage/kilocode.kilo-code", tmpdir);
14811486
#else
14821487
snprintf(dir, sizeof(dir), "%s/.config/Code/User/globalStorage/kilocode.kilo-code", tmpdir);
14831488
#endif

0 commit comments

Comments
 (0)