File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
src/virtualenv/activation/nushell Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 1
1
# Setting all environment variables for the venv
2
+ let path-name = (if ((sys ).host.name == " Windows" ) { " Path" } { " PATH" })
2
3
let virtual-env = " __VIRTUAL_ENV__"
3
4
let bin = " __BIN_NAME__"
4
5
let path-sep = " __PATH_SEP__"
@@ -11,7 +12,7 @@ let new-path = ($nu.path | prepend $venv-path | str collect ($path-sep))
11
12
# environment variables that will be batched loaded to the virtual env
12
13
let new-env = ([
13
14
[name , value ];
14
- [PATH $new -path ]
15
+ [$path -name $new -path ]
15
16
[_OLD_VIRTUAL_PATH $old -path ]
16
17
[VIRTUAL_ENV $virtual -env ]
17
18
])
@@ -22,15 +23,15 @@ load-env $new-env
22
23
let virtual_prompt = (if (" __VIRTUAL_PROMPT__" != " " ) {
23
24
" __VIRTUAL_PROMPT__"
24
25
} {
25
- $virtual -env | path basename
26
+ ( build-string ' ( ' ( $virtual -env | path basename ) ' ) ' )
26
27
}
27
28
)
28
29
29
30
# If there is no default prompt, then only the env is printed in the prompt
30
31
let new_prompt = (if ( config | select prompt | empty ? ) {
31
- ($" build-string '(char lparen )' '( $virtual_prompt )' '( char rparen ) ' " )
32
+ ($" build-string '($virtual_prompt )'" )
32
33
} {
33
- ($" build-string '(char lparen )' '( $virtual_prompt )' '( char rparen ) ' (config get prompt | str find-replace " build-string" " " )" )
34
+ ($" build-string '($virtual_prompt )' (config get prompt | str find-replace " build-string" " " )" )
34
35
})
35
36
let-env PROMPT_COMMAND = $new_prompt
36
37
You can’t perform that action at this time.
0 commit comments