# Fix envMode reset bug and use shell-free git spawn · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/commit/198cc58377fd87ff39b8a37464dd8cb1a77beb0b)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

Requested revision: 198cc58377fd87ff39b8a37464dd8cb1a77beb0b

Requested commit: 198cc58377fd87ff39b8a37464dd8cb1a77beb0b

Commit: 198cc58377fd87ff39b8a37464dd8cb1a77beb0b

Tree: 47ea78d543ae6d6e5a5a5e9fba17fc33dc117a86

Author: Julius Marminge

Committer: Julius Marminge

## Message

```
Fix envMode reset bug and use shell-free git spawn

- ChatView: change useEffect dependency from [activeThread] (new object
  ref every dispatch) to [activeThread?.id, activeThread?.worktreePath]
  so envMode is no longer silently reset to "local" on unrelated store
  dispatches, making the worktree code path reachable.

- git.ts: replace shell command strings (runTerminalCommand + single-quote
  escaping) with a runGit helper that spawns git directly via argv array.
  Eliminates Windows quoting issues and the command injection surface.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

```

## Parents

- [6e3726ec32bb7d93b6004fb941df20876485032f](https://git.cafe/pingdotgg/t3code/commit/6e3726ec32bb7d93b6004fb941df20876485032f?format=markdown)

[Source at this commit](https://git.cafe/pingdotgg/t3code/tree/198cc58377fd87ff39b8a37464dd8cb1a77beb0b?format=markdown)
