Skip to content

Commit c264ae6

Browse files
authored
feat: tweak windows wsl copy (#4795)
Tweaked the WSL dialogue and the installation instructions.
1 parent 8cd882c commit c264ae6

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

codex-rs/tui/src/onboarding/windows.rs

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,15 @@ use crate::onboarding::onboarding_screen::StepStateProvider;
1919

2020
use super::onboarding_screen::StepState;
2121

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:
2323
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
2825
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";
3031

3132
pub(crate) struct WindowsSetupWidget {
3233
pub codex_home: PathBuf,
@@ -47,7 +48,7 @@ impl WindowsSetupWidget {
4748
Self {
4849
codex_home,
4950
selection: None,
50-
highlighted: WindowsSetupSelection::Continue,
51+
highlighted: WindowsSetupSelection::Install,
5152
error: None,
5253
exit_requested: false,
5354
}
@@ -83,11 +84,10 @@ impl WindowsSetupWidget {
8384
impl WidgetRef for &WindowsSetupWidget {
8485
fn render_ref(&self, area: Rect, buf: &mut Buffer) {
8586
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+
]),
9191
Line::from(""),
9292
];
9393

@@ -102,13 +102,13 @@ impl WidgetRef for &WindowsSetupWidget {
102102

103103
lines.push(create_option(
104104
0,
105-
WindowsSetupSelection::Continue,
106-
"Continue anyway",
105+
WindowsSetupSelection::Install,
106+
"Exit and install WSL2",
107107
));
108108
lines.push(create_option(
109109
1,
110-
WindowsSetupSelection::Install,
111-
"Exit and install Windows Subsystem for Linux (WSL2)",
110+
WindowsSetupSelection::Continue,
111+
"Continue anyway",
112112
));
113113
lines.push("".into());
114114

@@ -133,16 +133,16 @@ impl KeyboardHandler for WindowsSetupWidget {
133133

134134
match key_event.code {
135135
KeyCode::Up | KeyCode::Char('k') => {
136-
self.highlighted = WindowsSetupSelection::Continue;
136+
self.highlighted = WindowsSetupSelection::Install;
137137
}
138138
KeyCode::Down | KeyCode::Char('j') => {
139-
self.highlighted = WindowsSetupSelection::Install;
139+
self.highlighted = WindowsSetupSelection::Continue;
140140
}
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(),
143143
KeyCode::Enter => match self.highlighted {
144-
WindowsSetupSelection::Continue => self.handle_continue(),
145144
WindowsSetupSelection::Install => self.handle_install(),
145+
WindowsSetupSelection::Continue => self.handle_continue(),
146146
},
147147
_ => {}
148148
}

0 commit comments

Comments
 (0)