feat: add comprehensive shell preference system with WSL and multi-distro support #25
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.
Fixes issues where WSL users with non-default shells couldn't use terminal features due to hardcoded shell assumptions. Now properly detects WSL environments and user's actual shell, with manual override options.
Description
This adds comprehensive WSL integration and multi-shell support that makes Onlook work properly across all development environments, including WSL distributions and various shell configurations.
The Problem
Users in WSL environments (Ubuntu, Debian, Alpine, Arch, etc.) with non-bash shells couldn't use Onlook's terminal features because the application made hardcoded assumptions about shell types and didn't properly detect WSL environments or user shell configurations.
The Solution
/proc/version
,/proc/sys/kernel/osrelease
)$SHELL
environment variable and system configuration (/etc/passwd
)Related Issues
Fixes issues where WSL users with non-default shells (Fish, Zsh, etc.) couldn't use terminal features due to hardcoded shell assumptions and inadequate WSL environment detection.
Type of Change
Testing
Comprehensive Testing Performed
WSL Detection Testing:
Shell Detection Testing:
/usr/bin/fish
, Bash:/bin/bash
, Zsh:/bin/zsh
)$SHELL
environment variable as primary method/etc/passwd
lookup when neededShell Preference Switching:
Cross-Platform Command Execution Testing:
bun --version
works correctly with Fish shell in WSL (returns1.2.14
)bun --version
works correctly with Bash shell in WSLIntegration Testing Results:
Manual Testing Steps:
Screenshots (if applicable)
The new shell preference dropdown appears in Settings → Preferences with the following options:
Additional Notes
Files changed
apps/studio/electron/main/utils/platform.ts
)Why this approach
WSL Support
This works with all WSL distributions including Ubuntu, Debian, Alpine, Arch, openSUSE, Fedora, and more. The detection logic uses multiple methods to ensure compatibility across WSL versions.
Code Quality
This should make Onlook much more pleasant to use for anyone not using bash, especially Fish users who were completely stuck before!