srsudar / eg

Useful examples at the command line.
MIT License
1.8k stars 98 forks source link

Custom pager fails to load in script/function #94

Closed bound-variable closed 2 years ago

bound-variable commented 2 years ago

In the file ~/.config/eg, I have:

[eg-config]
pager-cmd = 'cat'

Running eg less displays relevant information and returns me to the command line.

In a zsh function, I have:

describe_app () {
    if [ "$1" != "" ]; then
        man -f $1;
        eg $1;
        tldr $1;
        cheat $1;
    fi
}

Running describe_app less displays relevant information, but when eg runs it displays in less and does not return to the command line.

scorphus commented 2 years ago

Please, make sure you have that content in ${XDG_CONFIG_HOME}/eg/egrc — which, in most cases, translates to ~/.config/eg/egrc. Here's the reference in README.

bound-variable commented 2 years ago

Please, make sure you have that content in ${XDG_CONFIG_HOME}/eg/egrc — which, in most cases, translates to ~/.config/eg/egrc. Here's the reference in README.

Yes, that's where I have it. That is,

~/.config/eg/egrc

bound-variable commented 2 years ago

User error The paging by less was being called by cheat, not eg.

srsudar commented 2 years ago

Nice. Thanks scorphus for the answer and thanks Pound-Hash for reporting just in case.