Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is that component on the top-right of VS Code called? How can I change the setting of it?

I'm using VS Code on Mac and I was curious about one component.

Every time I open a new python file, this component will show up on the top right of the current window? But I can't find the name of it.

screenshot

like image 929
KevinZhou Avatar asked Nov 30 '19 22:11

KevinZhou


People also ask

How do you adjust VS Code settings?

To open the Settings editor, use the following VS Code menu command: On Windows/Linux - File > Preferences > Settings. On macOS - Code > Preferences > Settings.

How do you change the terminal on the right side in VS Code?

Using Keyboard Shortcut Steps are as follows: 1 Press CTRL + SHIFT + P to open Command Palette. 2 Then in the palette, type View: Move Panel To Bottom and click on it.

How do you open the top panel in VS Code?

Follow these steps: Press Alt to make menu visible. Click on the View menu, navigate to the Appearance option and choose Show Menu Bar.


1 Answers

That's not just "one component", but actually multiple buttons added to the editor actions toolbar from multiple extensions installed on your VS Code.

enter image description here

In order from left to right:

  1. Open Changes (built-in with VS Code as part of their Version Control functions)
  2. Run Python File in Terminal (added by Microsoft's own Python extension)
  3. Open Changes in previous revision (added by the GitLens extension)
  4. Show Revision Details (added by the GitLens extension)
  5. Open Changes in next revision (added by the GitLens extension)
  6. Toggle File Blame Annotations (added by the GitLens extension)
  7. Split Editor (built-in with VS Code)

For GitLens, they are automatically added when it detects the currently opened file is part of a git repository. You can configure them by accessing the command palette (CMD+Shift+P on a Mac), then entering "GitLens: Open Settings". Find the "Menus & Toolbars" section:

enter image description here

For example, if you want to remove buttons 3., 4., and 5., uncheck "Add commands to the editor group toolbar" > "Add comparison commands". Then reload VS Code. You can configure all the other settings there.

For the green Play button, it automatically appears when you the currently active file is a Python file. AFAIK, there is no way to configure or hide/remove it other than disabling the Python extension completely (which you certainly don't want to do). There are requests on VS Code's Github page to hide it, like this: Add setting to disable icon for "Run Python File In Terminal".

For the "Open Changes" and "Split Editor" buttons, AFAIK there is no built-in way to hide/remove them. You can only control the behavior from the VS Code settings:

enter image description here

As mentioned in the comments, there is a feature request for VS Code to Allow hiding the buttons in the tab bar line and in the panel title bar, which includes the "Open Changes" and "Split Editor" buttons. There are users who provided workarounds at hiding the buttons using extensions. You may want to follow that thread and/or try out some of those extensions.

like image 142
Gino Mempin Avatar answered Oct 11 '22 18:10

Gino Mempin