From 3399faeac273e49c1d6280cbcb797f48ba6c39a0 Mon Sep 17 00:00:00 2001 From: peterven Date: Sat, 3 Jan 2026 10:19:19 +0100 Subject: [PATCH] Add Windows platform support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix main() to return Future instead of void for proper async handling - Add await when calling app.main() from bin/vide.dart - Fix Windows path encoding: remove colons from project paths (D: -> D) as colons are invalid in Windows directory names Tested on Windows 11 with Windows Terminal. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- bin/vide.dart | 2 +- lib/main.dart | 2 +- packages/vide_core/lib/services/vide_config_manager.dart | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/vide.dart b/bin/vide.dart index 4c3cbd65..7a79d2f7 100644 --- a/bin/vide.dart +++ b/bin/vide.dart @@ -22,5 +22,5 @@ void main(List args) async { workingDirProvider.overrideWithValue(Directory.current.path), ]; - app.main(args, overrides: overrides); + await app.main(args, overrides: overrides); } diff --git a/lib/main.dart b/lib/main.dart index ab602408..1d946910 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -28,7 +28,7 @@ final _canUseToolCallbackFactoryOverride = canUseToolCallbackFactoryProvider.ove }; }); -void main(List args, {List overrides = const []}) async { +Future main(List args, {List overrides = const []}) async { // Initialize Sentry and set up nocterm error handler await SentryService.init(); diff --git a/packages/vide_core/lib/services/vide_config_manager.dart b/packages/vide_core/lib/services/vide_config_manager.dart index 4017488c..3126b3a4 100644 --- a/packages/vide_core/lib/services/vide_config_manager.dart +++ b/packages/vide_core/lib/services/vide_config_manager.dart @@ -69,15 +69,17 @@ class VideConfigManager { /// /// Replaces forward slashes (/) with hyphens (-) /// Example: /Users/bob/project -> -Users-bob-project + /// On Windows: D:\project -> D-project (colon removed as it's invalid in filenames) String _encodeProjectPath(String absolutePath) { // Normalize the path first to handle trailing slashes, etc. final normalized = path.normalize(absolutePath); // Replace path separators with hyphens - // On Windows, also handle backslashes + // On Windows, also handle backslashes and colons (invalid in filenames) String encoded = normalized.replaceAll('/', '-'); if (Platform.isWindows) { encoded = encoded.replaceAll('\\', '-'); + encoded = encoded.replaceAll(':', ''); // Remove colons (e.g., D: -> D) } return encoded;