Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use pspg as the pager? #1003

Open
zer09 opened this issue Aug 31, 2021 · 3 comments
Open

How to use pspg as the pager? #1003

zer09 opened this issue Aug 31, 2021 · 3 comments

Comments

@zer09
Copy link
Contributor

zer09 commented Aug 31, 2021

I tried this on my .my.cnf

[client]
pager = pspg -X --quit-if-one-screen

But mysqldump doesn't like it.

@schmeic
Copy link

schmeic commented Sep 15, 2021

From my experience, there is no way to set the pager in .my.cnf (or any other mysql config file) that will work with all of: mysql (cli), mysldump, and mycli.
See #881 - what really needs to be done is to support this in .myclirc

What I've been doing is just manually setting it every time I start mycli like this:
> pager pspg

@UrGuardian4ngel
Copy link

I have a similar issue, and I worked around that for now using --defaults-group-suffix.

My ~/.my.cnf looks like this now:

[client]
user = lorem

[client_visidata]
pager = vd --filetype=tsv

[mysql_visidata]
silent
raw

By default, e.g. mysqldump will just see the [client] section.

In my shell, I have a wrapper script (or it could be an alias) that appends --defaults-group-suffix='_visidata':

$ mysql --defaults-group-suffix='_visidata' # ...

$ mycli --defaults-group-suffix='_visidata' # ...

That basically makes mysqli and mycli see both contents of [client] and [client_visidata] as a single merged [client] group.
And same happens for other configuration groups.

@zer09
Copy link
Contributor Author

zer09 commented Sep 17, 2021

@UrGuardian4ngel WOW! thank you, this works great. Exactly what I needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants