msysgit opens git.exe at every command - windows

I installed msysgit on Windows 8.1, it works pretty well, I can do everything I want. The only problem is, everytime I type a command or even just press enter in the msysgit terminal, it opens a new git.exe window which closes shortly after.
This windows prompts some stuff which are not always the same, such as :
.git
false
false
true
f84697e
For instance.
It's pretty annoying and I can't seem to find why it does that.
What does this happens and how can I stop it ?
EDIT:
Okay I looked around a bit, and it seems that every command I type is executed in this new window (which executes git.exe in the msysgit folder)

Related

Vim on windows works weirdly when using it as git editor

When I'm using git and running any command which intends to open an editor (like git commit or git rebase -i) it opens up vim as expected in powershell but it behaves very strangely.
If i press <Ctrl + Right arrow> it erases a lot of content in the file and turns insert mode on but it should advance the cursor to the end of the next word keeping the current mode
If i open COMMIT_EDITMSG in another terminal with powershell and proceed with E (Forcing it not to use swap) it works just fine. I tried different terminal emulators like cmd and powershell terminal but it works the same (weird) way in all of them
Fixed it using neovim instead of vim
Note that it also act strangely when leaving vim, displaying the commit message poorly:
This is followed by microsoft/terminal issue 9359, and mentioned in the latest Git For Windows release 2.34: check if Git 2.34 would behave better with vim in your case.

git bash closes immediately

I start git bash and it flashes open for a second and then closes.
Please how can I fix it?
Background:
My computer is a dell laptop using Windows 8 version 6.3 (build 9600). After forking a big repo and cloning half of it onto my computer,
it was taking too long, so I closed git bash. Then I encountered the problem that it closes right away when I open it.
Title that appears in top of git bash window
/usr/bin/bash --login -i
What have I already tried, yet to no avail?
I rebooted the computer.
I uninstalled and reinstalled git bash.
I tried editing .bash-profile.
I tried running git bash from the git command and windows command prompt. Same problem occurred. But no error message appeared.
I tried deleting the big repo which I had partly cloned.
I expect git bash to stay open so I can use it.
What actually happens is that it closes immediately after opening it.
I would launch Git Bash from a command prompt. It may be writing a message to stderr that you won't see if you launch it from the Start menu.
Open a command prompt and, assuming Git is installed in the default location, enter the command
"C:\Program Files"\Git\git-bash.exe

How can I select text in git bash terminal in Windows 7 without mouse?

I am on Windows 7 and I have Git Bash at my disposal after installing Git for Windows.
I found mouse inconvenient to select-copy-paste in terminal window. What is the shortcut for text selection (like Shift+←, Shift+→ in Notepad editor)?
I have seen many irrelevant verbose replies to this question, but all, what I am looking for is just an appropriate shortcut (like Ctrl+Insert for Copy and Shift+Insert for Paste).
It is best to install a CMD enhancer like ConEmu.
From there, you can type "bash", and you will see in that Git bash session, that simple CTRL+C, Ctrl+V are enough for copy/paste.
And for selecting the text (in a ConEmu session), Shift+←, Shift+→ works too. For W7 or W10.

Run .bat file as Administrator, get old version?

This is just bizarre. I've got a .bat file that I run using Windows 7's scheduler, and I noticed after I made an update to it, that it was still acting as though it were running the old version of the .bat program.
It's easy to tell which one ran - they output to a .txt file, and the new version dumps a lot more information. So here's what happens under three scenarios:
Open a cmd window (with right-click and "Run As Administrator"). CD to the directory and execute setvispw.bat in the usual way, by typing "setvispw.bat" and hitting Enter.
Result: current version runs as expected.
Right-click setvispw.bat and "Open"
Result: current version runs as expected. But that's not good, because I'm changing another user's password and need Admin privileges.
Right-click setvispw.bat and "Run As Administrator".
Result: something else runs! It looks like it's running the version from before I made changes to the .bat just a few days ago.
So I tried something even more strange. I replaced my functional program with a dummy program... and it was running the dummy program.
Finally, I added some "pause" statements... and that's when I got the answer. Rather than discard this bit of troubleshooting, I'll use the "Answer your own darned question" feature.
It turns out the problem was that I was depending on the output to setvispw.bat to tell me what version of the program had run. Well, both the old and new versions had this line:
echo Random string is !_RndAlphaNum! > C:\pathname\curVisitorPW.txt
But my added line was like this:
echo Sending email: >> curVisitorPW.txt
When I ran from C:\pathname, either in a CMD window or without Admin privileges, it worked just fine. But when I ran with Admin privs, like it does from the Scheduler, the working directory isn't C:\pathname - it's C:\Windows\System32. I didn't see that until I added the "pause" and saw that I wasn't running where I expeted! Sure enough, there's a curVisitorPW.txt sitting there in System32.
The solution, of course, was simple - use the fully qualified pathname.
Hopefully this will come in handy if someone like me is seeing bizarre behavior in a .bat file, and starts wondering if there's some sort of caching, or admin permissions/privileges, or something else crazy. I was ready to pin it on gremlins, myself.

Cygwin terminal prompt missing

Previously, when launching the Cygwin terminal, a console will popup and the line will say:
username#PCName ~ then a blinking cursor after $.
Now a blank console appears and nothing is on the console screen but a blinking cursor...
The shortcut seem to be directing to the right path "C:\cygwin\bin\mintty.exe -i /Cygwin-Terminal.ico -" so I don't know what's going on.
How do I go about fixing this issue? Do I have to look into the Environment variables? If so what do I have to look for?
I'm running Windows XP Professional x86.
Try changing the shorcut to this:
C:\cygwin\bin\mintty /bin/env CHERE_INVOKING=1 /bin/bash -l
Since you say it starts up successfully using cmd, it could a problem starting up you mintty environment. Try going into your home directory and deleting (back it up somewhere else if you want to be able to bring it back) the .minttyrc file and then try to start up again.
If that doesn't do the trick, try to go a little bigger and do the same with the bash environment files. Back up .bashrc, .bash_profile, .bash_aliases (if you have it) and .inputrc and replace them with the default sample files that are in the /etc/skel folder, then try to restart again.

Resources