Path: csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail From: Koichi Murase Newsgroups: gnu.bash.bug Subject: Re: How to use PROMPT_COMMAND(S) without breaking other scripts Date: Tue, 25 Aug 2020 00:38:22 +0900 Lines: 23 Approved: bug-bash@gnu.org Message-ID: References: <17a0ba52-32ee-b9bc-72ff-3587b2050fbd@case.edu> <0c10b76f-a7f0-1c52-77b7-4b208035956b@case.edu> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: usenet.stanford.edu 1598283520 3430 209.51.188.17 (24 Aug 2020 15:38:40 GMT) X-Complaints-To: action@cs.stanford.edu Cc: bug-bash@gnu.org To: Chester Ramey Envelope-to: bug-bash@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MzrpEkWzzQM9EF5YgvWCHPEdt5fisrBlZDIBjyR7hL8=; b=T8SGZBpB5qQbRLAzW+NxeNZhIfcYuNjkNXefma2RgM95N96aqTZizkalXpxglH3xYw CoazOOxIykpGv22ZRm8LNuoGGE8QgnEi2obdZMukC9/bAuVA21Yjzh1smnSVFQujNm+f OAW4W0ewdd5RlxBcL0nUoFX9qiNhofCtOI4F/WHuZBs/eKe4M3veHLd2Zmd7t5UIiFKh GM3hn+bIGH64ilnLOc8Y1SFZHI4qSB67gfXBvBz/wliUsRneHwh7COWz4xmHGYC9Vy3k CPbpzaCv4ABIGIdigsLirsI5TTd9JZx5tXPKvez41hWS2jShuQ5+oEdMtvkIZFN1mTRx s3uA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MzrpEkWzzQM9EF5YgvWCHPEdt5fisrBlZDIBjyR7hL8=; b=dBOQRl+Ro8LocT8OBxf7xQeeDidMXFH/6wpJ0sILlNqYicfhxPixQqDbSc8ev8tf7x r58eM1VCE3YtyTq+psqWcu5asnXqwHzI3pvcpQ++4SW3+3yhhT10XIYnS1aJeutxspKF FgWBgXrmFVH2PloXz7GXuV9bFgYKpF/VKWOWEQz2PkMpk0v4sFnvex9vl2v1RXh5w12k 6pKDB6wSPm89vEL/7BmQ131pGuPE7bWDGiQPgCArbYbAkfYe0fB8rOZzMO755SJ4HUSo WUxmeFaPfu/4WFvTUCfex22tQ9z5HDqfi+eKvh8NsoUJLqHsiw4JI2Jh0iI+CjBRMHsf qvWw== X-Gm-Message-State: AOAM533HYn7vlziyL1OPc4qqmjPdVwIsqdz1jOtezCUW4b1l95eWRKz6 hdg3Lr/maIFPsaN9+t5yp/3ZMMIkdHvG1kfppDY= X-Google-Smtp-Source: ABdhPJxqRKRjfuM7d8p5ICSkpPEG4Zw9PGRUAT4gl5VjbXdFKkPdvPrTm+2UmKGsXiQEIY684f54noOzz8RuMi3KY2s= X-Received: by 2002:a17:906:3b83:: with SMTP id u3mr6002586ejf.55.1598283514908; Mon, 24 Aug 2020 08:38:34 -0700 (PDT) In-Reply-To: <0c10b76f-a7f0-1c52-77b7-4b208035956b@case.edu> Received-SPF: pass client-ip=2a00:1450:4864:20::634; envelope-from=myoga.murase@gmail.com; helo=mail-ej1-x634.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <17a0ba52-32ee-b9bc-72ff-3587b2050fbd@case.edu> <0c10b76f-a7f0-1c52-77b7-4b208035956b@case.edu> Xref: csiph.com gnu.bash.bug:16801 2020-08-24 23:57 Chet Ramey : > There's no real good solution. I wanted a clean break between the scalar > and array versions, figuring that the distributions that populated > PROMPT_COMMAND could easily make that PROMPT_COMMANDS[0]. Thank you for your reply. OK, if there would be no better solution, I would go with the first option (to convert PROMPT_COMMAND to PROMPT_COMMANDS and append mine to PROMPT_COMMANDS) and see if something happens. > The problem there is that it interferes with the ability to use > both, as some distros might want as a transition, and result in > commands being executed twice. Now I see the points. I didn't come to the idea to set the values to both as I somehow unconsciously assumed that everyone checks the Bash version when one uses PROMPT_COMMANDS. Thank you for pointing this out. This means that I need to be careful if I would convert PROMPT_COMMAND set by others into PROMPT_COMMANDS. -- Koichi