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

Change in 2.2.0 to use of "-more" in help does not work in Git Bash #71

Open
dburriss opened this issue Sep 28, 2018 · 7 comments
Open

Comments

@dburriss
Copy link

ad-help changed in 2.2.0 to use PAGER:-more which results in more command not available error when using Git Bash on Windows. Prior to this it did work.

@dburriss
Copy link
Author

dburriss commented Sep 28, 2018

Example output:

$ adr  
/usr/bin/adr-help: line 16: more: command not found

@danallford92
Copy link

Hi @dburriss, "more" is the default pager for the help output. From reading around, git bash on windows doesnt have more installed by default but does have less installed by default.

You can set the default pager to be used by setting the environment variable to ADR_PAGER.

putting export ADR_PAGER=less into your .bash_profile should fix the issue.

Hope that helps :)

@npryce
Copy link
Owner

npryce commented Oct 5, 2018

more is defined by the POSIX standard, and less is not. It’s not practical to support non-standard environments.

How about if the pager does not exist it falls back to no pager, and it’s up to the user to pipe it through whatever pager exists in their environment?

@npryce
Copy link
Owner

npryce commented Oct 8, 2018

For now, I've updated the installation instruction for Git for Windows

@Abarbz
Copy link

Abarbz commented Nov 9, 2018

For now, I've updated the installation instruction for Git for Windows

This last step could be made (much) clearer ;)

@rernst76
Copy link

rernst76 commented Jan 16, 2019

For what it's worth, I found it easier to just edit adr-help locally

from: pager="${ADR_PAGER:-${PAGER:-more}}"
to: pager="${ADR_PAGER:-${PAGER:-less}}"

This worked really well using a fresh install of git for windows 2.20.1

@fschop
Copy link

fschop commented Jan 30, 2023

Since 'less' is not POSIX compliant, and 'more' is not available in Git Bash, this might be a better workaround:
from: pager="${ADR_PAGER:-${PAGER:-more}}"
to: pager="${ADR_PAGER:-${PAGER:-cat}}"

If the user wants paging, he/she should define PAGER.

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

6 participants