From 936475258d501b7b1fed1c80080eabfae8179970 Mon Sep 17 00:00:00 2001 From: Stephano Paraskeva <40718272+stephanoparaskeva@users.noreply.github.com> Date: Sat, 18 Apr 2020 06:58:13 +0100 Subject: show_bottom_toolbar - Feature to Show/Hide Toolbar (#1170) * adds ternary to decide whether bottom_toolbar is shown based on config value * runs black format * adds name to authors * modifies changelog.rst * removes change in changelog.rst * formats config * removes unused variable, adds change to changelog * changes default back to true * removed reference to var --- AUTHORS | 1 + changelog.rst | 1 + pgcli/main.py | 3 ++- pgcli/pgclirc | 5 ++++- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/AUTHORS b/AUTHORS index 18953bd8..4c2ab3f0 100644 --- a/AUTHORS +++ b/AUTHORS @@ -106,6 +106,7 @@ Contributors: * George Thomas(thegeorgeous) * Yoni Nakache(lazydba247) * Gantsev Denis + * Stephano Paraskeva Creator: -------- diff --git a/changelog.rst b/changelog.rst index 62a68b41..134f5a59 100644 --- a/changelog.rst +++ b/changelog.rst @@ -8,6 +8,7 @@ Features: * Add support for ANSI escape sequences for coloring the prompt (#1122). * Add support for partitioned tables (relkind "p"). * Add support for `pg_service.conf` files +* Add config option show_bottom_toolbar. Bug fixes: diff --git a/pgcli/main.py b/pgcli/main.py index cf21bc75..91374cb1 100644 --- a/pgcli/main.py +++ b/pgcli/main.py @@ -214,6 +214,7 @@ class PGCli(object): self.decimal_format = c["data_formats"]["decimal"] self.float_format = c["data_formats"]["float"] self.initialize_keyring() + self.show_bottom_toolbar = c["main"].as_bool("show_bottom_toolbar") self.pgspecial.pset_pager( self.config["main"].as_bool("enable_pager") and "on" or "off" @@ -810,7 +811,7 @@ class PGCli(object): reserve_space_for_menu=self.min_num_menu_lines, message=get_message, prompt_continuation=get_continuation, - bottom_toolbar=get_toolbar_tokens, + bottom_toolbar=get_toolbar_tokens if self.show_bottom_toolbar else None, complete_style=complete_style, input_processors=[ # Highlight matching brackets while editing. diff --git a/pgcli/pgclirc b/pgcli/pgclirc index 220677dd..4918606c 100644 --- a/pgcli/pgclirc +++ b/pgcli/pgclirc @@ -86,6 +86,9 @@ search_path_filter = False # Timing of sql statments and table rendering. timing = True +# Show/hide the informational toolbar with function keymap at the footer. +show_bottom_toolbar = True + # Table format. Possible values: psql, plain, simple, grid, fancy_grid, pipe, # ascii, double, github, orgtbl, rst, mediawiki, html, latex, latex_booktabs, # textile, moinmoin, jira, vertical, tsv, csv. @@ -142,7 +145,7 @@ null_string = '' # manage pager on startup enable_pager = True -# Use keyring to automatically save and load password in a secure manner +# Use keyring to automatically save and load password in a secure manner keyring = True # Custom colors for the completion menu, toolbar, etc. -- cgit v1.2.3