-
Notifications
You must be signed in to change notification settings - Fork 153
fix: support WSL2 sandboxing, reject WSL1 #99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WSL2+ uses the same bubblewrap sandboxing as Linux, so it should be supported. WSL1 does not support bubblewrap properly. - Add getWslVersion() to detect WSL version from /proc/version - Update isSupportedPlatform() to check for WSL1 and reject it - Remove 'wsl' from Platform type (getPlatform returns 'linux' for WSL) - Update comments to clarify Linux/WSL glob pattern handling
| * Get the WSL version (1 or 2+) if running in WSL. | ||
| * Returns undefined if not running in WSL. | ||
| */ | ||
| export function getWslVersion(): string | undefined { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
took this from claude-cli code :)
254d82e to
d612cb7
Compare
| enableLogMonitor?: boolean, | ||
| ): Promise<void> | ||
| isSupportedPlatform(platform: Platform): boolean | ||
| isSupportedPlatform(): boolean |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
api changed here but i really think it's unused and this is cleaner
dylan-conway
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
| const supportedPlatforms: Platform[] = ['macos', 'linux'] | ||
| return supportedPlatforms.includes(platform) | ||
| function isSupportedPlatform(): boolean { | ||
| const platform = getPlatform() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could add latency due to containing a sync FS call (reading the /proc/version)
Summary
WSL2+ uses the same bubblewrap sandboxing as Linux, so it should be supported. WSL1 does not support bubblewrap properly.
Changes
getWslVersion()to detect WSL version from/proc/versionisSupportedPlatform()to check for WSL1 and reject itgetPlatformreturns 'linux' for WSL)Testing