0

I used this script to set my Git Bash to start in the same folder no matter where I start it. However, I would like to not run this script on startup; i.e. revert to what happened on startup before I used this script.

The code that I used from this answer:

cd C:\specific\dir\to\open && start "" "C:\Program Files\Git\bin\sh.exe"
%let gwd = C:\specific\dir\to\open;
%sysexec(cd &gwd. && start "" "C:\Program Files\Git\bin\sh.exe" && exit);

Note: I am running this on Windows 10.


How to reproduce:

  1. Open Git Bash
  2. Run that line
  3. Close and reopen it.

I would like to prevent this line from running on startup. However, I do not know how to do that. Is there any way I can edit what runs on startup?

VFDan
  • 53
  • 9
  • 3
    include the relevant parts of "this answer" in your question. – somebadhat May 04 '20 at 00:07
  • @somebadhat added – VFDan May 05 '20 at 23:12
  • 1
    In your comment in the other question, you state that you seek specific context menu behavior. I'm confused why you're running the `cd` command at all. On Windows 10 with Git for Windows 2.20.1, the default behavior of the context menu option "Git Bash Here" is to open a MinGW session *in the folder the context menu was initiated from.* That sounds like what you want. Removing the script you're calling, using just the Git Bash defaults, is that not the behavior you see? – Lorem Ipsum May 06 '20 at 17:17
  • Maybe it's related to how you installed it? https://stackoverflow.com/a/50667280/5065796 – Lorem Ipsum May 06 '20 at 17:18
  • @LoremIpsum My question is *how* do I remove the script I'm calling? – VFDan May 07 '20 at 17:02
  • 1
    Can you please update your question with more detail? The linked answer modifies the git bash start directory on-the-fly at run-time as part of a larger SAS program. Deleting the line, from the program or DMKEYS, would remove the behavior. Your situation sounds different. Basically, guide us, as best you can, so that we could reproduce the problem on our end. – Lorem Ipsum May 09 '20 at 04:34
  • @LoremIpsum I believe I have added enough information. If you would like more, please say so. – VFDan May 09 '20 at 21:16

1 Answers1

1

Did you check your .bashrc? You might have a cd in there somewhere.

AbyxDev
  • 175
  • 6