Skip to content

Commit

Permalink
Add pager option to ~/.myclirc
Browse files Browse the repository at this point in the history
For instance `pager = 'pspg --csv'`.

Fixes dbcli#881

Signed-off-by: Ulysse Buonomo <buonomo.ulysse@gmail.com>
  • Loading branch information
BuonOmo committed Aug 22, 2022
1 parent 83b027f commit 1ae50c8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
TBD
===

Features:
---------
* Add `pager` option to `~/.myclirc`, for instance `pager = 'pspg --csv'` (Thanks: [BuonOmo])

Internal:
---------
* Pin `cryptography` to suppress `paramiko` warning, helping CI complete and presumably affecting some users.
Expand Down Expand Up @@ -890,6 +894,7 @@ Bug Fixes:

[Amjith Ramanujam]: https://blog.amjith.com
[Artem Bezsmertnyi]: https://github.com/mrdeathless
[BuonOmo]: https://github.com/BuonOmo
[Carlos Afonso]: https://github.com/afonsocarlos
[Casper Langemeijer]: https://github.com/langemeijer
[Daniel West]: http://github.com/danieljwest
Expand Down
1 change: 1 addition & 0 deletions mycli/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Contributors:
* Artem Bezsmertnyi
* bitkeen
* bjarnagin
* BuonOmo
* caitinggui
* Carlos Afonso
* Casper Langemeijer
Expand Down
5 changes: 3 additions & 2 deletions mycli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -938,8 +938,9 @@ def configure_pager(self):
os.environ['LESS'] = '-RXF'

cnf = self.read_my_cnf_files(self.cnf_files, ['pager', 'skip-pager'])
if cnf['pager']:
special.set_pager(cnf['pager'])
cnf_pager = cnf['pager'] or self.config['main']['pager']
if cnf_pager:
special.set_pager(cnf_pager)
self.explicit_pager = True
else:
self.explicit_pager = False
Expand Down
3 changes: 3 additions & 0 deletions mycli/myclirc
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ keyword_casing = auto
# disabled pager on startup
enable_pager = True

# Choose a specific pager
pager = 'less'

# Custom colors for the completion menu, toolbar, etc.
[colors]
completion-menu.completion.current = 'bg:#ffffff #000000'
Expand Down

0 comments on commit 1ae50c8

Please sign in to comment.