Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ivh2i-0002eW-O8 for pgsql-hackers@arkaria.postgresql.org; Sun, 26 Jan 2020 12:29:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ivh2h-0003c1-Bj for pgsql-hackers@arkaria.postgresql.org; Sun, 26 Jan 2020 12:29:31 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ivh2g-0003bs-MC for pgsql-hackers@lists.postgresql.org; Sun, 26 Jan 2020 12:29:30 +0000 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ivh2Z-0002N4-Ec for pgsql-hackers@postgresql.org; Sun, 26 Jan 2020 12:29:29 +0000 Received: by mail-wm1-x333.google.com with SMTP id g1so3911429wmh.4 for ; Sun, 26 Jan 2020 04:29:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=to:from:subject:message-id:date:user-agent:mime-version :content-language; bh=tzbX+BmQo9XP2RzOH3ApKB1pfXAePZ8AdnliMJ62jq0=; b=pPwYiUgyB4lwOPpGIasmUOBAT+0Eom6JDuBxZqFseJUUA2bKc/yu5egq3qHVqNVTyx /xRuFSm3IPCOIpWK09l5ivxA7eOMWS0tlaAGJt+fQoG/NyCdmtbSrWSHpXiZICQG+y38 wkuZ7eEkR2hq1lx48KB0OXnvnR5xT/wXCs23x3FFv2nuie8nDdtS46XBroSqtm1V5lgh XBdvV+yr/s/rNhdiiIbYjwlAy2xlz+8uKdeC23yRtRl8U6WwNinvr1mof9cmvSWJBUaC tG/MNX7Xz1KRlqKA53hnY4VHm0RQbMV25QfW8HahOAt3fMq8ASgHiTgKnBlkSbcbspCv WVJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-language; bh=tzbX+BmQo9XP2RzOH3ApKB1pfXAePZ8AdnliMJ62jq0=; b=s7XemBMiRM7BjuS9HQtKFRzz7TZqXJwDkfCxHN1gWVpChvRS04NSGUJvNiBWuMKj/I S6yF/6AatDLlI35DqHLb98gMIGRVGaU7WYhIB+fAQcs/6r5ZqI2Pxy3j/etv5KYtRWZg GVkr/xtXUyuD/jfkkO/xTGqn/1dgbXUMtzGbuM4PGYjGEzfvs555/ZAPbwmDW9CFj2Ax OO5GfsTqFzgK9nTudKLadCIy13EoMqYEeQi1oIJjgkHmZaUPNluCTBhP45H43Fodq6pm 56ZP7lD6tW3sWGJX/arxQPPqHpVoIEVn7alRtjmWpcm2qeGnsVCOZf9S1DjtuBb64sGz PNsg== X-Gm-Message-State: APjAAAWvR6f0wnLBgZ/aP1kUD4CaXYoyT65FO9xmhYE4XwypUaGydhK6 f6x5Zz8ul6aq5PEyj2GAjaYUTVdrHRrzwFI+kWwe4VUS6JgGN3KI08DiFdffgcA0JU3ELGBXwUz tc2f2+TDTQcosv+c6e3eDn2lJ/3qcPi6r1oOuVfkeVjoqcIrMEGI1x4m36KUzxERSX5jDhdmCrw 4Bb8FQ8isHwA== X-Google-Smtp-Source: APXvYqxh3mpNKqbPI6/NevxhppgpsOW1lxjnSenuxN304D5ooSCQfHLyl5SWAPwe3wXfT+Si3hTJ5A== X-Received: by 2002:a1c:6645:: with SMTP id a66mr8730347wmc.121.1580041760487; Sun, 26 Jan 2020 04:29:20 -0800 (PST) Received: from [10.8.8.3] ([185.94.189.190]) by smtp.gmail.com with ESMTPSA id f1sm14143506wmc.45.2020.01.26.04.29.18 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 26 Jan 2020 04:29:19 -0800 (PST) To: PostgreSQL-development From: Vik Fearing Subject: Add %x to PROMPT1 and PROMPT2 Message-ID: <09502c40-cfe1-bb29-10f9-4b3fa7b2bbb2@2ndquadrant.com> Date: Sun, 26 Jan 2020 13:29:16 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------B10DD8B0D5832CE0F112757B" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------B10DD8B0D5832CE0F112757B Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit I cannot ever think of a time when I don't want to know if I'm in a transaction or not (and what its state is). Every new setup I do, I add %x to the psql prompt. I think it should be part of the default prompt. Path attached. -- Vik Fearing --------------B10DD8B0D5832CE0F112757B Content-Type: text/x-patch; charset=UTF-8; name="0001-add-x-to-the-default-psql-prompt.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-add-x-to-the-default-psql-prompt.patch" From 6118b8b2ab4cfc70525666b8d57eaa351d6c2a3d Mon Sep 17 00:00:00 2001 From: Vik Fearing Date: Fri, 23 Nov 2018 22:26:18 +0100 Subject: [PATCH] add %x to the default psql prompt --- doc/src/sgml/ref/psql-ref.sgml | 2 +- src/bin/psql/settings.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml index 48b081fd58..20ba105160 100644 --- a/doc/src/sgml/ref/psql-ref.sgml +++ b/doc/src/sgml/ref/psql-ref.sgml @@ -4332,7 +4332,7 @@ testdb=> \set PROMPT1 '%[%033[1;33;40m%]%n@%/%R%[%033[0m%]%# ' To insert a percent sign into your prompt, write %%. The default prompts are - '%/%R%# ' for prompts 1 and 2, and + '%/%R%x%# ' for prompts 1 and 2, and '>> ' for prompt 3. diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h index d2a9d4836a..2b384a38a1 100644 --- a/src/bin/psql/settings.h +++ b/src/bin/psql/settings.h @@ -23,8 +23,8 @@ #define DEFAULT_EDITOR_LINENUMBER_ARG "+" #endif -#define DEFAULT_PROMPT1 "%/%R%# " -#define DEFAULT_PROMPT2 "%/%R%# " +#define DEFAULT_PROMPT1 "%/%R%x%# " +#define DEFAULT_PROMPT2 "%/%R%x%# " #define DEFAULT_PROMPT3 ">> " /* -- 2.17.1 --------------B10DD8B0D5832CE0F112757B--