From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 0KltEzYWtWMTwwAAbAwnHQ (envelope-from ) for ; Wed, 04 Jan 2023 07:01:26 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id JWtpEzYWtWNobAAA9RJhRA (envelope-from ) for ; Wed, 04 Jan 2023 07:01:26 +0100 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 25DAC3EEF9 for ; Wed, 4 Jan 2023 07:01:25 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pCwpl-0001NR-Ga; Wed, 04 Jan 2023 01:01:05 -0500 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 1pCwpj-0001Mg-6v for guix-patches@gnu.org; Wed, 04 Jan 2023 01:01:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pCwpi-0008Rx-CC for guix-patches@gnu.org; Wed, 04 Jan 2023 01:01:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pCwpi-0001d1-3Q for guix-patches@gnu.org; Wed, 04 Jan 2023 01:01:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#60365] [PATCH 0/4] Rationalize 'PS1' handling in home, system, and shell Resent-From: Andrew Tropin Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 04 Jan 2023 06:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60365 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 60365@debbugs.gnu.org Received: via spool by 60365-submit@debbugs.gnu.org id=B60365.16728120356212 (code B ref 60365); Wed, 04 Jan 2023 06:01:02 +0000 Received: (at 60365) by debbugs.gnu.org; 4 Jan 2023 06:00:35 +0000 Received: from localhost ([127.0.0.1]:47362 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pCwpH-0001c7-AT for submit@debbugs.gnu.org; Wed, 04 Jan 2023 01:00:35 -0500 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:52865) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pCwpC-0001bi-GG for 60365@debbugs.gnu.org; Wed, 04 Jan 2023 01:00:34 -0500 Received: (Authenticated sender: andrew@trop.in) by mail.gandi.net (Postfix) with ESMTPSA id F380DC0006; Wed, 4 Jan 2023 06:00:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop.in; s=gm1; t=1672812024; h=from:from: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; bh=8xYs+0pnMPpCVxIO85A7DZmP2Q66mgKw1zmrC3nQEtY=; b=nCScbfez0wXfQFxar8ESVxjUNRGBk4ktodeHwwOffcLZZgRjy8DAn+UvBHeD7VnpnjXPlF Z2yUMJSbMCbR41QwplZ9vrW/8FGewZ7rJ6TXLqlOUlfGPA6ElCtM4JO/1/GG6dFYr3AdeY m4qUoCZ1KQOUOmPy0t0DHwOcXuB1qHGwQFZGTNb78WTGyT2BgTw4VUquk2/Ox13rzEkibK +OH0PKEnqWucmLNZ6t9DCf7UcU+V+02CA7BKye4w0eVmhvhBhWvjZusMebw7FiBK3axk2Q 3NYonheWn3hEwNvkffPRBBcvIytZxorNuALEhuczoQxQrTbxM4SMdEubD1WXKg== From: Andrew Tropin In-Reply-To: <878rij6xsy.fsf_-_@gnu.org> References: <20221227212342.17939-1-ludo@gnu.org> <87v8lwf0vc.fsf@trop.in> <878rij6xsy.fsf_-_@gnu.org> Date: Wed, 04 Jan 2023 10:00:18 +0400 Message-ID: <871qoac00d.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1672812086; a=rsa-sha256; cv=none; b=JdRbBjdPDvmto4375MknITtJypBQEtDrKfJQy0+gJj+/hu+t8MGvdQ0HupWSE06yeSsKtY H7xDZC6DIeiIeglP6IQOoIiAGMffWw0Sul/hJn04cs92xybLUpU44zyQhF0T0LAPdnVpI7 4sr87TrzKiMUcRXWKVdbmXliCzJb+XR/8jeiexVUnGS43i7Xmazpel97eMibnCsDOoYb5Z wGfGS4jtLPoDzIgpIeYDeCdc1kpVAnL3TO56wl+IE5otGV4irexafY8t7Vd4pSPLpahVru no3pWUITUE2Xjshcf0FzuAo6jL1ME6K2RM9XT/SHi+zWPcXcZqyz2uS3nn1pbQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=trop.in header.s=gm1 header.b=nCScbfez; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1672812086; 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:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=8xYs+0pnMPpCVxIO85A7DZmP2Q66mgKw1zmrC3nQEtY=; b=IfXUE/8MDPON3aY0EmMMqS0hrIs1EfjqFSh4w7sEEQPWs9cQtuTqGYIyWLUBnXk4HnRwTn nLAVP4zUOEl5fUk6xDSmYX/EjqwG5n1KDXHOxL1ZKpFWZNWF+VSvhSHTDqSHn07braU02U H0LyWIxlmGWN7G3GdayPqbNNghXxw9dHR6l02m3znAeeAfwzAmuVgesLSnR/mh8Ue9jqLB ttQog6e6DSPiL85T8eArJAv6Mt7muDw5/KX5AZ6ipvhGO0GMZudVdZCpH/nor1WqqhcGBN ZzxLtov9jSpcZm/d26JITQAKGic1EzD1Am9sX/fSs7CYYAfzjN5YSM0M+8Lj9w== X-Spam-Score: -3.76 X-Migadu-Queue-Id: 25DAC3EEF9 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=trop.in header.s=gm1 header.b=nCScbfez; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none X-Migadu-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -3.76 X-TUID: 9BrYpax/5WxG --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2023-01-03 23:46, Ludovic Court=C3=A8s wrote: > Hi Andrew! > > Andrew Tropin skribis: > >>> I found some things could be improved in how we deal with =E2=80=98PS1= =E2=80=99 in >>> Guix Home, Guix System, and =E2=80=98guix shell=E2=80=99 (my initial mo= tivation was >>> making it easy to change =E2=80=98PS1=E2=80=99 from a Home configuratio= n). >>> >>> These patches fiddle with =E2=80=98PS1=E2=80=99. The most visible effe= ct is that >>> Guix Home=E2=80=99s ~/.bashrc will no longer provide a default =E2=80= =98PS1=E2=80=99. >>> >>> Thoughts? >> >> Factorization of bashrc is great! >> >> Not sure about moving PS1 to /etc/bashrc as it won't work on foreign >> distros and guix environment won't be noticable in the prompt. Warning >> is useful, but I would expect prompt work OOB, when guix-defualts? is >> #t. > > Yes, you=E2=80=99re right. > >> The possible alternative solution is to factorize bash_profile and put >> PS1 here, so both skeleton and home provided bashrc have it, after that >> setting PS1 with environment-variables field will start working. > > How about this: > > diff --git a/gnu/home/services/shells.scm b/gnu/home/services/shells.scm > index d7dd579293..8d7db6b774 100644 > --- a/gnu/home/services/shells.scm > +++ b/gnu/home/services/shells.scm > @@ -407,6 +407,9 @@ (define* (file-if-not-empty field #:optional (extra-c= ontent #f)) > # Honor per-interactive-shell startup file > if [ -f ~/.bashrc ]; then source ~/.bashrc; fi > " > + (if (home-bash-configuration-guix-defaults? config) > + "export PS1=3D...\n" Yep, something like that should work. Ideally, is to make %default-bash-profile or even more generic %default-profile and reuse it across system and home, but it may be not that trivial, so we can postpone it for now. > + "") > (serialize-field 'bash-profile) > (serialize-field 'environment-variables))) >=20=20 > > That way, if one adds =E2=80=98PS1=E2=80=99 to =E2=80=98environment-varia= bles=E2=80=99, that will > override the default. > > WDYT? > > Thanks for your feedback! > > Ludo=E2=80=99. =2D-=20 Best regards, Andrew Tropin --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmO1FfIACgkQIgjSCVjB 3rCe/Q//a02e7/c43v864oZlCxfIs/u8NaFhyXjUM/rGR3RcNu99FkhXLDv69MDT vHWqKUTRhF0E79Qfe2JqNMqxvaAP9NfWorX3oRbjRIWaICXHxN6kEjW/0C2gexox XAVaFnPyh2G8UrI5rbMOxr74DYovsCXGv1KbAmTWvXZ53QNbkWR7EDIduf8dhF2W HmdYVqDHP/Xx6BLKEQuj06lQQ8mQxgkKaCGkBDtGTDIQsanaPMad/jIbMh3k3WFR eGkGKHoDQqGtsLyNknqeIFasHKlMQ2ojibtiw0puZMAcc38aRUH2Jf1C/NXnWwOX CmnxxYiv72S9vhnFsyzEONc8/ciILey79iOEwQFqt4llzjW/JISzHm0PRqQxBy7U xd8kkQ6vrOxB8LenAJG3Gl0G95NMXeK/KaKpisy1+2e0c11ALRN8LCvhJzqCIYPv ap1LDfkeujRPKmKeXSevrpPK5wKmdXWR0YOoIcgabu6dUuv4jO2gyPce4+eze45a bXVzcuctebkitadR/QMd5fVXLWXookA300R5SIZ3m8w4UgysqESXVw5yfMp/uSh0 MhZcuUllyFmlR9zhS27++vkF84ZsxKpcbR1nefFDJDxLqTW6cTwo9MOexDLb81Dr mSzNRSvl1iMw6V2CF1vhf48sNDQ0/FS0VbNBVv0BmOaD+nFSnz8= =OWJ6 -----END PGP SIGNATURE----- --=-=-=--