Re: session username in default psql prompt?

From: Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Robert Haas <robertmhaas(at)gmail(dot)com>, Kori Lane <kori(dot)lane(at)enterprisedb(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: session username in default psql prompt?
Date: 2024-03-25 08:30:14
Message-ID: CAGECzQQQtykjGBLV8OP+ZBBNT+1Ys2k8B6R8qKtYQOBXcJ1p6w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, 23 Mar 2024 at 00:34, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Prompt space is
> expensive and precious, at least for people who aren't in the
> habit of working in very wide windows.

That problem seems easy to address by adding a newline into the
default prompt. Something like this:

\set PROMPT1 '%n(at)%~%R%\n# '

I myself use:
\set PROMPT1 '%[%033[1m%]%M %n(at)%/:%>-%p%R%[%033[0m%]%\n> '

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message shveta malik 2024-03-25 08:37:21 Re: Introduce XID age and inactive timeout based replication slot invalidation
Previous Message Corey Huinker 2024-03-25 08:27:38 Re: Statistics Import and Export