From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id uKKtGqd7DWYp/wAAe85BDQ:P1 (envelope-from ) for ; Wed, 03 Apr 2024 17:54:15 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id uKKtGqd7DWYp/wAAe85BDQ (envelope-from ) for ; Wed, 03 Apr 2024 17:54:15 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=none ("invalid DKIM record") header.d=freakingpenguin.com header.s=x header.b=DbYtT2+b; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-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=1712159655; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:list-id:list-help:list-unsubscribe:list-subscribe: list-post:dkim-signature; bh=Wo3jyr2DM5vomixL4DsNZEe+yhZkWMvkIuvrIJEri9w=; b=X09hjEQVoVAaJvd0ItujH5syrgfGZgJphvcoj6PnCtEpGyQ0RnF0ViOtA1NGPFJPfQprQ2 oGZ2kbW37EGmaZQevFQP0J8R+SNgSo6Rts9YK4IeOJTpCeRz0t8ThUyeMwtL6isHoeD+X0 GnQwpaTW7Zd+65D4SRdfcHB7e4hRAgu2f5c02CpeWolr3Csc3+Z1oEATUCFjgqfhvDcd5A 2WzRFnrCjiXwykNlh2uWG9+5uM5Kx/yA6n8dYTnt+e8jzXLy1QeeflGXhei79gYRMcamsg 588mnKK36fA49D8M9cKy7K/ycyla/6NHqlTRIo3cexJIx+9/Fhd5HUJ60pFB6Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1712159655; a=rsa-sha256; cv=none; b=Uws1Aexz6F/zrrQQbvBKOAdkhYh8Wi52ug8zPGjs+g77BFZ4+xaZchcl2LvvKxgJEtSHrV fUFnc3e8X5r53GTMv/lDZkI6tLyKvGb2iTjqiqLiyuehdyRykUK7OFG0wXA3F8ek4tnrpT YOdvDyQBFjFdgv+jNl0BR19xPtk1NmELCziBX/QqmZXPLbYgr5772XowiRJT5szZa+dW1b X+a35mfAiv2TdrWIZ4EXXf26UtNVj2FkrhCFZt5qwrVDDkf0Q4RDUICjy0E9DadkI2JvXE ezZUoGMejs0xOn74361oLmBCUmtqN05kfXrgSaJ2iSSZO1Alu7qPIM1cgTZSNA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none ("invalid DKIM record") header.d=freakingpenguin.com header.s=x header.b=DbYtT2+b; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=none 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 DECC961CBD for ; Wed, 3 Apr 2024 17:54:14 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rs2w5-0005Ho-NW; Wed, 03 Apr 2024 11:54:02 -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 1rs2w3-0005Hc-O3 for bug-guix@gnu.org; Wed, 03 Apr 2024 11:53:59 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rs2w3-0004Pe-F8 for bug-guix@gnu.org; Wed, 03 Apr 2024 11:53:59 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rs2w7-00077D-L6 for bug-guix@gnu.org; Wed, 03 Apr 2024 11:54:03 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#70164: home-bash-service default PS1 overwrites .bashrc PS1 in login shells Resent-From: Richard Sent Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Wed, 03 Apr 2024 15:54:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 70164 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 70164@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.171215960327107 (code B ref -1); Wed, 03 Apr 2024 15:54:03 +0000 Received: (at submit) by debbugs.gnu.org; 3 Apr 2024 15:53:23 +0000 Received: from localhost ([127.0.0.1]:59377 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rs2vT-000739-BG for submit@debbugs.gnu.org; Wed, 03 Apr 2024 11:53:23 -0400 Received: from lists.gnu.org ([2001:470:142::17]:56160) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rs2vN-00071t-LY for submit@debbugs.gnu.org; Wed, 03 Apr 2024 11:53:21 -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 1rs2vC-0004zC-Dm for bug-guix@gnu.org; Wed, 03 Apr 2024 11:53:06 -0400 Received: from mail-108-mta57.mxroute.com ([136.175.108.57]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rs2v9-0004FF-VA for bug-guix@gnu.org; Wed, 03 Apr 2024 11:53:06 -0400 Received: from filter006.mxroute.com ([136.175.111.2] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta57.mxroute.com (ZoneMTA) with ESMTPSA id 18ea4a9d36f0003bea.001 for (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Wed, 03 Apr 2024 15:52:56 +0000 X-Zone-Loop: 7ce23d45b14c6cd1e0be5663a205947067f132484951 X-Originating-IP: [136.175.111.2] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=freakingpenguin.com; s=x; h=Content-Type:MIME-Version:Message-ID:Date: Subject:To:From:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Wo3jyr2DM5vomixL4DsNZEe+yhZkWMvkIuvrIJEri9w=; b=DbYtT2+bu5e58+LLEzazhv7YlE uWGrFNe8jdXm8tHz+341YalXSmZjGh28/E4mQsIKxNQKTQKXbmuvAZYe1nwD23btYcilEElOW0W4x IuxD7FPMi4NkW9cgsMgv72ag7426DJjOAQVjtPxPUaesUqgBs0ueU7f54nd9lOQsdxmKtR4YLP5Zq wPRxbDUQfzlw2VylRv67bP0AX4cp4JjAcwlnLPbFlNiUO6W9hMEm7Qvk4AWa5I6QIFiESXrLZ+2pj pM7oq2d6x+ayLyzAHoMveqaZ7q4JeHzkfrWufcsBnwJ42mDjK1D3EnPKwfkaf7RSbzMlnz/47iveD EnXoghjw==; From: Richard Sent Date: Wed, 03 Apr 2024 11:52:47 -0400 Message-ID: <87r0fmmoj4.fsf@freakingpenguin.com> MIME-Version: 1.0 Content-Type: text/plain X-Authenticated-Id: richard@freakingpenguin.com Received-SPF: pass client-ip=136.175.108.57; envelope-from=richard@freakingpenguin.com; helo=mail-108-mta57.mxroute.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -4.11 X-Spam-Score: -4.11 X-Migadu-Queue-Id: DECC961CBD X-Migadu-Scanner: mx12.migadu.com X-TUID: LVUL7Zw2JHxx Hi Guix! A common convention for where to set PS1 is in .bashrc, not .bash_profile [1-3]. Unfortunately home-bash-service doesn't support this convention for login shells. home-bash-service generates a default .bash_profile that follows these steps: 1. Source .profile 2. Source .bashrc 3. Set PS1 if guix-defaults? is truthy This means that any PS1 configuration in .bashrc is overwritten by .bash_profile for login shells specifically. This is visible in a TTY, but also in WSL, which defaults to opening a login shell. PS1 will be Guix's predefined value instead of the value set in .bashrc. Setting guix-defaults? to #f has many side effects, so I don't feel that is a valid solution. A comment in home/serivces/shells.scm suggests setting PS1 via environment-variables since that is appended to the end of .bash_profile. This is fine for simple prompts, but complicated prompts are often split apart into separate bash functions and variables. Either an implicit dependency between .bashrc and .bash_profile is created, or .bash_profile balloons into a mega-file while the conventional wisdom is to keep it as simple as possible. environment-variables also exports PS1, causing it to become an environment variable, not a shell variable. This might cause some odd behavior when subprocesses inherit it. [4] Some possible solutions: 1. Move default PS1 to bashrc, right after serializing %default-bashrc 2. Keep default PS1 in .bash_profile, but before loading .bashrc 3. Add a set-prompt? field to home-bash-configuration Of the 3, I think 1 is the best and plan to submit a patch for it soon. I'm opening the bug in case anyone thinks I missed something. [1] https://unix.stackexchange.com/a/549075 [2] https://superuser.com/a/789465 [3] https://superuser.com/a/789454 [4] https://unix.stackexchange.com/a/44000 -- Take it easy, Richard Sent Making my computer weirder one commit at a time.