Re: psql: fix variable existence tab completion - Mailing list pgsql-hackers

From Alexander Korotkov
Subject Re: psql: fix variable existence tab completion
Date
Msg-id CAPpHfdvQUJXYN7rx04XvaFXMwZcvYABK0o2n59=obJO=V8Mi5Q@mail.gmail.com
Whole thread Raw
In response to Re: psql: fix variable existence tab completion  (Erik Wienhold <ewie@ewie.name>)
Responses Re: psql: fix variable existence tab completion
List pgsql-hackers
On Sun, Mar 3, 2024 at 5:37 PM Erik Wienhold <ewie@ewie.name> wrote:
> On 2024-03-03 03:00 +0100, Steve Chavez wrote:
> > psql has the :{?name} syntax for testing a psql variable existence.
> >
> > But currently doing \echo :{?VERB<Tab> doesn't trigger tab completion.
> >
> > This patch fixes it. I've also included a TAP test.
>
> Thanks.  The code looks good, all tests pass, and the tab completion
> works as expected when testing manually.

A nice improvement.  I've checked why we have at all the '{' at
WORD_BREAKS and if we're going to break anything by removing that.  It
seems that '{' here from the very beginning and it comes from the
default value of rl_basic_word_break_characters [1].  It seems that
:{?name} is the only usage of '{' sign in psql.  So, removing it from
WORD_BREAKS shouldn't break anything.

I'm going to push this patch if no objections.

Links.
1. https://tiswww.case.edu/php/chet/readline/readline.html#index-rl_005fbasic_005fword_005fbreak_005fcharacters

------
Regards,
Alexander Korotkov



pgsql-hackers by date:

Previous
From: vignesh C
Date:
Subject: Re: Have pg_basebackup write "dbname" in "primary_conninfo"?
Next
From: Amul Sul
Date:
Subject: Re: Add system identifier to backup manifest