Skip to content

$HOME directory corruption in gitbash #4484

@frankcarey

Description

@frankcarey

Description

On windows using Cursor and starting a terminal with Gitbash within Cursor, something in this extension was

  1. changing my $HOME directory from /c/Users/fcarey to "C:\Users\fcarey"
  2. Corrupting my $HOME path actually be "C:\Users[Linefeed]carey"

I can't find any code in the extension here on github that's doing this explicitly, but when I uninstalled it works again and when I reinstall it, new gitbash terminals have this error once more. I don't see this error in gitbash normally (opened directly outside of Cursor.

I did sort out that \f is the linefeed character, so something is probably just reading the $USERPROFILE value and the \f in .\fcarey isn't being escaped properly. With $HOME broken, lots of things, including GIT can't find their config files and you get errors.

I don't see this issue when I start a cmd terminal from within Cursor as %HOME% doesn't exist there. I'm not sure why this extension (or perhaps something that it depends on) is even changing that environment variable in the first place?

GitLens Version

17.3.0

VS Code Version

Version: 1.2.4 (user setup)
VSCode Version: 1.99.3
Commit: a8e95743c5268be73767c46944a71f4465d05c90
Date: 2025-07-10T17:09:01.383Z
Electron: 34.5.1
Chromium: 132.0.6834.210
Node.js: 20.19.0
V8: 13.2.152.41-electron.0
OS: Windows_NT x64 10.0.26100

Git Version

git version 2.39.0.windows.2

Logs, Screenshots, Screen Captures, etc

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    triageNeeds to be looked at

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions