[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: guix shell readline issue with R
From: |
Edouard Klein |
Subject: |
Re: guix shell readline issue with R |
Date: |
Tue, 04 Jul 2023 14:27:15 +0200 |
User-agent: |
mu4e 1.10.2; emacs 28.2 |
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 <kyle@posteo.net> writes:
> Edouard Klein <edou@rdklein.fr> 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