1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-08-02 07:07:46 +00:00

Fix undetected windows enviroment (#312)

This commit is contained in:
Kevin Zhang 2022-11-11 12:30:58 -06:00 committed by GitHub
parent cb5f2627db
commit c3abd6439c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -239,7 +239,7 @@ def get_color [name, mode] {
def home_abbrev [os_name] { def home_abbrev [os_name] {
let is_home_in_path = ($env.PWD | str starts-with $nu.home-path) let is_home_in_path = ($env.PWD | str starts-with $nu.home-path)
if $is_home_in_path { if $is_home_in_path {
if ($os_name == "Windows") { if ($os_name == "windows") {
let home = ($nu.home-path | str replace -a '\\' '/') let home = ($nu.home-path | str replace -a '\\' '/')
let pwd = ($env.PWD | str replace -a '\\' '/') let pwd = ($env.PWD | str replace -a '\\' '/')
$pwd | str replace $home '~' $pwd | str replace $home '~'
@ -432,4 +432,4 @@ def get_prompt [color_mode] {
left_prompt: $left_prompt left_prompt: $left_prompt
right_prompt: $right_prompt right_prompt: $right_prompt
} }
} }