mycli icon indicating copy to clipboard operation
mycli copied to clipboard

How to use pspg as the pager?

Open zer09 opened this issue 4 years ago • 3 comments

I tried this on my .my.cnf

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

But mysqldump doesn't like it.

zer09 avatar Aug 31 '21 04:08 zer09

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

schmeic avatar Sep 15 '21 20:09 schmeic

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.

UrGuardian4ngel avatar Sep 16 '21 18:09 UrGuardian4ngel

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

zer09 avatar Sep 17 '21 13:09 zer09