Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nix
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 77d4758cf2f4
Choose a base ref
...
head repository: NixOS/nix
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: e1f2c93f8894
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Sep 5, 2020

  1. Add nix-shell support for preserving PS1

    Fixes #1268
    
    `nix-shell` will now preserve `PS1` if the `NIX_SHELL_PRESERVE_PROMPT`
    environment variable is set.
    Gabriella439 committed Sep 5, 2020
    Copy the full SHA
    ee59062 View commit details

Commits on Sep 11, 2020

  1. Merge pull request #3988 from Gabriel439/gabriel/preserve_ps1

    Add `nix-shell` support for preserving PS1
    domenkozar authored Sep 11, 2020
    Copy the full SHA
    e1f2c93 View commit details
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/nix-build/nix-build.cc
6 changes: 3 additions & 3 deletions src/nix-build/nix-build.cc
Original file line number Diff line number Diff line change
@@ -98,8 +98,8 @@ static void _main(int argc, char * * argv)

// List of environment variables kept for --pure
std::set<string> keepVars{
"HOME", "USER", "LOGNAME", "DISPLAY", "PATH", "TERM",
"IN_NIX_SHELL", "TZ", "PAGER", "NIX_BUILD_SHELL", "SHLVL",
"HOME", "USER", "LOGNAME", "DISPLAY", "PATH", "TERM", "IN_NIX_SHELL",
"NIX_SHELL_PRESERVE_PROMPT", "TZ", "PAGER", "NIX_BUILD_SHELL", "SHLVL",
"http_proxy", "https_proxy", "ftp_proxy", "all_proxy", "no_proxy"
};

@@ -446,7 +446,7 @@ static void _main(int argc, char * * argv)
"PATH=%4%:\"$PATH\"; "
"SHELL=%5%; "
"set +e; "
R"s([ -n "$PS1" ] && PS1='\n\[\033[1;32m\][nix-shell:\w]\$\[\033[0m\] '; )s"
R"s([ -n "$PS1" -a -z "$NIX_SHELL_PRESERVE_PROMPT" ] && PS1='\n\[\033[1;32m\][nix-shell:\w]\$\[\033[0m\] '; )s"
"if [ \"$(type -t runHook)\" = function ]; then runHook shellHook; fi; "
"unset NIX_ENFORCE_PURITY; "
"shopt -u nullglob; "