Skip to content

Field report: VSCode on clean Windows installation #282

@rkdarst

Description

@rkdarst

This describes what I observed, for future reference.

Date: 2024-03-05
Windows 10 Pro Education, standalone installation (not university managed)

  • VSCode web page, click download, select Windows "User installer" x86
  • Run the installer
    • The only really important configuration option seemed to be "add vscode to PATH"
  • start vscode
  • Aside: I clicked "remote connection" and "SSH" and it automatically installed the remote-ssh extension. So vscode does sometimes automatically install extensions.
  • From the menu bar, I did Terminal → New Terminal. It started a PowerShell terminal. e.g. pwd, cd /, cd /Users/user/testproject/ worked (and it tab-completed to C:\Users\...). So backslashes/forward slashes mostly works
    • The usual hotkey control-backquote doesn't work to open the terminal.
  • I click the "version control" tab on the side. It says "Install git, a popular ..." with a big "Download Git for Windows" button. So Git installation separately is needed, but it is guided.
  • Click "Download git for windows". It launches a web browser to the Git for windows site. Follow those instructions (same as we have now).
    • I did select "use VSCode as an editor for git" (instead of Nano)
  • I go back to vscode. git doesnt' work from the terminal, and it still prompts me to download Git. Probably OK: this is probably because of PATH.
  • Exit and restart vscode. Now it works: git appears in the terminal and in the "version control" browser.

Let's try using it:

  • I had made a blank testproject.
  • I can click "Initialize repository" in the VCS tab. It also shows something about Github, which I didn't click yet.
  • I add some files
  • I go to the VCS tab and add the files. I cilkc "commit" and it says "Make sure you configure your "user.name" and "user.email" in git. The dialog says it comes from VSCode itself. It doesn't let me commit until I fix this.
  • If I enter a message in the VCS commit sidepanel, it commits directly
    • If I don't enter a commit message, it starts a new vscode tab where I can edit the message (I guess it did this since I told it to use vscode as an editor). This basically does what we want: you can edit the message, and the git process waits until you close the tab.
  • If, from the terminal, I git config --global --edit, it starts a tab in vscode. As expected. If I remove the core.editor config, then it starts the editor in the terminal (vi by default)
    • I can change the core.editor to nano and it works with nano. Changing back to the default value opens in vscode again.
    • Setting core.editor to code --wait (no quotes) also works to launch within the vscode tab.
    • But if core.editor is unset and I click "commit" from the sidebar, it does launch the editor in the a vscode tab. I wonder if vscode is overriding the editor option on the command line directly (I couldn't find a way to inspect the processes enough to see how it was started).

Output of git config --list --show-origin:

file:C:/Program Files/Git/etc/gitconfig diff.astextplain.textconv=astextplain
file:C:/Program Files/Git/etc/gitconfig filter.lfs.clean=git-lfs clean -- %f
file:C:/Program Files/Git/etc/gitconfig filter.lfs.smudge=git-lfs smudge -- %f
file:C:/Program Files/Git/etc/gitconfig filter.lfs.process=git-lfs filter-process
file:C:/Program Files/Git/etc/gitconfig filter.lfs.required=true
file:C:/Program Files/Git/etc/gitconfig http.sslbackend=schannel
file:C:/Program Files/Git/etc/gitconfig core.autocrlf=true
file:C:/Program Files/Git/etc/gitconfig core.fscache=true
file:C:/Program Files/Git/etc/gitconfig core.symlinks=false
file:C:/Program Files/Git/etc/gitconfig pull.rebase=false
file:C:/Program Files/Git/etc/gitconfig credential.helper=manager
file:C:/Program Files/Git/etc/gitconfig credential.https://dev.azure.com.usehttppath=true
file:C:/Program Files/Git/etc/gitconfig init.defaultbranch=master
file:C:/Users/user/.gitconfig   core.editor="C:\Users\user\AppData\Local\Programs\Microsoft VS Code\bin\code" --wait

Misc screenshots (these may be used, I claim there is no creative work so no copyright by me. But it might be better to re-generate unless it's windows-specific):

VCS sidebar icon:
image

Screenshot (1)

New terminal:
Screenshot (3)

Download git for windows:
Screenshot (4)

Git defaults:
Screenshot (5)

Warning to configure username and email:
Screenshot (6)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions