From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id GMUJLbiwtGMAJAEAbAwnHQ (envelope-from ) for ; Tue, 03 Jan 2023 23:48:24 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id MIz9LLiwtGOH+wAAauVa8A (envelope-from ) for ; Tue, 03 Jan 2023 23:48:24 +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 3C646D253 for ; Tue, 3 Jan 2023 23:48:24 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pCq4i-0001y6-7w; Tue, 03 Jan 2023 17:48:04 -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 1pCq4g-0001xo-I4 for guix-patches@gnu.org; Tue, 03 Jan 2023 17:48:02 -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 1pCq4g-0002t1-9M for guix-patches@gnu.org; Tue, 03 Jan 2023 17:48:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pCq4g-0004fX-2c for guix-patches@gnu.org; Tue, 03 Jan 2023 17:48:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#60365] [PATCH 0/4] Rationalize 'PS1' handling in home, system, and shell Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 03 Jan 2023 22:48: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: Andrew Tropin Cc: 60365@debbugs.gnu.org Received: via spool by 60365-submit@debbugs.gnu.org id=B60365.167278602517740 (code B ref 60365); Tue, 03 Jan 2023 22:48:02 +0000 Received: (at 60365) by debbugs.gnu.org; 3 Jan 2023 22:47:05 +0000 Received: from localhost ([127.0.0.1]:47037 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pCq3l-0004c4-Gx for submit@debbugs.gnu.org; Tue, 03 Jan 2023 17:47:05 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35176) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pCq3j-0004b9-05 for 60365@debbugs.gnu.org; Tue, 03 Jan 2023 17:47:04 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pCq3d-0002lC-IC; Tue, 03 Jan 2023 17:46:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=hWlmL8DdtWYtUrdJeGPBS4d00bfXIELki8q5/CdRgiI=; b=ZD6w05YVpkxj9Ugre0IX 0dr+EPcfwcdGGevJ/fC0olDqf1vKjQHRC8SvHkaBpWbMOS/r5Xco67daf7y9mevvjJlgXcYUeJub9 2WBF6Y8cDXQGO+UIW1TI99PLHOJvYtZwO0TmRO4/gHIP7KR1NtOSRPJlk6K0rB59B/7tNTKrK6mvw e2eX148LQPzQWUJjd0EFFNQ909wjopDok74V+1yycc6fMuFf0+Juc4VRVwYzVXh5WKREl/r5qwR1R tkLOyUjAIGlSOKgE4hQol8mF1e7bnhan8+xXY8vi/ryZRzmvBMBgUDWSry4VgCxdfrlFn5wZ24w8l JcNK5QOsX0F0nQ==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pCq3b-0006Xt-SM; Tue, 03 Jan 2023 17:46:57 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20221227212342.17939-1-ludo@gnu.org> <87v8lwf0vc.fsf@trop.in> Date: Tue, 03 Jan 2023 23:46:53 +0100 In-Reply-To: <87v8lwf0vc.fsf@trop.in> (Andrew Tropin's message of "Wed, 28 Dec 2022 11:23:03 +0400") Message-ID: <878rij6xsy.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" 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=1672786104; a=rsa-sha256; cv=none; b=acDRgJisKOVENLa9kcHJ+iaQcQ3/rRMhvYnyPZqjgG4qRkoVD2g9+m/ax85bdlDUDM9A/N Jr5IKayggId8RHln8NM+o9stdfKlfJ4MdzKOQPmybzT5vo4oMJUsy7E/jE5WG2VMgFHsiQ 7QMM+ujBJzWVzuf3UBRQoACFAOUOYXS2uqts7NIpvAKpje0eGub0YAc9JtIoXb8gsyJo5J jVzskUs2jUgH6o5RAKmeiKFuijn4FwX9egZnZN+pNOjBAQH4DqItfdjaaXCjrXtms6v+Ai RAmexz/v1qGHkjMIWwAOGPRpJ5j9aH+gm9awnXA2FOUMY6tOWtDxbjxhskY6tA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=ZD6w05YV; 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=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1672786104; 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=hWlmL8DdtWYtUrdJeGPBS4d00bfXIELki8q5/CdRgiI=; b=mvZdN0DnFZgAfgnKx+gfQRfelfs7SktIx/H+Rjs0qiE8RlISc2rnvHsKhDelcHMEAB5i06 I9Ca4F0GNGJQrKFhDsTw//9iJeFlqGWx1pOA+W1pZQkZjpUPbz1aEhVsKsfXe/2rYSf0T5 y4QXsyM7mat/jf70xgvlO7e7qpb7ozDk4MVAsciIDfnD5dUVzxBUAbz7z3bCIKyxQ2ZljE TZrWSp/wddxrXvvff/QoCmIu2TctbwZHWaje+4MMgu0nGsLBn/K2q4lCeOW4phuIK+QItN vt6bcAAe5ubufZU/IburaefEqyLUvCSMSt9xvmMXUCAz1fnmmcyjauCR959yug== X-Spam-Score: -4.56 X-Migadu-Queue-Id: 3C646D253 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=ZD6w05YV; 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=pass (policy=none) header.from=gnu.org X-Migadu-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -4.56 X-TUID: SBhcMxRWET7L --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 mot= ivation was >> making it easy to change =E2=80=98PS1=E2=80=99 from a Home configuration= ). >> >> These patches fiddle with =E2=80=98PS1=E2=80=99. The most visible effec= t is that >> Guix Home=E2=80=99s ~/.bashrc will no longer provide a default =E2=80=98= PS1=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: --=-=-= Content-Type: text/x-patch Content-Disposition: inline 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-content #f)) # Honor per-interactive-shell startup file if [ -f ~/.bashrc ]; then source ~/.bashrc; fi " + (if (home-bash-configuration-guix-defaults? config) + "export PS1=...\n" + "") (serialize-field 'bash-profile) (serialize-field 'environment-variables))) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable That way, if one adds =E2=80=98PS1=E2=80=99 to =E2=80=98environment-variabl= es=E2=80=99, that will override the default. WDYT? Thanks for your feedback! Ludo=E2=80=99. --=-=-=--