my terminal inserts and enters the letter "Y" after most git commands - visual-studio-code

Myself and a coworker have started experiencing an odd issue where the "Y" character is inserted and then entered after nearly every git command. (Git add. , git commit, git push etc)
I am using Visual studio and typing my commands in the terminal window.
This issue does not break any functionality, it's just weird and very hard to google.

Probably because of the new setting:
Terminal > Integrated: Auto Replies
see v1.64 Release Notes
Do you have anything in this setting: "terminal.integrated.autoReplies"?
The feature is supposed to be opt-in so it shouldn't be doing that unless you have something in that setting. Unless there is a git extension that is doing that "for you". You could look through any git extension settings you may have installed to see if they enable an auto replies feature - I don't think the built-in git extension does.
In your case if you don't have a "terminal.integrated.autoReplies" that looks like a bug to me.

Even I had this similar issue with the vscode terminal in windows. Its kinda irritating when it keeps adding that "Y" after git commands automatically. (I did not turn on the feature. This is the default behaviour)
Add this to your vscode settings.json file and it should get disabled.
"terminal.integrated.autoReplies": {
"Terminate batch job (Y/N)": null }

Related

VSCode keeps opening powershell on start even though Git Bash is set as default

I have set my integrated default terminal in VSCode as Git Bash but whenever I launch VSCode, powershell pops up instead of bash. It does not, however, change the default terminal setting but it is irritating.
I have tried removing the profile of powershell from settings but that seems to do nothing.
Why is this happening?
Make sure you upgrade to vscode v1.60.1 - there is a fix in that point release for this issue.
See Select Default Profile do not actually open gitbash. After relaunch, on startup, it just keeps open PowerShell.
The same thing was happening to me and the referred to fix in the Insiders' Build 05/14/2021 did in fact fix it for me. In the meantime, opening another terminal does always open git bash for me - but that is a pain.
This worked for me:
{
"terminal.integrated.defaultProfile.windows": "Git Bash",
"terminal.integrated.profiles.windows": {
"PowerShell": null,
"Git Bash": {
"source": "Git Bash"
},
"Windows PowerShell": null
},
"terminal.integrated.automationShell.windows": "Git Bash",
"powershell.enableProfileLoading": false,
"powershell.integratedConsole.showOnStartup": false
}
I managed to find a workaround without using the Insider's Build that may work for some of you : I removed all profiles safe for the one I want, and reinstalled VS Code. Then it somehow started using the right terminal on startup. I don't know if this works without disabling all other profiles though.
I was still having this issue, and what worked for me was:
When PowerShell opened, I reset GitBash to my default, and then killed the terminal (so there were no terminal's running).
Removed the terminal panel from view by clicking the X in the top right
Closed VSCode
When I opened my codebase again and showed the terminal, it began working.
Just did an update to version 1.60.1
and it fixed it.
From the release notes the bug was addressed and has since been merged.
Update 1.60.1: The update addresses these issues
This looks like an ongoing issue that is still not fixed in the current version (1.60.0).
This is now fixed in my current version (1.61.1).

VSCode: set terminal shell on workspaces after latest update

On VSCode, if I needed a different terminal shell on a certain workspace, I had added the following setting in the workspace file (.code-workspace):
"settings": {
"terminal.integrated.shell.windows": "path\to\the\shell.exe"
}
After the latest update (April 2021 - version 1.56) this doesn't work anymore and I get this warning:
This is deprecated, use #terminal.integrated.defaultProfile.windows# instead
If I replace the setting name with the suggested one I get:
This setting can be applied only in application user settings
How can I set a different terminal shell per workspace?
Unfortunately, here is the same issue: https://github.com/microsoft/vscode/issues/123031 from https://github.com/microsoft/vscode/issues/123133.
Issue 123133 was closed 05/05/2021 with a temporary fix, see that issue and https://github.com/microsoft/vscode/commit/006591a7cfa31b9778e712b742b6e37f4afd0ed9. Here is my Insiders Build workspace settings file after the fix:
Note the previous error message is gone. I suspect that this "fix" will be in a point release to v1.56 fairly soon rather than waiting for v1.57.
As zendu pointed out, there's an open issue about it with a temporary fix:
A temporary fix was added to re-enable workspace shell settings when "terminal.integrated.allowWorkspaceConfiguration": true is set #122104
I tried it and it seems to work (at least for now).

Vscode interfering with npm GitHub install

Today npm started to act up when I executed npm i <github repo> inside a VSCode terminal.
The action was interrupted by a VSCode popup window
"Image: The extension GitHub wants to sign in using GitHub."
I [Cancel]'ed that popup, but npm still hung.
This time two popups occurred in vscode asking me for username and password.Image: VSCode input dialogues for username and password
I [ESC][ESC]'ed out of those, but the same thing happened a second time.
I avoided that too by doing [Cancel][ESC][ESC] again.
Despite my actions to "ignore" the interruption, the GitHub library actually got installed (Hurray).
Retrying the same install in a terminal outside VSCode, did not show the same interruption.
Does anybody know how I can get rid of this annoying interference from VSCode?
It should be noted that there are no GitHub extension showing in the VSCode extension list.
Is there some internal GitHub extention in VSCode?
I already have perfectly good SSH-key credentials for GitHub that works well with npm outside VSCode. I do not see why I should spread my credentials to VSCode as well.
Regards,
Erik
VSCode 1.48.2,
Ubuntu 18.04.5 LTS
I had this problem too, and only found suggestion of setting
"github.gitAuthentication": false,
This stopped the first popup you describe, but I could still not suppress the second Git username and password dialog. I've found that to stop that, it is also necessary to set:
"git.terminalAuthentication": false,
Note: The integrated terminal will need to be exited/restarted for this to take effect.

Change to case in folders are not reflected in intellisense

When I rename folders in VSCode intellisense gets confused. Is there a way to reset intellisense?
If you run the Reload Window command from the VS Command Palette it will restart the analysis server, which will reanalyse and should fix things up.
However, this seems like a nasty bug. Would you mind running the Dart: Capture Logs command, reproducing the issue and then opening an issue on GitHub with the log (please review it for anything sensitive) and detailed steps so we can investigate?

backspace does not work git bash

The first time I used git bash, backspace was working fine. Then I installed Perl and didn't use git bash for a few days.
When I use backspace in git bash now it doesn't work correctly.
For example, trying to remove the second s and everything after it in ussers:
Now when I use the backspace this happens:
Can anyone help?
I had this same problem today after switching to mintty with a fresh version of git. In my case, it was an old .bashrc file I'd been carrying around for many years with the line export TERM=ansi. After removing that and starting a new bash, everything works again.
More generally, to debug, I was suspicious of all the dot-config stuff in my home directory--so I moved things like .bash_profile, .bashrc, .inputrc, etc. into a temporary directory where they wouldn't be read by bash. Then, I started bash and saw that it worked. I mention it because, if it isn't specifically the TERM issue I had, you might be able to debug using the same technique.
Not sure if this is the same issue.. But I ran into the same after upgrading git
This helped me.. Just enter TERM=XTERM in the bash
I got this from an issue log in github..
screenshot
Just in case people run into a capitalization issue please type TERM=xterm-256color directly into git bash and hit enter. This fixed my issue.
Right click on the menu/title bar of git bash, select options, click on terminal from the options on the left, under the 'type' dropdown, select 'xterm', then apply and save.
Now open a new git bash and it should work :D