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: 0ed7c957bed1
Choose a base ref
...
head repository: NixOS/nix
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3f680c1dccb7
Choose a head ref
  • 4 commits
  • 2 files changed
  • 3 contributors

Commits on Nov 9, 2020

  1. Copy the full SHA
    fb7735e View commit details
  2. Make test case more precise

    Co-authored-by: Théophane Hufschmitt <regnat@users.noreply.github.com>
    Kha and Théophane Hufschmitt committed Nov 9, 2020
    Copy the full SHA
    579b953 View commit details
  3. Copy the full SHA
    3f24a41 View commit details

Commits on Nov 10, 2020

  1. Merge pull request #4233 from Kha/master

    nix develop: Preserve stdin with `-c`
    edolstra authored Nov 10, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    3f680c1 View commit details
Showing with 8 additions and 2 deletions.
  1. +2 −2 src/nix/develop.cc
  2. +6 −0 tests/nix-shell.sh
4 changes: 2 additions & 2 deletions src/nix/develop.cc
Original file line number Diff line number Diff line change
@@ -474,9 +474,9 @@ struct CmdDevelop : Common, MixEnvironment
ignoreException();
}

// If running a phase, don't want an interactive shell running after
// If running a phase or single command, don't want an interactive shell running after
// Ctrl-C, so don't pass --rcfile
auto args = phase ? Strings{std::string(baseNameOf(shell)), rcFilePath}
auto args = phase || !command.empty() ? Strings{std::string(baseNameOf(shell)), rcFilePath}
: Strings{std::string(baseNameOf(shell)), "--rcfile", rcFilePath};

restoreAffinity();
6 changes: 6 additions & 0 deletions tests/nix-shell.sh
Original file line number Diff line number Diff line change
@@ -59,6 +59,12 @@ output=$($TEST_ROOT/shell.shebang.rb abc ruby)
# Test 'nix develop'.
nix develop -f shell.nix shellDrv -c bash -c '[[ -n $stdenv ]]'

# Ensure `nix develop -c` preserves stdin
echo foo | nix develop -f shell.nix shellDrv -c cat | grep -q foo

# Ensure `nix develop -c` actually executes the command if stdout isn't a terminal
nix develop -f shell.nix shellDrv -c echo foo |& grep -q foo

# Test 'nix print-dev-env'.
source <(nix print-dev-env -f shell.nix shellDrv)
[[ -n $stdenv ]]