[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
guix environment & PS1
From: |
Ludovic Courtès |
Subject: |
guix environment & PS1 |
Date: |
Thu, 25 Jun 2015 13:45:57 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Cyril Roelandt <address@hidden> skribis:
> +(define (run-shell shell env-name)
> + "Run the given SHELL, adding '(ENV-NAME) ' at the start of the prompt."
> + (cond ((string=? shell "/bin/bash")
> + (let* ((directory (or (getenv "TMPDIR") "/tmp"))
> + (template (string-append directory "/guix-file.XXXXXX"))
> + (out (mkstemp! template)))
> + (format out "export PS1=\"(~a) $PS1\"" env-name)
> + (flush-output-port out)
> + (system (string-append "/bin/bash --rcfile " template))))
What about this simpler idea: ‘guix environment’ would unconditionally
do:
(setenv "GUIX_ENVIRONMENT" "t")
and then users can choose in their .bashrc to use a separate PS1 when
GUIX_ENVIRONMENT is defined.
WDYT?
Ludo’.
- [PATCH] guix environment: add a '--env-name' option, Cyril Roelandt, 2015/06/24
- guix environment & PS1,
Ludovic Courtès <=
- Re: guix environment & PS1, Ricardo Wurmus, 2015/06/25
- Re: guix environment & PS1, Thompson, David, 2015/06/25
- Re: guix environment & PS1, Ricardo Wurmus, 2015/06/25
- Re: guix environment & PS1, 韋嘉誠, 2015/06/25
- Re: guix environment & PS1, 韋嘉誠, 2015/06/25
- Re: guix environment & PS1, Ludovic Courtès, 2015/06/29
- Re: guix environment & PS1, 韋嘉誠, 2015/06/29
Re: guix environment & PS1, Thompson, David, 2015/06/25