Credit where credit is due, the shebang's idea comes from guix's manual.
You can also do the following:
#+begin_src bash
#!/usr/bin/env bash
# Autowrap self in guix shell
if [ -z "${GUIX_ENVIRONMENT:-}" ]
then
guix shell YOUR DEPENDENCIES HERE -- "$0" "$@"
exit 0
fi
ACTUAL CONTENTS OF THE SCRIPT HERE
#+end_src
Cheers !
Edouard
Kyle Andrews <[email protected]> writes:
> Edouard Klein <[email protected]> writes:
>
>> Here is a script that restores the ctrl-C behaviour of R, whithin a guix
>> shell.
>>
>> I must admit I don't exactly understand the finer points of why it works,
>> but just trapping SIGINT in the script is enough for R to behave.
>>
>> My intuition is SIGINT is sent to the whole group. The script
>> interrupts R. If we trap it in the script, it does nothing. R gets it as
>> well and acts on it like you expect.
>
> Thanks, Edouard!
>
> Your script worked perfectly just as you described. I was sorely missing that
> `set -m' call and passing true from the bash function. I also really like
> your idea for the shebang line.
>
> Best Regards,
> Kyle