all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Edouard Klein <edou@rdklein.fr>
To: Kyle Andrews <kyle@posteo.net>
Cc: help-guix@gnu.org
Subject: Re: guix shell readline issue with R
Date: Mon, 03 Jul 2023 09:58:15 +0200	[thread overview]
Message-ID: <87cz19e83y.fsf@rdklein.fr> (raw)
In-Reply-To: <87cz1at0pi.fsf@posteo.net>

Hy Kyle,


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.

Let me know if the problem still persists.

Here is the script:

#!/usr/bin/env -S guix shell r -- bash
set -m
R&
function ctrlc(){
    # Doing nothing
    true
}
trap ctrlc SIGINT
fg

Cheers,

Edouard.


Kyle Andrews <kyle@posteo.net> writes:

> Edouard Klein <edou@rdklein.fr> writes:
>
>> Hi Kyle,
>>
>>
>> Running
>> guix shell r
>>
>> and then
>> R
>>
>> will get you the C-c handling you want.
>
> Hi Edouard,
>
> I wrote another reply, but forgot to comment on this because I feel like I am missing something here.
>
> It would be really convenient if I could just write a shell script like that.
> For me the first command hijacks the execution so that the script cannot invoke
> R. Is there a workaround avoiding -- which would let me automate that with a
> script?
>
> Cheers,
> Kyle


  reply	other threads:[~2023-07-03  8:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-02 17:57 guix shell readline issue with R Kyle Andrews
2023-07-02 19:09 ` Edouard Klein
2023-07-02 20:53   ` Kyle Andrews
2023-07-02 22:14   ` Kyle Andrews
2023-07-03  7:58     ` Edouard Klein [this message]
2023-07-03 21:55       ` Kyle Andrews
2023-07-04 12:27         ` Edouard Klein
2023-08-23 14:56 ` Simon Tournier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87cz19e83y.fsf@rdklein.fr \
    --to=edou@rdklein.fr \
    --cc=help-guix@gnu.org \
    --cc=kyle@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.