Repository: lint-staged/lint-staged (language: javascript)

Issue:
Verbose output on windows
### Description

I just added lint-staged to my project and it works fine. However, the output seems to be quite verbose and not nicely formatted as I saw it in examples.

### Steps to reproduce

Configure minimal example and make a commit to trigger the hook.

Output:
```
$ git commit -m "fix misconfiguration"
yarn run v1.22.19
$ C:\Users\myuser\Dev\TypeScript\Project\node_modules\.bin\lint-staged
[STARTED] Preparing lint-staged...
[SUCCESS] Preparing lint-staged...
[STARTED] Running tasks for staged files...
[STARTED] package.json — 1 file
[STARTED] *.{js,jsx,ts,tsx} — 0 files
[STARTED] *.{scss,css,json} — 1 file
[SKIPPED] *.{js,jsx,ts,tsx} — no files
[STARTED] prettier --write
[SUCCESS] prettier --write
[SUCCESS] *.{scss,css,json} — 1 file
[SUCCESS] package.json — 1 file
[SUCCESS] Running tasks for staged files...
[STARTED] Applying modifications from tasks...
[SUCCESS] Applying modifications from tasks...
[STARTED] Cleaning up temporary files...
[SUCCESS] Cleaning up temporary files...
Done in 0.82s.
[feature/add-pre-commit-hooks f0455cd] fix misconfiguration
 1 file changed, 2 insertions(+), 2 deletions(-)
```

Wanted: 
Something in the style of this:
![image](https://user-images.githubusercontent.com/42775578/226049145-cfb0124f-b357-4815-bdb5-c76f708729d6.png)

### Environment

<!-- Tell us about your development environment -->
- **OS:**  Windows 11
- **`lint-staged`:** 13.2.0
- **Terminal:** git bash



Discussion / hints:
yeah same for me, it was prettier in previous versions
same issues
Lint-staged relies on Listr2 to determine how the log should look like. You can play around with this file to see if you manage to make it look nicer, unfortunately I don't have a Windows machine myself to debug: https://github.com/lint-staged/lint-staged/blob/master/lib/getRenderer.js

EDIT: For example, forcing `renderer: 'update'` might work; if that's the case there's probably something wrong with the automatic detection.
> Lint-staged relies on Listr2 to determine how the log should look like. You can play around with this file to see if you manage to make it look nicer, unfortunately I don't have a Windows machine myself to debug: https://github.com/lint-staged/lint-staged/blob/master/lib/getRenderer.js
> 
> EDIT: For example, forcing `renderer: 'update'` might work; if that's the case there's probably something wrong with the automatic detection.

@iiroj Thank you. I will have a try later.

what i want to attach, is that:
1. run `lint-staged` directly, it was normal:
![image](https://github.com/lint-staged/lint-staged/assets/41122242/9b603364-2551-4a35-a551-41c030e225e3)

2. run `lint-staged` in Git Hooks, it was in `verbose` mode.
![image](https://github.com/lint-staged/lint-staged/assets/41122242/925dbf06-2f8e-4317-a71f-f7b4c33e68ca)

This is probably related to the issue described in our FAQ: https://github.com/lint-staged/lint-staged?tab=readme-ov-file#the-output-of-commit-hook-looks-weird-no-colors-duplicate-lines-
> This is probably related to the issue described in our FAQ: https://github.com/lint-staged/lint-staged?tab=readme-ov-file#the-output-of-commit-hook-looks-weird-no-colors-duplicate-lines-

No, git version is 2.43.
```
git -v                                                                                               16:52:13  
git version 2.43.0.windows.1
```

So it should report to git team?
Does this help? If so, I can add it directly to the README: https://github.com/typicode/husky/issues/968#issuecomment-1540068836

EDIT: That is, adding this to your husky script before `npx lint-staged`

```shell
# If tty is available, apply fix from https://github.com/typicode/husky/issues/968#issuecomment-1176848345
if sh -c ": >/dev/tty" >/dev/null 2>/dev/null; then exec >/dev/tty 2>&1; fi
```
> Does this help? If so, I can add it directly to the README: [typicode/husky#968 (comment)](https://github.com/typicode/husky/issues/968#issuecomment-1540068836)
> 
> EDIT: That is, adding this to your husky script before `npx lint-staged`
> 
> ```shell
> # If tty is available, apply fix from https://github.com/typicode/husky/issues/968#issuecomment-1176848345
> if sh -c ": >/dev/tty" >/dev/null 2>/dev/null; then exec >/dev/tty 2>&1; fi
> ```
![image](https://github.com/lint-staged/lint-staged/assets/41122242/2bf1b345-1241-4f80-9b8a-7d9a4ce31fe7)

Yes, after add this line to huksy, it work as expect. Thanks you.

Fix patch:
diff --git a/.changeset/giant-starfishes-vanish.md b/.changeset/giant-starfishes-vanish.md
new file mode 100644
index 000000000..a845151cc
--- /dev/null
+++ b/.changeset/giant-starfishes-vanish.md
@@ -0,0 +1,2 @@
+---
+---
diff --git a/README.md b/README.md
index e86332656..d9aa33dc3 100644
--- a/README.md
+++ b/README.md
@@ -644,7 +644,7 @@ module.exports = {
 
 ## Frequently Asked Questions
 
-### The output of commit hook looks weird (no colors, duplicate lines, …)
+### The output of commit hook looks weird (no colors, duplicate lines, verbose output on Windows, …)
 
 <details>
   <summary>Click to expand</summary>
@@ -660,6 +660,21 @@ https://raw.githubusercontent.com/git/git/master/Documentation/RelNotes/2.37.0.t
 >   hook, which was noticed post release. This is getting corrected.
 >   (merge [a082345372](https://github.com/git/git/commit/a082345372) ab/hooks-regression-fix later to maint).
 
+If updating Git doesn't help, you can try to manually redirect the output in your Git hook; for example:
+
+```shell
+# .husky/pre-commit
+
+#!/usr/bin/env sh
+. "$(dirname -- "$0")/_/husky.sh"
+
+if sh -c ": >/dev/tty" >/dev/null 2>/dev/null; then exec >/dev/tty 2>&1; fi
+
+npx lint-staged
+```
+
+Source: https://github.com/typicode/husky/issues/968#issuecomment-1176848345
+
 </details>
 
 ### Can I use `lint-staged` via node?


Test patch: