Skip to content

Commit

Permalink
fix pwsh prompt (#388)
Browse files Browse the repository at this point in the history
Previously the prompt wouldn't update if you changed dir. 
This now reruns the prompt every time it prints

Closes #384
  • Loading branch information
ruben-arts committed Oct 17, 2023
1 parent 140315f commit 40cc57e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/prompt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ pub fn get_xonsh_prompt() -> String {
// Xonsh' default prompt can find the environment for some reason.
"".to_string()
}

/// Set default pixi prompt for the powershell
pub fn get_powershell_prompt(env_name: &str) -> String {
format!(
"$old_prompt = & $function:prompt\n\
function prompt {{\"({}) $old_prompt\"}}",
"$old_prompt = $function:prompt\n\
function prompt {{\"({}) $($old_prompt.Invoke())\"}}",
env_name
)
}
Expand Down

0 comments on commit 40cc57e

Please sign in to comment.