GNU bug report logs - #44612
Read standard input in `guix repl'

Previous Next

Package: guix;

Reported by: Pierre Neidhardt <mail <at> ambrevar.xyz>

Date: Fri, 13 Nov 2020 09:42:01 UTC

Severity: normal

Tags: notabug

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Guillaume Le Vaillant <glv <at> posteo.net>
To: Tobias Geerinckx-Rice <me <at> tobias.gr>
Cc: 44612 <at> debbugs.gnu.org, mail <at> ambrevar.xyz
Subject: bug#44612: Read standard input in `guix repl'
Date: Sat, 14 Nov 2020 16:03:56 +0100
[Message part 1 (text/plain, inline)]
Tobias Geerinckx-Rice via Bug reports for GNU Guix <bug-guix <at> gnu.org> skribis:

> Pierre,
>
> Pierre Neidhardt 写道:
>> and... it works! O.o
>
> Don't you hate it when that happens?  Ban bug suicide.
>
> (Does that mean this one can be closed?  Or retitled, if we want to debug
> Nyxt? :-)
>
>> For future reference, it's also works in Common Lisp:
>>            (uiop:run-program '("guix" "repl") :input s :output
>> t            :error-output nil))
>
> Well, I stranded trying to import (or whatever the CL term is) UIOP itself, but
> my Common Lisp-fu is hella weak.
>
>> However this brings me to another issue: the program output is prefixed
>> with the REPL welcome message which is printed to stdout.
>>
>> So ideally when we read from standard input we should not include the
>> welcome message.
>
> That's a question for Guile channels, but I totally agree.  It's annoying and
> nowhere near ‘an interactive mode’ as suggested by the GPL3.
>
> This is sensible:
>
>  $ echo echo Hi. | bash
>  Hi.
>  $ 
> This is not:
>
>  $ echo '(display "Hi.\n")' | guile
>  GNU Guile 3.0.2
>  Copyright (C) 1995-2020 Free Software Foundation, Inc.
>
>  Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show   w'.
>  This program is free software, and you are welcome to   redistribute it
>  under certain conditions; type `,show c' for details.
>
>  Enter `,help' for help.
>  Hi.
>  scheme@(guile-user)>   $
>
>> Any clue how to do that?
>
> The following line in my ~/.guile does just that:
>
>  (set! repl-welcome (const #t))
>
> ...unfortunately, it doesn't work late:
>
>  $ echo '(use-modules ((system repl common))) \
>    (set! repl-welcome (const #t))' | guix repl
>  [shouty noises]
>  $
>
> It does not appear documented if and how you'd make Guile load a different
> (Nyxt-specific) init file name.
>
> This reminds me: do you want Nyxt to call ‘guix repl -q’ to skip loading
> ~/.guile to make your UI more predictable & debuggable? Or keep it as an escape
> hatch for cool hacks?
>
> Kind regards,
>
> T G-R

It looks like you can get rid of the welcome message by using the '-s'
option:

$ echo '(display "Hi.\n")' | guile -s /dev/stdin
Hi.
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 4 years and 230 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.