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

🐛 PAGER environment variable is not read on Windows #1974

Open
jennings opened this issue Mar 14, 2025 · 1 comment
Open

🐛 PAGER environment variable is not read on Windows #1974

jennings opened this issue Mar 14, 2025 · 1 comment

Comments

@jennings
Copy link

jennings commented Mar 14, 2025

I upgraded delta on Windows (from 0.15.1) and my pager stopped running. I found that it does not honor the PAGER environment variable, but it does honor DELTA_PAGER, as well as the --pager command line argument.

> delta --version
delta 0.18.2

# The PAGER environment variable is set, and includes double-quotes in the value
> $env:PAGER
"C:\Program Files\Git\usr\bin\less.exe"

# DELTA_PAGER is not set
> $env:DELTA_PAGER

# Pager does not launch, Process Monitor shows that it didn't even attempt
# to launch less
> echo "hi" | delta --paging always

All of the following will launch the pager:

# Using --pager
> echo "hi" | delta --paging always --pager '"C:\Program Files\Git\usr\bin\less.exe"'

# Setting `delta.pager` in ~/.gitconfig (Not sure how to show this from
# a command, because I need the ' and " to both appear in the config file
# and quotes are hard to get right on Windows)

# Setting DELTA_PAGER to the current value of PAGER
> $env:DELTA_PAGER = $env:PAGER
> echo "hi" | delta --paging always

# Version 0.15.1 does launch the pager
> del Env:\DELTA_PAGER
> C:\Temp\delta.exe --version
delta 0.15.1
> echo "hi" | C:\Temp\delta.exe --paging always

Environment:

  • Windows 11
  • Terminal: Windows Terminal
  • Shell: PowerShell 7.4.7
@jennings
Copy link
Author

I thought it might be a bat issue, so I just tested with bat 0.25.0 and it launches the pager with just PAGER set, not requiring BAT_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

1 participant