From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id wGjtL8cQpGQptwAASxT56A (envelope-from ) for ; Tue, 04 Jul 2023 14:29:59 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id SG8KL8cQpGTUNAEAG6o9tA (envelope-from ) for ; Tue, 04 Jul 2023 14:29:59 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 51D9CA62F for ; Tue, 4 Jul 2023 14:29:59 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qGf9e-0006Fo-SR; Tue, 04 Jul 2023 08:29:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qGf9a-0006EF-Oh for help-guix@gnu.org; Tue, 04 Jul 2023 08:29:11 -0400 Received: from sender11-op-o11.zoho.eu ([31.186.226.225]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qGf9Y-0000eL-4Z for help-guix@gnu.org; Tue, 04 Jul 2023 08:29:10 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1688473740; cv=none; d=zohomail.eu; s=zohoarc; b=f3PQUX8wImX48VCysn8XN8XjUwW49TUIf1dDAPC/Tz6zAXYYxAQAGicZQfTpFxrS5JTV6PTrZS5DZHWtoMO5aVhhZq3+5BlyNQVAN1QCFyuqngE2DF47hTWzvnyE+gNJyDi2raX06GhEeoz4S/nB+Ov6YzLVmlDZeHKxlkZ42I0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1688473740; h=Content-Type:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=DGMrhj2ClT9OEYzCYo6tyU81I2i9i4ioK2mpsGRixQs=; b=k+mr/Al41rA7pCnD+HdX5p0UmoKbiDrqInbTZAKdat2jgRno/cnaI1EkIvUhkol/6LgUjhxi+QAdmh5EleoiiwBivQ0cuyLyus9wCrgemvUW4VNJOpD7DmLdsq9Mwizf7+v15mL5t0YCJ3twOBqMIuMGELB915/qxRBssD6unQ8= ARC-Authentication-Results: i=1; mx.zohomail.eu; dkim=pass header.i=rdklein.fr; spf=pass smtp.mailfrom=edou@rdklein.fr; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1688473740; s=zoho; d=rdklein.fr; i=edou@rdklein.fr; h=References:From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:In-reply-to:Message-ID:MIME-Version:Content-Type:Message-Id:Reply-To; bh=DGMrhj2ClT9OEYzCYo6tyU81I2i9i4ioK2mpsGRixQs=; b=IYXloR2GdUxt2IbjGVUvQV8ArN1Ol2PCL2ISqVbd3YvKNkoJjb6CAAs09cm8BiTG 99BV3hPnBxPjNG2JJ23hf82ObyV3dqHxGyQUW2t1gRt3e8y40xdO4bvCAyq36f5MESg 9Dr7562MTccJ2NhKwr35O99PxpkeEA54+V1LMWZrS9UuiZyQDNZCHjZa1freT8n7qby s2OzXui5XVHwDJOQLU4Fh4nw1TuZkFslwVtKLaNdMg3qhaSnGXgWwB3Br7ufiqx5tst gSk/tgUywUTqxg6ueP+vLss67VU0gN5AFRFZ/RDCu6VQ5en6ob9ciTL4IvdNeh8k+Cl 1IEi4eHR1w== Received: from schwarzy (lfbn-idf3-1-667-244.w86-252.abo.wanadoo.fr [86.252.237.244]) by mx.zoho.eu with SMTPS id 1688473736935553.4958687858765; Tue, 4 Jul 2023 14:28:56 +0200 (CEST) References: <87lefy2ne6.fsf@posteo.net> <87ttumdt63.fsf@rdklein.fr> <87cz1at0pi.fsf@posteo.net> <87cz19e83y.fsf@rdklein.fr> <87mt0ctzfo.fsf@posteo.net> User-agent: mu4e 1.10.2; emacs 28.2 From: Edouard Klein To: Kyle Andrews Cc: help-guix@gnu.org Subject: Re: guix shell readline issue with R Date: Tue, 04 Jul 2023 14:27:15 +0200 In-reply-to: <87mt0ctzfo.fsf@posteo.net> Message-ID: <87zg4bdfnq.fsf@rdklein.fr> MIME-Version: 1.0 Content-Type: text/plain X-ZohoMailClient: External Received-SPF: pass client-ip=31.186.226.225; envelope-from=edou@rdklein.fr; helo=sender11-op-o11.zoho.eu X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: help-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=2; s=key1; d=yhetil.org; t=1688473799; a=rsa-sha256; cv=pass; b=RHzZ+E0H1HNI12LJP+lsf3Ulek7rpUiczjXPzZPcFlyKMRd2NSNhweYU89CKer3omogZQD 7F09FOuAt6i164GbO7QGzqAiOmEVv3tULmXh3fWLfYFk6qe6dKLfc7o8qAcNH4KswTDlmp qnorwb+jiJ/K+KbjhOym/ouyAUTqiDlmf7FKEWI3TX/V/cipNjJrMmfWoGOWI5LU/3k1Oq aywJmoWndFJugj/4lIQgnBvX21cvOB7S76n6GqzTq5RIBtcytz7AWqGWSpjnZRXQA/m2zs 9n9opBkFBJtjwTl9KwMwZHyPFygpSAhuRzK2kLgcGVLjscFToZ6zu609nCZyyg== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=rdklein.fr header.s=zoho header.b=IYXloR2G; dmarc=none; arc=pass ("zohomail.eu:s=zohoarc:i=1"); spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1688473799; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=DGMrhj2ClT9OEYzCYo6tyU81I2i9i4ioK2mpsGRixQs=; b=ZeoXLIw9G/oiBRCdmAp8M8OBxHjX5PzzgWZwd68X5N2giU7GlwWwjJIItmg2Dsx3kVfar/ zMPTsRtmouOVvQuspEZO1Xl5GktGih61pXSmGnMm3KRU9NrpjcgqUYUhEjnwil3R8tPZwX Q+T7wURZ9NoqBsWhrmiXR4ufVfThyoeWxwERpQCQik0/XwmlngyyTKvypac6p0mTUEKUp3 AmZz5R61+gTlxgMegk1kdo+D2KctzsvwNF/M9b4KcKqTnjmLm4qjDt+YQd+Jl+N/sEnFpm O1Df8Tu8/IRg/QwQk0oaxFpam4ADzDR4YLo8hXL1YS/EPjbpPgJupiXgqFijzg== Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=rdklein.fr header.s=zoho header.b=IYXloR2G; dmarc=none; arc=pass ("zohomail.eu:s=zohoarc:i=1"); spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -8.92 X-Spam-Score: -8.92 X-Migadu-Queue-Id: 51D9CA62F X-TUID: 3i22c2+lRbnn 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 writes: > Edouard Klein 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