Repository: jesseduffield/lazygit (language: go)

Issue:
Lazgit does not work well with terminal based pinetry programs
**Describe the bug**
The issue is that `lazygit` starts behaving weird when it tries to use a pinentry program that is terminal based. It ends up breaking the program completely.



**To Reproduce**
Steps to reproduce the behavior:

1. Make sure the pinentry program for SSH or GPG is set to `pinentry-curses` or `pinentry-tty`.
2. Trigger the pinentry program by trying to push to a repo that is cloned with an SSH URL.

**Expected behavior**
The pinentry program should take focus of the program

**Screenshots**

![image](https://github.com/jesseduffield/lazygit/assets/10750027/38c9d95e-2ee4-4cda-9588-59a023728e3d)

**Version info:**
`commit=, build date=, build source=nix, version=0.40.2, os=linux, arch=amd64, git version=2.43.0
`
`git version 2.43.0`


Discussion / hints:
in my case, this bug only appear if I have 
```yaml
# ~/.config/lazygit/config.yml
git:
  overrideGpg: true
```
when I checked the code, it will trigger this `runAndStream` function and probably the issue is coming from there?
https://github.com/jesseduffield/lazygit/blob/master/pkg/gui/controllers/helpers/gpg_helper.go#L40

if I disable that config, it works just fine, but I still need `overrideGpg` so I can reword commit or patch it later

hope this information helps, thanks!
Okay so wait? setting it to `false` lets me use pinentry-curses when I create commits! Unfortunately, it does work when pushing to the repo. Probably because it's technically coming through ssh? Any recommendations for dealing with SSH

Fix patch:
diff --git a/pkg/commands/oscommands/cmd_obj_runner.go b/pkg/commands/oscommands/cmd_obj_runner.go
index 23ec47070b3..296850e3238 100644
--- a/pkg/commands/oscommands/cmd_obj_runner.go
+++ b/pkg/commands/oscommands/cmd_obj_runner.go
@@ -220,9 +220,6 @@ func (self *cmdObjRunner) runAndStreamAux(
 	cmdObj ICmdObj,
 	onRun func(*cmdHandler, io.Writer),
 ) error {
-	// if we're streaming this we don't want any fancy terminal stuff
-	cmdObj.AddEnvVars("TERM=dumb")
-
 	cmdWriter := self.guiIO.newCmdWriterFn()
 
 	if cmdObj.ShouldLog() {


Test patch: