From 56a168d37f4c1d8ef6280669dadca5e5ac915964 Mon Sep 17 00:00:00 2001 From: Peter Yates Date: Mon, 20 May 2024 11:26:32 +0100 Subject: [PATCH] Prevent loading of psqlrc when listing databases Users have the ability to override the way records are displayed in psql by changing the format[1] and linestyle[2] settings. These settings also affect the output of psql commands used for autocompletion, like listing databases and users - so they inadvertantly break Fish's completion. If we suppress the loading of psqlrc[3] the default settings are used instead. [1] https://www.postgresql.org/docs/current/app-psql.html#APP-PSQL-META-COMMAND-PSET-FORMAT [2] https://www.postgresql.org/docs/current/app-psql.html#APP-PSQL-META-COMMAND-PSET-LINESTYLE [3] https://www.postgresql.org/docs/current/app-psql.html#APP-PSQL-OPTION-NO-PSQLRC --- share/functions/__fish_complete_pg_database.fish | 2 +- share/functions/__fish_complete_pg_user.fish | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/share/functions/__fish_complete_pg_database.fish b/share/functions/__fish_complete_pg_database.fish index ef5030211..6a17389ea 100644 --- a/share/functions/__fish_complete_pg_database.fish +++ b/share/functions/__fish_complete_pg_database.fish @@ -1,3 +1,3 @@ function __fish_complete_pg_database - psql -AtqwlF \t 2>/dev/null | awk 'NF > 1 { print $1 }' + psql -AtqwlXF \t 2>/dev/null | awk 'NF > 1 { print $1 }' end diff --git a/share/functions/__fish_complete_pg_user.fish b/share/functions/__fish_complete_pg_user.fish index 4da50d538..4770e5c9c 100644 --- a/share/functions/__fish_complete_pg_user.fish +++ b/share/functions/__fish_complete_pg_user.fish @@ -1,3 +1,3 @@ function __fish_complete_pg_user - psql -Atqwc 'select usename from pg_user' template1 2>/dev/null + psql -AtqwXc 'select usename from pg_user' template1 2>/dev/null end