1

In vs code terminal I'm getting first letter of command twice. it's not causing any problem but it's kind of annoys me to watch the wrong command. I'm not writing any letter twice, the first letter of all commands gets repeated automatically. Here is the Screenshot of terminal

as you can see there are 2 commands first one ppython first p automatically got repeated even though i wrote python it makes it ppython. and the first p that got repeated won't delete from there even if i spam backspace so many time . the I tried to clear the command till first p and as I'm not able to remove first p from terminal I just wrote ython in front of it. it looks proper now python. but I got a error response as ython is not recognized command. this same happens with other commands too like cd converts to ccd.

Edit : I Re-installed vs code then but that didn't resolved my problem, when I installed it again all my extensions were there already installed then I deleted vs code again then went to the vs code's location there was a folder name .vscode I deleted that then installed vs code again now all the extensions were deleted from vs code but I'm still having the main problem . that doesn't resolved it. and I'm not getting that error while using other terminals like git bash and I'm getting this error only when I open python file's folder not when I open a react app folder or normal js or other language.

I also tried reseting the default setting from setting.json file as one of the answers suggested but that doesn't worked.

UNRIVALLEDKING
  • 265
  • 3
  • 15
  • Could you try to disable installed modules to find the root cause? – Frederic Chang Jul 20 '22 at 06:22
  • could you try to open a slightly older python interpreter as in this case https://stackoverflow.com/questions/59717953/error-spawn-enotdir-when-selecting-python-interpreter-in-vs-code/59717954#59717954 – Avin Mathew Jul 20 '22 at 07:45
  • @AvinMathew I tried that but it didn't changed anything – UNRIVALLEDKING Jul 21 '22 at 07:12
  • @FredericChang You mean, I should delete python? and install again? I'm not having this problem with other language/Module like node and C only in python! – UNRIVALLEDKING Jul 21 '22 at 07:14
  • @FredericChang I am just saying change the version of the interpreter you are using – Avin Mathew Jul 21 '22 at 07:32
  • I'm using Python 3.10.5 which one should I change to??? I've been using this since 4 to 5 months but this problem started a week ago – UNRIVALLEDKING Jul 21 '22 at 09:54
  • Don't bother replacing python, the problem is in the terminal before python is even started – AlexApps99 Jul 24 '22 at 22:13
  • Can you reproduce if you disable all your extensions? Try to narrow down the extension causing this, if it stops happening without the extensions enabled. – AlexApps99 Jul 24 '22 at 22:15
  • Sounds like a terminal problem, can you disable (all) your terminal config files and shell config files and try again? Is something executing when you open Python file's folder? – Aeronautix Jul 27 '22 at 03:40
  • where can I find terminal config files? also check the question I edited it maybe that will let you know more detail about the issue – UNRIVALLEDKING Jul 27 '22 at 07:41
  • Try temporarily moving these files (if they exist) away to the Desktop: `~/.bashrc`, `~/.bash_profile`, `~/.profile`. This can also happen if you have similar such files, so look for anything else in your home directory, like `~/.zshrc`, etc. If this doesn't work, temporarily move away your terminal config file(s): https://stackoverflow.com/questions/63101571/where-is-the-windows-terminal-settings-location , and if this doesn't work, look for any more suspicious terminal-related executables. Note that this is all outside of VSCode. – Aeronautix Jul 27 '22 at 17:02

2 Answers2

1

It's hard to answer this without knowing your configuration. What plugins have you installed? Try disabling those related to the terminal emulator one by one to see if they're causing any issues.

In doing this, you would naturally restart the terminal emulator as well. If the problem persists, check if you get this erroneous doubling on a terminal emulator outside of VS Code (Terminal or PowerShell).

If nothing works, try reinstalling the interpreter and also VS Code. Especially the latter, if this seems to affect only the terminal emulator within VS Code.

Nathan Davis
  • 101
  • 2
  • I Re-installed vs code then but that didn't resolved my problem, when i installed it again all my extensions were there already installed then i deleted vs code again then went to the vs code's location there was a folder name `.vscode` i deleted that then i installed vs code again now all the extensions were deleted from vs code but I'm still having the main problem . that doesn't resolved it. and I'm not getting that error while using other terminals like git bash and I'm getting this error only when i open python file's folder not when i open a react app folder or normal js or other lang. – UNRIVALLEDKING Jul 26 '22 at 16:04
  • If this doesn't affect any other terminal emulators, find out if it happens: (1) when running something else in VS Code's terminal, and (2) when you run the Python interpreter on a terminal emulator you have no issues with - like bash that you mention. (Apologies for the super late response) – Nathan Davis Aug 06 '22 at 21:45
0

It's really hard to answer your question without knowing your vs code configuration setting.

The easiest way is you can reset your vs code to default

The Steps

  1. Go to View > Command Palette or press Cmd + Shift + P (macOS) or Ctrl + Shift + P (Windows).

  2. Search for open settings json and select Preferences: Open Settings (JSON) which show ups from the result list.

  3. If you’ve been working with VS Code for a while and installed a lot of things and made a lot of changes, you’ll find there’s a lot of stuff in this file:

Delete everything inside the root braces and save the file

  1. Relaunch your VS Code.

  2. (This step is optional) In case you want to not only reset VS Code but also remove all installed extensions:

Delete the ~/.vscode/extensions folder if you’re on a Mac. Delete the %USERPROFILE%.vscode\extensions folder if you’re using Windows.