From 8c7072c5efa19ed5f07e95ab3ee6d281fc6e4cac Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Mon, 27 Dec 2021 10:38:10 -0700 Subject: [PATCH] gui: flesh out test case for wsl -l -v closes: https://github.com/wez/wezterm/issues/1462 --- docs/changelog.md | 1 + wezterm-gui/src/overlay/launcher.rs | 47 +++++++++++++++++++++++------ 2 files changed, 39 insertions(+), 9 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index 51eca7713..15cfd8b2a 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -62,6 +62,7 @@ As features stabilize some brief notes about them will accumulate here. * Colors were too intense due to over gamma correction [#1025](https://github.com/wez/wezterm/issues/1025) * Mesa and EGL colors were too dim due to under gamma correction [#1373](https://github.com/wez/wezterm/issues/1373) * `wezterm ssh` no longer tries to use `default_prog` or `default_cwd` when spawning additional panes on the remote host [#1456](https://github.com/wez/wezterm/issues/1456) +* Launcher menu WSL items now launch correctly on non-US versions of Windows [#1462](https://github.com/wez/wezterm/issues/1462) ### 20211205-192649-672c1cc1 diff --git a/wezterm-gui/src/overlay/launcher.rs b/wezterm-gui/src/overlay/launcher.rs index 3dd8394f5..a6b5a20e5 100644 --- a/wezterm-gui/src/overlay/launcher.rs +++ b/wezterm-gui/src/overlay/launcher.rs @@ -137,18 +137,47 @@ fn parse_wsl_distro_list(output: &str) -> Vec { #[cfg(test)] #[test] fn test_parse_wsl_distro_list() { - let data = " NAME STATE VERSION\n\ -* Ubuntu-18.04 Running 1\n -"; + let data = " NAME STATE VERSION +* Arch Running 2 + docker-desktop-data Stopped 2 + docker-desktop Stopped 2 + Ubuntu Stopped 2 + nvim Stopped 2"; assert_eq!( parse_wsl_distro_list(data), - vec![WslDistro { - name: "Ubuntu-18.04".to_string(), - state: "Running".to_string(), - version: "1".to_string(), - is_default: true - }] + vec![ + WslDistro { + name: "Arch".to_string(), + state: "Running".to_string(), + version: "2".to_string(), + is_default: true + }, + WslDistro { + name: "docker-desktop-data".to_string(), + state: "Stopped".to_string(), + version: "2".to_string(), + is_default: false + }, + WslDistro { + name: "docker-desktop".to_string(), + state: "Stopped".to_string(), + version: "2".to_string(), + is_default: false + }, + WslDistro { + name: "Ubuntu".to_string(), + state: "Stopped".to_string(), + version: "2".to_string(), + is_default: false + }, + WslDistro { + name: "nvim".to_string(), + state: "Stopped".to_string(), + version: "2".to_string(), + is_default: false + }, + ] ); }