Showing posts with label VSCode. Show all posts
Showing posts with label VSCode. Show all posts

Tuesday, 5 August 2025

VS code remote ssh - port forwarding fail

 https://stackoverflow.com/questions/75837749/vscode-failed-to-set-up-socket-for-dynamic-port-forward-to-remote-port-connect

1. SSH Server Configuration:

AllowTcpForwarding Setting: Verify that AllowTcpForwarding is set to yes in the SSH daemon configuration file (/etc/ssh/sshd_config) on the remote server. If it's set to no or commented out, uncomment it and set it to yes.

Code


    sudo nano /etc/ssh/sshd_config

Ensure the line AllowTcpForwarding yes is present and not commented out.

Restart SSH Service: After modifying sshd_config, restart the SSH service on the remote machine for changes to take effect.

Code

 sudo /etc/init.d/ssh restart


2. VS Code Server Issues:

Corrupted VS Code Server: A corrupted or outdated VS Code server installation on the remote machine can cause issues. Delete the .vscode-server folder in the user's home directory on the remote machine and reconnect with VS Code. VS Code will then reinstall a fresh server.

Code


    rm -rf ~/.vscode-server


* your /etc/ssh/sshd_config may have this 

Include /etc/ssh/sshd_config.d/*.conf

that may contain 

DisableForwarding yes

that disabled forwarding

Thursday, 24 April 2025

VS Code life saving plugin by MS

remote - ssh:


https://code.visualstudio.com/docs/remote/ssh

allows u to remote ssh into a machine, and enables ms plugins like linitng, global search


for other extensions such as go, angular, to work in remote, remote need to install too:


just go to each extension in vs code extension list, and click the link install in remote 

Tuesday, 21 March 2023

angular/vs code , formatter and es lint

 VS Code settings.json


file -> preferences ->settings -> top right corner open settings.json. settings.json includes formatting or using formatter (pointintg where it is can be eslint. and eslint-plugin prettier.json)

settings.json should be workspace based it will overwrite user based. make it empty if u dont want user



angular linting :

es-lint (linting rules, show error prevents compiling like tsconfig.json)

es-lint -plugin - prettier uses to format and used by above


tsconfig.json additonal strict typing check (angular default)

Friday, 28 January 2022

VS Code Fold + Unfold regions like brackets and braces

 https://code.visualstudio.com/docs/editor/codebasics#:~:text=Use%20Shift%20%2B%20Click%20on%20the,collapsed%20region%20at%20the%20cursor.


  • Fold (Ctrl+Shift+[) folds the innermost uncollapsed region at the cursor.
  • Unfold (Ctrl+Shift+]) unfolds the collapsed region at the cursor.
  • Toggle Fold (Ctrl+K Ctrl+L) folds or unfolds the region at the cursor.
  • Fold Recursively (Ctrl+K Ctrl+[) folds the innermost uncollapsed region at the cursor and all regions inside that region.

Python3 VSCode Plugin

 Pylint (python syntax check)

autopep8(python3 pep8 formatter, I.E two spaces after function. Run Command > format document)

Tuesday, 29 June 2021

GIT command not recognized in VS code terminal

 https://stackoverflow.com/questions/4492979/git-is-not-recognized-as-an-internal-or-external-command


Have you correctly set your PATH to point at your Git installation?

You need to add the following paths to PATH:

  • C:\Program Files\Git\bin\
  • C:\Program Files\Git\cmd\

And check that these paths are correct – you may have Git installed on a different drive, or under Program Files (x86). Correct the paths if necessary.


Modifying PATH on Windows 10:

  1. In the Start Menu or taskbar search, search for "environment variable".
  2. Select "Edit the system environment variables".
  3. Click the "Environment Variables" button at the bottom.
  4. Double-click the "Path" entry under "System variables".
  5. With the "New" button in the PATH editor, add C:\Program Files\Git\bin\ and C:\Program Files\Git\cmd\ to the end of the list.
  6. Close and re-open your console.

Modifying PATH on Windows 7:

  1. Right-click "Computer" on the Desktop or Start Menu.
  2. Select "Properties".
  3. On the very far left, click the "Advanced system settings" link.
  4. Click the "Environment Variables" button at the bottom.
  5. Double-click the "Path" entry under "System variables".
  6. At the end of "Variable value", insert a ; if there is not already one, and then C:\Program Files\Git\bin\;C:\Program Files\Git\cmd\. Do not put a space between ; and the entry.
  7. Close and re-open your console..

Need to reopen VS code
Restart Visual Studio Code

Wednesday, 5 May 2021

Visual Studio Code settings

 he settings for Visual Studio Code can be found:

  • On a Windows or Linux computer, click menu File → Preferences → Settings
  • On a Mac, click menu Code → Preferences → Settings

https://stackoverflow.com/questions/40818354/visual-studio-code-git-folder-file-hidden



https://code.visualstudio.com/docs/getstarted/settings

Settings file locations#

By default VS Code shows the Settings editor, but you can still edit the underlying settings.json file by using the Open Settings (JSON) command or by changing your default settings editor with the workbench.settings.editor setting.

Depending on your platform, the user settings file is located here:

  • Windows %APPDATA%\Code\User\settings.json
  • macOS $HOME/Library/Application Support/Code/User/settings.json
  • Linux $HOME/.config/Code/User/settings.json

VS Code provides two different scopes for settings:

  • User Settings - Settings that apply globally to any instance of VS Code you open.
  • Workspace Settings - Settings stored inside your workspace and only apply when the workspace is opened.


File: Exclude 
Configure glob patterns for excluding files and folders. For example, the file Explorer decides which files and folders to show or hide based on this setting. Refer to the Search: Exclude setting to define search specific excludes. Read more about glob pattern