@@ -19,14 +19,15 @@ use crate::onboarding::onboarding_screen::StepStateProvider;
19
19
20
20
use super :: onboarding_screen:: StepState ;
21
21
22
- pub ( crate ) const WSL_INSTRUCTIONS : & str = r"Windows Subsystem for Linux (WSL2) is required to run Codex.
22
+ pub ( crate ) const WSL_INSTRUCTIONS : & str = r"Install WSL2 by opening PowerShell as Administrator and running:
23
23
24
- To install WSL2:
25
- 1. Open PowerShell as Administrator and run: wsl --install
26
- 2. Restart your machine if prompted.
27
- 3. Launch the Ubuntu shortcut from the Start menu to complete setup.
24
+ wsl --install
28
25
29
- After installation, reopen Codex from a WSL shell." ;
26
+ After installation, run Codex from inside of WSL2 with:
27
+
28
+ wsl -e codex
29
+
30
+ More info: https://developers.openai.com/codex/windows" ;
30
31
31
32
pub ( crate ) struct WindowsSetupWidget {
32
33
pub codex_home : PathBuf ,
@@ -47,7 +48,7 @@ impl WindowsSetupWidget {
47
48
Self {
48
49
codex_home,
49
50
selection : None ,
50
- highlighted : WindowsSetupSelection :: Continue ,
51
+ highlighted : WindowsSetupSelection :: Install ,
51
52
error : None ,
52
53
exit_requested : false ,
53
54
}
@@ -83,11 +84,10 @@ impl WindowsSetupWidget {
83
84
impl WidgetRef for & WindowsSetupWidget {
84
85
fn render_ref ( & self , area : Rect , buf : & mut Buffer ) {
85
86
let mut lines: Vec < Line > = vec ! [
86
- Line :: from( vec![ "> " . into( ) , "Codex Windows Support" . bold( ) ] ) ,
87
- Line :: from( "" ) ,
88
- Line :: from(
89
- " Codex support for Windows is in progress. Full support for Codex on Windows requires Windows Subsystem for Linux (WSL2)." ,
90
- ) ,
87
+ Line :: from( vec![
88
+ "> " . into( ) ,
89
+ "For best performance, run Codex in Windows Subsystem for Linux (WSL2)" . bold( ) ,
90
+ ] ) ,
91
91
Line :: from( "" ) ,
92
92
] ;
93
93
@@ -102,13 +102,13 @@ impl WidgetRef for &WindowsSetupWidget {
102
102
103
103
lines. push ( create_option (
104
104
0 ,
105
- WindowsSetupSelection :: Continue ,
106
- "Continue anyway " ,
105
+ WindowsSetupSelection :: Install ,
106
+ "Exit and install WSL2 " ,
107
107
) ) ;
108
108
lines. push ( create_option (
109
109
1 ,
110
- WindowsSetupSelection :: Install ,
111
- "Exit and install Windows Subsystem for Linux (WSL2) " ,
110
+ WindowsSetupSelection :: Continue ,
111
+ "Continue anyway " ,
112
112
) ) ;
113
113
lines. push ( "" . into ( ) ) ;
114
114
@@ -133,16 +133,16 @@ impl KeyboardHandler for WindowsSetupWidget {
133
133
134
134
match key_event. code {
135
135
KeyCode :: Up | KeyCode :: Char ( 'k' ) => {
136
- self . highlighted = WindowsSetupSelection :: Continue ;
136
+ self . highlighted = WindowsSetupSelection :: Install ;
137
137
}
138
138
KeyCode :: Down | KeyCode :: Char ( 'j' ) => {
139
- self . highlighted = WindowsSetupSelection :: Install ;
139
+ self . highlighted = WindowsSetupSelection :: Continue ;
140
140
}
141
- KeyCode :: Char ( '1' ) => self . handle_continue ( ) ,
142
- KeyCode :: Char ( '2' ) => self . handle_install ( ) ,
141
+ KeyCode :: Char ( '1' ) => self . handle_install ( ) ,
142
+ KeyCode :: Char ( '2' ) => self . handle_continue ( ) ,
143
143
KeyCode :: Enter => match self . highlighted {
144
- WindowsSetupSelection :: Continue => self . handle_continue ( ) ,
145
144
WindowsSetupSelection :: Install => self . handle_install ( ) ,
145
+ WindowsSetupSelection :: Continue => self . handle_continue ( ) ,
146
146
} ,
147
147
_ => { }
148
148
}
0 commit comments