From 8e23fe5560064fe98518dc016a33267235446c89 Mon Sep 17 00:00:00 2001 From: Darren Schroeder <343840+fdncred@users.noreply.github.com> Date: Mon, 25 Apr 2022 06:29:49 -0500 Subject: [PATCH] use $nu.os-info vs (sys).host for speed (#212) --- prompt/oh-my.nu | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/prompt/oh-my.nu b/prompt/oh-my.nu index 69be6ea..cf6fa21 100644 --- a/prompt/oh-my.nu +++ b/prompt/oh-my.nu @@ -168,13 +168,13 @@ def get_icon_by_name [name] { def get_os_icon [os] { # f17c = tux, f179 = apple, f17a = windows - if ($os.name =~ Darwin) { + if ($os.name =~ macos) { (char -u f179) - } else if ($os.name =~ Linux) { - (char -u f17c) - } else if ($os.name =~ Windows) { + } else if ($os.name =~ windows) { (char -u f17a) - } else if ($os.'kernel version' =~ WSL) { + } else if ($os.family =~ unix) { + (char -u f17c) + } else if ($os.kernel_version =~ WSL) { $'(char -u f17a)(char -u f17c)' } else { '' @@ -505,7 +505,7 @@ def git_right_prompt [gs os] { export def git_prompt [] { let gs = (gstat) - let os = ((sys).host) + let os = $nu.os-info let left_prompt = (git_left_prompt $gs $os) let right_prompt = (git_right_prompt $gs $os)