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

Sergiu Ivanov sivanov at colimite.fr
Fri Jun 9 15:40:03 CEST 2017


Hello Roni,

Thus quoth  Roni Choudhury  at 13:24 on Wed, Jun 07 2017:
> On Wed, Jun 7, 2017 at 12:14 AM Samuel Leathers <disasm at gmail.com> wrote:
>
>> I use nix-shell --run zsh. I alias that to nshell.
>>
> Thanks, Sam, this is a great idea! On this note, do you know of a good way
> to update the prompt to reflect the nix-shell environment I'm in? i.e., is
> there a way to *name* the nix-shell env, and get access to that name
> through an environment variable?

  nix-shell --run 'MY_SHELL_NAME=foo zsh'

will allow you to tag the shell with a custom environment variable.

If you want to update the prompt, you should probably play around with
shell prompt variables (like PS1 in bash):

  http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html#Prompt-Expansion


> I wanted to add that even if I don't drop into zsh as my first act in the
> nix-shell, I still get that weird output from executables not in the
> environment (such as `zsh` and `git`). If anyone has any insight or can
> answer my other question, that would be great.

My first reaction on seeing your very first mail was that you were
probably having issues with processing of ASCII terminal codes.
Unfortunately, I don't have any clear suggestions.

Have you tried running the commands in different terminal emulators?

--
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/20170609/8d646927/attachment.sig>


More information about the nix-dev mailing list