[Nix-dev] weird garbage output inside nix-shell

Sergiu Ivanov sivanov at colimite.fr
Sun Jun 11 11:45:52 CEST 2017


Hi Roni,

Thus quoth  Roni Choudhury  at 17:38 on Sat, Jun 10 2017:
>
> Linus, Sam, and Sergiu - thank you for the suggestions. I did poke
> around in the output from `env` and discovered IN_NIX_SHELL, and
> arranged my .zshrc to show `${name}` when `$IN_NIX_SHELL` is
> true. Fantastic!

Great job!  I didn't know about that environment variable.

> I'm not sure the other problem has to do with character encodings
> (though I don't know too much about how that works).

Ooh, sorry, I messed up in my previous E-mail by saying "ASCII terminal
codes" :-( What I really meant was this:

  https://en.wikipedia.org/wiki/ANSI_escape_code

> I did notice that `ldd $(which vim)` shows me different results when I
> am inside my nix-shell vs. when I'm not.

This is weird.  I get exactly the same results (modulo the differences
in the memory map addresses listed in parentheses at the end of each
line).  (I don't have vim mentioned in this particular shell.nix.)

> I kind of thought I shouldn't even be able to launch vim from inside
> my shell if it's not listed as a buildDep.

It looks to me that nix-shell _extends_ the environment it is run in.
So, if you run nix-shell in an environment which contains vim, you have
vim inside nix-shell.

> If I send my shell.nix, would someone else mind trying to use it to see if
> you can reproduce my strange results?

Go ahead.  (Remember to scrub all sensitive information.)

--
Sergiu
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 487 bytes
Desc: not available
URL: <https://mailman.science.uu.nl/pipermail/nix-dev/attachments/20170611/4c626807/attachment.sig>


More information about the nix-dev mailing list