You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
In my opinion the default pager is very confusing. I really like to use diff-so-fancy or something similar.
Additional context
The custom pager docs are mentioning that you are using a package which has no windows support. Could you (@jesseduffield) clarify which package this is? Maybe there is an alternative in the meantime?
Reacted by Henrik Raula, Sergey Kondrikov, Scott Bilas, Charles Chiu, aropele, chtenb, Lukas Bernwald, Lukas Bernwald, Mel Massadian, Sondre Agledahl and 21 more
Interestingly, we use creack/pty and on that repo there's a PR that appears to be almost across the line which supports conpty: creack/pty#109. So I think we can wait for that to merge and then bump the dependency and hopefully it won't take too much to hook things up (we'd need to update pkg/gui/pty_windows.go or potentially delete that file and have everything go through pkg/gui/pty.go)
Btw, as a workaround you can install WSL on Windows. Setup lazygit how you want it to be in your WSL environment. On your Windows environment go to your project and type the command wsl lazygit. That way WSL will activate lazygit on your current directory even if on Windows and the pagers will work.
The downside is though that because youre on a mounted drive it can get very slow with large/many files.
I was able to run this using a single .bat script with JScript, without relying on pwsh or sed.
Since I’m not very familiar with .bat scripting or JScript, there might be a better way to write this.
As others have already shared, it runs faster than pwsh (although I’m not sure how it performs with very large git diffs).
@if(0)==(0) echooffchcp65001setlocalset"old=%~2"set"new=%~5"set"target=%~1"set"old=%old:\=/%"set"new=%new:\=/%"
git --no-pager diff --no-index --no-ext-diff "%old%""%new%"^|cscript //nologo /u /E:JScript "%~f0""%old%""%target%"^|cscript //nologo /u /E:JScript "%~f0""%new%""%target%"^| delta --paging=never --width=%LAZYGIT_COLUMNS%endlocalgoto :EOF@end
var oldStr = WScript.Arguments(0);
var newStr = WScript.Arguments(1);
var stdin = WScript.StdIn;
var stdout = WScript.StdOut;
while (!stdin.AtEndOfStream) {
var line = stdin.ReadLine();
line = line.split(oldStr).join(newStr);
stdout.WriteLine(line);
}
I asked Claude Sonnet 4.5 to look for the most performant solution, and it ended up with this. I'm actually adapting the Perl solution.
Overview
When configuring LazyGit's externalDiffCommand on Windows, three main approaches exist for processing git diff output before piping to delta. This comparison evaluates their performance, reliability, and portability.
The Perl solution is the clear winner for standard Windows development environments with Git for Windows. It offers the best combination of performance, reliability, and robustness.
The JScript solution serves as an excellent universal fallback, trading performance for guaranteed compatibility.
The Sed solution should be avoided due to its critical handling issues with regex metacharacters in file paths, making it unreliable for real-world usage.
Reacted by sh1Nome, Oichan and Chao Cheng
acebyronehalilistartanimation commented on Jan 12, 2026
A bit of a bizarre behavior I found: if I change externalDiffCommand to a file that does not exist, lazygit runs as normal with the default pager. This leads me to believe that my issue is a problem with the bat file not being read at all by lazygit.
I'd appreciate some help bc the default pager is so uglyy
EDIT: I solved the problem by using paging instead of pagers and removing the "-" in front of externalDiffCommand
Can confirm that this issue persists in 0.61.1. Furthermore, when scrolling on the list of files the diff script runs properly but soon as I press enter it goes back to the default lazygit look for diffs
heads-up for folks watching this: there's a windows-pty branch on the repo (by @stefanhaller) adding ConPTY-based pager support, and i built + ran it on real windows 11 - native build, go 1.26.3, with delta 0.19.2 as the pager.
it works. delta renders correctly in lazygit's diff panel through ConPTY - line numbers, themed file/hunk headers, side-by-side, no leaked escape-sequence junk. for contrast i ran the exact same flow off current master and the pager's ignored entirely there (you just get raw single-column git diff --color=always), so the branch genuinely fixes this.
also: the cmd_obj_runner pty path (a custom command with output: logWithPty) kicks off through the pty with no hang, and panel switching + navigation + exit all behave normally.
one thing that looks like a bug but isn't - a stray Δ before modified filenames is just delta's default file-modified-label, reproduces with git show | delta outside lazygit.
didn't test credential prompts over the pty (my remotes are all SSH). happy to test more on windows if it's useful.
Activity
bin101 commentedon Aug 25, 2021
This package seems to be PTY, correct?
There seems to be an alternative named ConPTY for windows since 2018:
https://devblogs.microsoft.com/commandline/windows-command-line-introducing-the-windows-pseudo-console-conpty/
And also a go implementation:
https://github.com/ActiveState/termtest/tree/master/conpty
jesseduffield commentedon Sep 27, 2021
Interestingly, we use creack/pty and on that repo there's a PR that appears to be almost across the line which supports conpty: creack/pty#109. So I think we can wait for that to merge and then bump the dependency and hopefully it won't take too much to hook things up (we'd need to update
pkg/gui/pty_windows.goor potentially delete that file and have everything go throughpkg/gui/pty.go)tgmpje commentedon Jun 21, 2022
Adding a snooze so we get a ping once the PR has been merged.
@SnoozeThis creack/pty#109
SnoozeThis commentedon Jun 21, 2022
(https://snoozeth.is/WM8xZZDUIIA) I will wait until creack/pty#109 is merged and then add a comment.
EldinHb commentedon Nov 6, 2022
This PR creack/pty#155 looks a bit more lively
EldinHb commentedon Nov 7, 2022
Btw, as a workaround you can install WSL on Windows. Setup lazygit how you want it to be in your WSL environment. On your Windows environment go to your project and type the command
wsl lazygit. That way WSL will activate lazygit on your current directory even if on Windows and the pagers will work.The downside is though that because youre on a mounted drive it can get very slow with large/many files.
SnoozeThis commentedon Jan 25, 2023
An error occurred while snoozing: Pull request was closed without being merged
pidgeon777 commentedon May 22, 2023
Any update for Windows users running
lazygit?aropele commentedon May 23, 2023
Same problem here. Cannot use lazygit if delta is not supported.
jesseduffield commentedon May 23, 2023
Our hope rests on the fate of this PR: creack/pty#155
searleser97 commentedon Oct 10, 2023
+1 to this
pidgeon777 commentedon Oct 11, 2023
Hopefully this will be fixed / merged.
Kaarel commentedon Feb 15, 2024
+1
23 remaining items
tienlonghungson commentedon Nov 5, 2025
Thanks. I will let you know if I encounter any issue on Mac.
perf(diff): use .bat script rather than pwsh to improve startup time
kaarel-sm commentedon Nov 12, 2025
I can confirm that the bat script is massively more performant than pwsh #1453 (comment)
sh1Nome commentedon Nov 30, 2025
I was able to run this using a single
.batscript with JScript, without relying onpwshorsed.Since I’m not very familiar with
.batscripting or JScript, there might be a better way to write this.As others have already shared, it runs faster than
pwsh(although I’m not sure how it performs with very largegit diffs).pidgeon777 commentedon Nov 30, 2025
I asked Claude Sonnet 4.5 to look for the most performant solution, and it ended up with this. I'm actually adapting the Perl solution.
Overview
When configuring LazyGit's
externalDiffCommandon Windows, three main approaches exist for processing git diff output before piping to delta. This comparison evaluates their performance, reliability, and portability.Architecture Comparison
\Q\E)Solution Details
🥇 Perl Solution (Recommended)
Strengths:
\Q...\Eautomatically escapes regex metacharactersfile[test].txt,ver.2.0, etc.Limitations:
where perlin cmd)Best for: Production use when Git for Windows is installed (most common scenario)
🥈 JScript Solution (Universal Fallback)
Strengths:
split().join()handles special characters correctlychcp 65001ensures proper encodingLimitations:
Best for: Systems without Git for Windows, guaranteed portability, automated deployments
🥉 Sed Solution (Not Recommended)
Strengths:
Critical Issues:
project[beta]→ interpreted as character classfile.backup→ matches any character instead of literal dot(old)→ interpreted as capture group$temp→ interpreted as end-of-line anchorlazygit-edit://protocol not supported by LazyGitExample failure scenario:
Best for: Nothing - use Perl or JScript instead
Performance Benchmark
Tested with typical 50KB diff output:
Decision Matrix
Choose Perl if:
Choose JScript if:
Avoid Sed because:
Verification and Installation
Check if Perl is available:
where perlIf Perl is found → Use the Perl solution (recommended)
If Perl is not found → Use the JScript solution (universal fallback)
LazyGit Configuration:
Conclusion
The Perl solution is the clear winner for standard Windows development environments with Git for Windows. It offers the best combination of performance, reliability, and robustness.
The JScript solution serves as an excellent universal fallback, trading performance for guaranteed compatibility.
The Sed solution should be avoided due to its critical handling issues with regex metacharacters in file paths, making it unreliable for real-world usage.
acebyronehalilistartanimation commentedon Jan 12, 2026
I don't know why but I'm having trouble getting custom pagers to work.
This is my setup:
File: C:\Users\aceby\lazygit-pager.bat
File: C:\Users\aceby\AppData\Local\lazygit\config.yml
I have sed and delta installed already.
A bit of a bizarre behavior I found: if I change externalDiffCommand to a file that does not exist, lazygit runs as normal with the default pager. This leads me to believe that my issue is a problem with the bat file not being read at all by lazygit.
I'd appreciate some help bc the default pager is so uglyy
EDIT: I solved the problem by using
paginginstead ofpagersand removing the "-" in front ofexternalDiffCommandlucaspimentel commentedon Jan 14, 2026
@acebyronehalilistartanimation
Which version of lazygit are you using? Support for multiple pagers (using the
pagersarray in the configuration file) was added in v0.56.0.acebyronehalilistartanimation commentedon Jan 15, 2026
Hmm, that's bizarre. I'm using v0.58.0
leotorrez commentedon Apr 27, 2026
Can confirm that this issue persists in 0.61.1. Furthermore, when scrolling on the list of files the diff script runs properly but soon as I press enter it goes back to the default lazygit look for diffs
seanmartinsmith commentedon Jun 29, 2026
heads-up for folks watching this: there's a
windows-ptybranch on the repo (by @stefanhaller) adding ConPTY-based pager support, and i built + ran it on real windows 11 - native build, go 1.26.3, with delta 0.19.2 as the pager.it works. delta renders correctly in lazygit's diff panel through ConPTY - line numbers, themed file/hunk headers, side-by-side, no leaked escape-sequence junk. for contrast i ran the exact same flow off current master and the pager's ignored entirely there (you just get raw single-column
git diff --color=always), so the branch genuinely fixes this.also: the
cmd_obj_runnerpty path (a custom command withoutput: logWithPty) kicks off through the pty with no hang, and panel switching + navigation + exit all behave normally.one thing that looks like a bug but isn't - a stray
Δbefore modified filenames is just delta's defaultfile-modified-label, reproduces withgit show | deltaoutside lazygit.didn't test credential prompts over the pty (my remotes are all SSH). happy to test more on windows if it's useful.
stefanhaller commentedon Jun 29, 2026
@seanmartinsmith Don't use this branch yet, it's unfinished. I'll let you all know when it's ready, shouldn't take too long.
stefanhaller commentedon Jun 30, 2026
PR is here: #5740. Please test this thoroughly before I merge it.
seanmartinsmith commentedon Jul 1, 2026
will be able to test tomorrow - thank you!
Support custom pagers and passphrase prompts on Windows (#5740)