fix: Chinese path support (issue #3), #4
Merged
Poorgramer-Zack merged 7 commits intomainfrom Jan 6, 2026
Merged
Conversation
…rsion on Windows - Fix PTY creation failure when executable path or working directory contains Chinese characters. - Replace incorrect byte-by-byte WCHAR casting with proper MultiByteToWideChar API. - Ensure command line, environment block, and working directory are correctly encoded for CreateProcessW. - Fixes #3
- Shells: - Added zsh and bash support with platform-specific filtering (hiding Windows-only shells on macOS/Linux). - Implemented runtime fallback logic for Windows (pwsh7 > powershell > cmd) to ensure the terminal starts even if the preferred shell is missing. - Update Mechanism: - Migrated downloads to the system temp directory. - Implemented a "Scan-on-Startup" cleanup strategy that automatically removes leftover installers based on filename patterns, ensuring a clean user environment even after app restarts.
- Removed MSIX support from dependencies, GitHub Actions workflows, and codebase due to certificate trust issues.
There was a problem hiding this comment.
Pull request overview
This PR addresses critical Windows PTY encoding issues for non-ASCII paths, enhances cross-platform shell selection, and overhauls the update mechanism by removing MSIX packaging in favor of standard installers.
Key Changes:
- Implemented UTF-8 to UTF-16 conversion in native Windows PTY code to support Chinese and other non-ASCII characters in paths
- Added zsh and bash shell support with platform-specific filtering and Windows shell fallback logic (pwsh → powershell → cmd)
- Replaced MSIX packaging with standard installers and moved downloads to temp directory with pattern-based cleanup on startup
Reviewed changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
pubspec.yaml |
Bumped version to 0.0.7+1 and removed MSIX dependency |
pubspec.lock |
Removed transitive dependencies for MSIX package (console, get_it) |
packages/flutter_pty/src/flutter_pty_win.c |
Added utf8_to_wide conversion function and refactored command/environment/working_directory builders to properly handle UTF-8 strings |
lib/shared/utils/settings_helpers.dart |
Added localized name mappings for zsh and bash shells |
lib/features/workspace/widgets/shell_selection_popover.dart |
Removed dart:io import, updated shell filtering to use isAvailableOnCurrentPlatform |
lib/features/terminal/bloc/terminal_bloc.dart |
Updated imports and shell resolution to use ShellType.platformDefault and resolveWindowsCommand |
lib/features/settings/widgets/update_settings_content.dart |
Added cleanup mechanism for leftover installers in temp directory, moved download location from Downloads to temp |
lib/features/settings/models/shell_type.dart |
Added zsh/bash shells, implemented platform availability checks, added Windows shell fallback logic |
lib/features/settings/models/app_settings.dart |
Changed defaultShell to use platform-specific defaults |
lib/features/settings/bloc/settings_state.dart |
Updated constructor to support nullable AppSettings |
lib/features/settings/bloc/settings_bloc.dart |
Removed const modifier for AppSettings initialization |
lib/core/services/app_version_service.dart |
Added caching of release JSON and asset-based URL resolution with platform-specific switch statement |
lib/core/l10n/app_localizations*.dart |
Added zsh and bash localization strings |
assets/l10n/app_*.arb |
Added zsh and bash translation entries |
.github/workflows/release.yml |
Removed MSIX build and upload steps, simplified release table |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- ignore generated file for analyzer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[PR] Windows PTY Encoding Fix, Shell Selection Enhancements, and Update Cleanup Overhaul
Description
This PR addresses several core issues related to terminal compatibility on Windows, platform-specific shell management, and the reliability of the application's update and cleanup mechanism.
1. 🪟 Windows PTY Encoding Fix (Fixes #3)
flutter_pty_win.cto use the WindowsMultiByteToWideCharAPI. Strings are now correctly converted from UTF-8 to Wide Character (UTF-16) before being passed to Windows system calls.2. 🐚 Shell Selection & Reliability
zshandbashsupport. ImplementedisAvailableOnCurrentPlatformto hide Windows-only shells (like PowerShell/CMD/WSL) on macOS/Linux and vice-versa.TerminalBlocandShellType. On Windows, the app now dynamically checks for the existence ofpwsh, falling back topowershelland finallycmdif necessary.getBinaryUrlto use specializedswitch (Platform.operatingSystem)statements for cleaner cross-platform asset resolution.3. 📦 Update Mechanism & MSIX Removal
0x800B010A), the MSIX packaging and deployment steps have been completely removed from the projectpubspec.yaml, GitHub workflows, and codebase).-setup.exeinstallers for Windows updates.Tempdirectory instead of the user's Downloads folder.flutter_agent_panel-*installer residues on startup and after update checks, ensuring a clean user environment even after restarts.4. 🛠️ Miscellaneous
pubspec.yamlversioning and resolved duplicate dependency declarations.release.ymlworkflow to streamline the build process for Windows, macOS, and Linux.Technical Details
packages/flutter_pty/src/flutter_pty_win.c.TerminalBlocfor runtime shell validation.AppVersionServicefor asset selection.UpdateSettingsContentwith enhanced cleanup logic.Verification
.exeinstallers are correctly identified and leftover files are cleaned from%TEMP%.flutter analyze- No errors found.