8000 feat: override `PAGER` with `DDEV_PAGER` env variable, for #6842 by stasadev · Pull Request #6900 · ddev/ddev · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: override PAGER with DDEV_PAGER env variable, for #6842 #6900

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

Merged
merged 1 commit into from
Jan 15, 2025

Conversation

stasadev
Copy link
Member

The Issue

We don't have a quick and easy way to override PAGER variable in the web and db containers.

How This PR Solves The Issue

Adds an optional environment variable DDEV_PAGER.

I'm unsure where to add information about DDEV_PAGER in the docs (should we?).
The section on Environment Variables Provided is not the right place, as it covers variables inside the container, whereas DDEV_PAGER is used outside the container.

Manual Testing Instructions

ddev start
ddev exec 'echo $PAGER'
less -SFX
export DDEV_PAGER=less
ddev start
ddev exec 'echo $PAGER'
less
export DDEV_PAGER=
ddev start
ddev exec 'echo $PAGER'
<empty>
unset DDEV_PAGER
ddev start
ddev exec 'echo $PAGER'
less -SFX

Automated Testing Overview

Release/Deployment Notes

@stasadev stasadev requested a review from a team 8000 as a code owner January 15, 2025 11:30
@@ -71,7 +71,7 @@ services:
- POSTGRES_PASSWORD=db
- POSTGRES_USER=db
- POSTGRES_DB=db
- PAGER=less -SFX
- PAGER=${DDEV_PAGER-less -SFX}
Copy link
Member Author
@stasadev stasadev Jan 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is intentional syntax; the below syntax will not work for an empty string: export DDEV_PAGER=, because it will use the default less -SFX instead of an empty string:

Suggested change
- PAGER=${DDEV_PAGER-less -SFX}
- PAGER=${DDEV_PAGER:-less -SFX} # this will not work as expected

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That fix is right.

Copy link
github-actions bot commented Jan 15, 2025

@rfay
Copy link
Member
rfay commented Jan 15, 2025

I'm unsure where to add information about DDEV_PAGER in the docs (should we?).

It's a good question. We do have other things that can probably be overridden, but DDEV is usually overriding them.

Copy link
Member
@rfay rfay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works for me, and will make me happy enough. Not sure my use-case is that important.

I guess the question would be, should the default be with-pager or without-pager? I guess we can find out whether we get pushback on the default pager.

@stasadev
Copy link
Member Author

I guess the question would be, should the default be with-pager or without-pager?

Yes, let's use with-pager for now, otherwise we won't get any feedback.

@rfay
Copy link
Member
rfay commented Jan 15, 2025

You'd get feedback from @tyler36 ! :)

@rfay rfay merged commit 5ceb7b2 into ddev:main Jan 15, 2025
17 checks passed
@rfay rfay deleted the 20250115_stasadev_pager branch January 15, 2025 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0