Terminal integrated shell windows

Содержание
  1. Integrated Terminal
  2. Managing Multiple Terminals
  3. Configuration
  4. Windows
  5. Shell arguments
  6. Terminal Display Settings
  7. Terminal Key Bindings
  8. Run Selected Text
  9. Copy & Paste
  10. Integrated Terminal
  11. Managing Multiple Terminals
  12. Configuration
  13. Windows
  14. Shell arguments
  15. Terminal Display Settings
  16. Key Bindings
  17. Run Selected Text
  18. Copy & Paste
  19. Rename terminal sessions
  20. Forcing key bindings to pass through the terminal
  21. Common Questions
  22. Why is VS Code shortcut X not working when the terminal has focus?
  23. Integrated terminal exited with code 1 on Windows 10
  24. Can I use Cmder with the terminal on Windows?
  25. Integrated Terminal
  26. Managing multiple terminals
  27. Terminal Splitting
  28. Configuration
  29. Terminal profiles
  30. Configuring profiles
  31. Removing built-in profiles
  32. Configuring working directory or environment
  33. Terminal display settings
  34. Terminal keybindings
  35. Copy & Paste
  36. Right click behavior
  37. Forcing key bindings to pass through the terminal
  38. Chord keybindings in the terminal
  39. Run Selected Text
  40. Send text from a keybinding
  41. Rename terminal sessions
  42. Open at a specific folder
  43. Changing shell for tasks and debug
  44. Changing how the terminal is rendered
  45. Next steps
  46. Common questions
  47. I’m having problems launching the terminal
  48. Can I use the integrated terminal with the Windows Subsystem for Linux?
  49. Why is VS Code shortcut X not working when the terminal has focus?
  50. Can I use Cmder’s shell with the terminal on Windows?
  51. PowerShell on macOS is complaining about a «-l» argument, how do I fix it?
  52. How can I change my default Windows terminal back to PowerShell?
  53. Why is Cmd+k/Ctrl+k not clearing the terminal?
  54. Why is nvm complaining about a prefix option when the Integrated Terminal is launched?
  55. Can I use Powerline fonts in the Integrated Terminal?
  56. How do I configure zsh on macOS to jump words with Ctrl+Left/Right arrow?
  57. Why does macOS make a ding sound when I resize terminal split panes?
  58. Why is my terminal showing a multi-colored triangle or a completely black rectangle?
  59. Why are there duplicate paths in the terminal’s $PATH environment variable and/or why are they reversed?

Integrated Terminal

In Azure Data Studio, you can open an integrated terminal, initially starting at the root of your workspace. This can be convenient as you don’t have to switch windows or alter the state of an existing terminal to perform a quick command-line task.

To open the terminal:

  • Use the Ctrl+` keyboard shortcut with the backtick character.
  • Use the View | Integrated Terminal menu command.
  • From the Command Palette (Ctrl+Shift+P), use the View:Toggle Integrated Terminal command.

You can still open an external shell with the Explorer Open in Command Prompt command (Open in Terminal on Mac or Linux) if you prefer to work outside Azure Data Studio.

Managing Multiple Terminals

You can create multiple terminals open to different locations and easily navigate between them. Terminal instances can be added by hitting the plus icon on the top-right of the TERMINAL panel or by triggering the Ctrl+Shift+` command. This creates another entry in the dropdown list that can be used to switch between them.

Remove terminal instances by pressing the trash can button.

If you use multiple terminals extensively, you can add key bindings for the focusNext , focusPrevious and kill commands outlined in the Key Bindings section to allow navigation between them using only the keyboard.

Configuration

The shell used defaults to $SHELL on Linux and macOS, PowerShell on Windows 10 and cmd.exe on earlier versions of Windows. These can be overridden manually by setting terminal.integrated.shell.* in settings. Arguments can be passed to the terminal shell on Linux and macOS using the terminal.integrated.shellArgs.* settings.

Windows

Correctly configuring your shell on Windows is a matter of locating the right executable and updating the setting. Below are a list of common shell executables and their default locations:

To be used as an integrated terminal, the shell executable must be a console application so that stdin/stdout/stderr can be redirected.

The integrated terminal shell is running with the permissions of Azure Data Studio. If you need to run a shell command with elevated (administrator) or different permissions, you can use platform utilities such as runas.exe within a terminal.

Shell arguments

You can pass arguments to the shell when it is launched.

For example, to enable running bash as a login shell (which runs .bash_profile ), pass in the -l argument (with double quotes):

Terminal Display Settings

You can customize the integrated terminal font and line height with the following settings:

  • terminal.integrated.fontFamily
  • terminal.integrated.fontSize
  • terminal.integrated.lineHeight

Terminal Key Bindings

The View: Toggle Integrated Terminal command is bound to Ctrl+` to quickly toggle the integrated terminal panel in and out of view.

Below are the keyboard shortcuts to quickly navigate within the integrated terminal:

Key Command
Ctrl+` Show integrated terminal
Ctrl+Shift+` Create new terminal
Ctrl+Up Scroll up
Ctrl+Down Scroll down
Ctrl+PageUp Scroll page up
Ctrl+PageDown Scroll page down
Ctrl+Home Scroll to top
Ctrl+End Scroll to bottom
Ctrl+K Clear the terminal

Other terminal commands are available and can be bound to your preferred keyboard shortcuts.

  • workbench.action.terminal.focus : Focus the terminal. This is like toggle but focuses the terminal instead of hiding it, if it is visible.
  • workbench.action.terminal.focusNext : Focuses the next terminal instance.
  • workbench.action.terminal.focusPrevious : Focuses the previous terminal instance.
  • workbench.action.terminal.kill : Remove the current terminal instance.
  • workbench.action.terminal.runSelectedText : Run the selected text in the terminal instance.
  • workbench.action.terminal.runActiveFile : Run the active file in the terminal instance.

Run Selected Text

To use the runSelectedText command, select text in an editor and run the command Terminal: Run Selected Text in Active Terminal via the Command Palette (Ctrl+Shift+P). The terminal attempts to run the selected text:

If no text is selected in the active editor, the line that the cursor is on is run in the terminal.

Copy & Paste

The keybindings for copy and paste follow platform standards:

  • Linux: Ctrl+Shift+C and Ctrl+Shift+V
  • Mac: Cmd+C and Cmd+V
  • Windows: Ctrl+C and Ctrl+V

The Integrated Terminal has basic find functionality that can be triggered with Ctrl+F.

If you want Ctrl+F to go to the shell instead of launching the Find widget on Linux and Windows, you need to remove the keybinding like so:

Integrated Terminal

In Visual Studio Code, you can open an integrated terminal, initially starting at the root of your workspace. This can be very convenient as you don’t have to switch windows or alter the state of an existing terminal to perform a quick command line task.

To open the terminal:

  • Use the kb(workbench.action.terminal.toggleTerminal) keyboard shortcut with the backtick character.
  • Use the View | Integrated Terminal menu command.
  • From the Command Palette ( kb(workbench.action.showCommands) ), use the View:Toggle Integrated Terminal command.

Note: You can still open an external shell with the Explorer Open in Command Prompt command (Open in Terminal on Mac or Linux) if you prefer to work outside VS Code.

Managing Multiple Terminals

You can create multiple terminals open to different locations and easily navigate between them. Terminal instances can be added by hitting the plus icon on the top-right of the TERMINAL panel or by triggering the kb(workbench.action.terminal.new) command. This creates another entry in the dropdown list that can be used to switch between them.

Remove terminal instances by pressing the trash can button.

Tip: If you use multiple terminals extensively, you can add key bindings for the focusNext , focusPrevious and kill commands outlined in the Key Bindings section to allow navigation between them using only the keyboard.

Configuration

The shell used defaults to $SHELL on Linux and macOS, PowerShell on Windows 10 and cmd.exe on earlier versions of Windows. These can be overridden manually by setting terminal.integrated.shell.* in settings. Arguments can be passed to the terminal shell on Linux and macOS using the terminal.integrated.shellArgs.* settings.

Windows

Correctly configuring your shell on Windows is a matter of locating the right executable and updating the setting. Below are a list of common shell executables and their default locations:

Note: To be used as an integrated terminal, the shell executable must be a console application so that stdin/stdout/stderr can be redirected.

Tip: The integrated terminal shell is running with the permissions of VS Code. If you need to run a shell command with elevated (administrator) or different permissions, you can use platform utilities such as runas.exe within a terminal.

Shell arguments

You can pass arguments to the shell when it is launched.

For example, to enable running bash as a login shell (which runs .bash_profile ), pass in the -l argument (with double quotes):

Terminal Display Settings

You can customize the integrated terminal font and line height with the following settings:

  • terminal.integrated.fontFamily
  • terminal.integrated.fontSize
  • terminal.integrated.lineHeight

Key Bindings

The View: Toggle Integrated Terminal command is bound to kb(workbench.action.terminal.toggleTerminal) to quickly toggle the integrated terminal panel in and out of view.

Below are the keyboard shortcuts to quickly navigate within the integrated terminal:

Key Command
kb(workbench.action.terminal.toggleTerminal) Show integrated terminal
kb(workbench.action.terminal.new) Create new terminal
kb(workbench.action.terminal.scrollup) Scroll up
kb(workbench.action.terminal.scrolldown) Scroll down
kb(workbench.action.terminal.scrollupPage) Scroll page up
kb(workbench.action.terminal.scrolldownPage) Scroll page down
kb(workbench.action.terminal.scrollToTop) Scroll to top
kb(workbench.action.terminal.scrollToBottom) Scroll to bottom
kb(workbench.action.terminal.clear) Clear the terminal

Other terminal commands are available and can be bound to your preferred keyboard shortcuts.

  • workbench.action.terminal.focus : Focus the terminal. This is like toggle but focuses the terminal instead of hiding it, if it is visible.
  • workbench.action.terminal.focusNext : Focuses the next terminal instance.
  • workbench.action.terminal.focusPrevious : Focuses the previous terminal instance.
  • workbench.action.terminal.kill : Remove the current terminal instance.
  • workbench.action.terminal.runSelectedText : Run the selected text in the terminal instance.
  • workbench.action.terminal.runActiveFile : Run the active file in the terminal instance.

Run Selected Text

To use the runSelectedText command, select text in an editor and run the command Terminal: Run Selected Text in Active Terminal via the Command Palette ( kb(workbench.action.showCommands) ):

The terminal will attempt to run the selected text.

If no text is selected in the active editor, the line that the cursor is on is run in the terminal.

Copy & Paste

The keybindings for copy and paste follow platform standards:

  • Linux: kbstyle(Ctrl+Shift+C) and kbstyle(Ctrl+Shift+V)
  • Mac: kbstyle(Cmd+C) and kbstyle(Cmd+V)
  • Windows: kbstyle(Ctrl+C) and kbstyle(Ctrl+V)

The Integrated Terminal has basic find functionality which can be triggered with kb(workbench.action.terminal.focusFindWidget) .

If you want Ctrl+F to go to the shell instead of launching the Find widget on Linux and Windows, you will need to remove the keybinding like so:

Rename terminal sessions

Integrated Terminal sessions can now be renamed using the Terminal: Rename ( workbench.action.terminal.rename ) command. The new name will be displayed in the terminal selection drop-down.

Forcing key bindings to pass through the terminal

While focus is in the integrated terminal, many key bindings will not work as the keystrokes are passed to and consumed by the terminal itself. The terminal.integrated.commandsToSkipShell setting can be used to get around this. It contains an array of command names whose key bindings will skip processing by the shell and instead be processed by the VS Code key binding system. By default this includes all terminal key bindings in addition to a select few commonly used key bindings.

Common Questions

Why is VS Code shortcut X not working when the terminal has focus?

Currently the terminal consumes many key bindings, preventing Visual Studio Code from reacting to them. Some examples are kbstyle(F1) to open the Command Palette and kbstyle(Ctrl+P) for Quick Open on Linux and Windows. This is necessary as various terminal programs and/or shells may respond to these key bindings themselves. There are plans to explore a blacklist that would prevent certain key bindings from being handled by the terminal (see #7269).

Integrated terminal exited with code 1 on Windows 10

This can happen if you run VS Code in compatibility mode which may be turned on automatically if you have upgraded Windows. You can change this by right-clicking the executable and selecting properties, then uncheck «Run this program in compatibility mode» in the compatibility tab.

Can I use Cmder with the terminal on Windows?

Yes, to use the Cmder console emulator in VS Code, you need to create a vscode.bat file in your cmder path with the following contents:

then in your VS Code user settings, add the following to your settings.json file:

Note: The example above assumes you are running 32-bit VS Code on 64-bit Windows and need to use sysnative . If you are running the 64-bit version of VS Code, you would use System32 .

Integrated Terminal

In Visual Studio Code, you can open an integrated terminal, initially starting at the root of your workspace. This can be convenient as you don’t have to switch windows or alter the state of an existing terminal to perform a quick command-line task.

To open the terminal:

  • Use the ⌃` (Windows, Linux Ctrl+` ) keyboard shortcut with the backtick character.
  • Use the View >Terminal menu command.
  • From the Command Palette ( ⇧⌘P (Windows, Linux Ctrl+Shift+P ) ), use the View: Toggle Integrated Terminal command.

Note: You can still open an external terminal with the ⇧⌘C (Windows, Linux Ctrl+Shift+C ) keyboard shortcut if you prefer to work outside VS Code.

Managing multiple terminals

You can create multiple terminals open to different locations and easily navigate between them. Terminal instances can be added by clicking the plus icon on the top-right of the TERMINAL panel or by triggering the ⌃⇧` (Windows, Linux Ctrl+Shift+` ) command. This action creates another entry in the dropdown list that can be used to switch between them.

Remove terminal instances by pressing the trash can button.

Tip: If you use multiple terminals extensively, you can add key bindings for the focusNext , focusPrevious and kill commands outlined in the Key Bindings section to allow navigation between them using only the keyboard.

Terminal Splitting

You can also split the terminal by triggering the ⌘\ (Windows, Linux Ctrl+Shift+5 ) command or via the right click context menu.

When focusing a split terminal pane, you can move focus and resize using one of the following commands:

Key Command
⌥⌘← (Windows, Linux Alt+Left ) Focus Previous Pane
⌥⌘→ (Windows, Linux Alt+Right ) Focus Next Pane
⌃⌘← (Windows , Linux Ctrl+Shift+Left ) Resize Pane Left
⌃⌘→ (Windows , Linux Ctrl+Shift+Right ) Resize Pane Right
⌃⌘↑ (Windows, Linux ) Resize Pane Up
⌃⌘↓ (Windows, Linux ) Resize Pane Down

Configuration

You can configure your default integrated terminal shell via terminal profiles as well as tune other terminal features with your user settings.

Terminal profiles

The terminal’s shell defaults to $SHELL on Linux and macOS and PowerShell on Windows. Terminal profiles can be used to configure either the default or secondary shells by running the Terminal: Select Default Profile command, which is also accessible via the terminal’s dropdown.

VS Code will automatically present a set of common profiles for the dropdown and also detect less common ones which will only show up when selecting a default profile.

Note: Profiles won’t work automatically when set in the workspace scope, you must grant the workspace permissions to configure your profile or environment changes using the Terminal: Manage Workspace Shell Permissions command.

Configuring profiles

The recommended way to create a new profile is to run the Terminal: Select Default Profile command and activate the configure button on the right side of the shell to base it on. This will add a new entry to your settings that can be tweaked manually in your settings.json file.

Profiles can be created using either a path or a source , as well as a set of optional arguments. A source is available only on Windows and can be used to let VS Code detect the install of either PowerShell or Git Bash . Alternatively a path pointing directly to the shell executable can be used. Here are some example profile configurations:

Other arguments supports in profiles include:

  • overrideName : A boolean indicating whether or not to replace the dynamic terminal title which detects what program is running with the static profile name.

Tip: The integrated terminal shell is running with the permissions of VS Code. If you need to run a shell command with elevated (administrator) or different permissions, you can use platform utilities such as runas.exe within a terminal.

Removing built-in profiles

To remove profile entries from the dropdown, set the name of the profile to null. For example, to remove the Git Bash profile on Windows, use this setting:

Configuring working directory or environment

The env and cwd terminal settings all support resolving variables:

Terminal display settings

You can customize the integrated terminal font and line height with the following settings:

  • terminal.integrated.fontFamily
  • terminal.integrated.fontSize
  • terminal.integrated.fontWeight
  • terminal.integrated.fontWeightBold
  • terminal.integrated.lineHeight
  • terminal.integrated.letterSpacing

Terminal keybindings

The View: Toggle Integrated Terminal command is bound to ⌃` (Windows, Linux Ctrl+` ) to quickly toggle the integrated terminal panel in and out of view.

Below are the keyboard shortcuts to quickly navigate within the integrated terminal:

Key Command
⌃` (Windows, Linux Ctrl+` ) Show integrated terminal
⌃⇧` (Windows, Linux Ctrl+Shift+` ) Create new terminal
⌥⌘PageUp (Windows Ctrl+Alt+PageUp , Linux Ctrl+Shift+Up ) Scroll up
⌥⌘PageDown (Windows Ctrl+Alt+PageDown , Linux Ctrl+Shift+Down ) Scroll down
PageUp (Windows, Linux Shift+PageUp ) Scroll page up
PageDown (Windows, Linux Shift+PageDown ) Scroll page down
⌘Home (Windows Ctrl+Home , Linux Shift+Home ) Scroll to top
⌘End (Windows Ctrl+End , Linux Shift+End ) Scroll to bottom
⌘K (Windows, Linux ) Clear the terminal

Other terminal commands are available and can be bound to your preferred keyboard shortcuts, such as:

  • workbench.action.terminal.focus : Focus the terminal. This is like toggle but focuses the terminal instead of hiding it, if it is visible.
  • workbench.action.terminal.focusNext : Focuses the next terminal instance.
  • workbench.action.terminal.focusPrevious : Focuses the previous terminal instance.
  • workbench.action.terminal.focusAtIndexN : Focuses the terminal at index N (N=1-9)
  • workbench.action.terminal.kill : Remove the current terminal instance.
  • workbench.action.terminal.runSelectedText : Run the selected text in the terminal instance.
  • workbench.action.terminal.runActiveFile : Run the active file in the terminal instance.

Copy & Paste

The keybindings for copy and paste follow platform standards:

  • Linux: Ctrl+Shift+C and Ctrl+Shift+V
  • macOS: Cmd+C and Cmd+V
  • Windows: Ctrl+C and Ctrl+V

Right click behavior

The right click behavior differs based on the platform:

  • Linux: Show the context menu.
  • macOS: Select the word under the cursor and show the context menu.
  • Windows: Copy and drop selection if there is a selection, otherwise paste.

This can be configured using the terminal.integrated.rightClickBehavior setting.

Forcing key bindings to pass through the terminal

While focus is in the integrated terminal, many key bindings will not work as the keystrokes are passed to and consumed by the terminal itself. There is a hardcoded list of commands, which skip being processed by the shell and instead get sent to the VS Code keybinding system. You can customize this list with the terminal.integrated.commandsToSkipShell setting. Commands can be added to this list by adding the command name to the list, and removed by adding the command name to the list prefixed with a — .

Look at the setting details to see the complete list of default commands.

Chord keybindings in the terminal

By default, when a chord keybinding is the highest priority keybinding it will always skip the terminal shell (bypassing terminal.integrated.commandsToSkipShell ) and be evaluated by VS Code instead of the terminal. This is typically the desired behavior unless you’re on Windows/Linux and want your shell to use ctrl+k (for bash this cuts the line after the cursor). This can be disabled with the following setting:

The Integrated Terminal has basic find functionality that can be triggered with ⌘F (Windows, Linux Ctrl+F ) .

If you want Ctrl+F to go to the shell instead of launching the Find control on Linux and Windows, you will need to remove the keybinding like so:

Run Selected Text

To use the runSelectedText command, select text in an editor and run the command Terminal: Run Selected Text in Active Terminal via the Command Palette ( ⇧⌘P (Windows, Linux Ctrl+Shift+P ) ):

The terminal will attempt to run the selected text.

If no text is selected in the active editor, the line that the cursor is on is run in the terminal.

Send text from a keybinding

The workbench.action.terminal.sendSequence command can be used to send a specific sequence of text to the terminal, including escape sequences. This enables things like sending arrow keys, enter, cursor moves, etc. The example below shows the sort of things you can achieve with this feature, it jumps over the word to the left of the cursor (Ctrl+Left arrow) and presses backspace:

Note that the command only works with the \u0000 format for using characters via their character code (not \x00 ). You can read more about these hex code and the sequences terminals work with on the following resources:

Rename terminal sessions

Integrated Terminal sessions can now be renamed using the Terminal: Rename ( workbench.action.terminal.rename ) command. The new name will be displayed in the terminal selection dropdown.

Open at a specific folder

By default, the terminal will open at the folder that is opened in the Explorer. The terminal.integrated.cwd setting allows specifying a custom path to open instead:

Split terminals on Windows will start in the directory that the parent terminal started with. On macOS and Linux, split terminals will inherit the current working directory of the parent terminal. This behavior can be changed using the terminal.integrated.splitCwd setting:

There are also extensions available that give more options such as Terminal Here.

Changing shell for tasks and debug

You can set terminal.integrated.automationShell.

to override the shell and shell args used by tasks and debug:

Changing how the terminal is rendered

By default, the integrated terminal will render using multiple elements, which are better tuned than the DOM for rendering interactive text that changes often. However, Electron/Chromium are slower at rendering to canvas on some environments so VS Code also provides a fallback DOM-renderer experience. VS Code will try to detect slow performance and give you the option to change via a notification. You can also change the rendering directly by setting terminal.integrated.rendererType in your user or workspace settings.

Something else that might improve performance is to ignore Chromium’s GPU disallow list by launching VS Code with code —ignore-gpu-blacklist .

There is an experimental renderer based on WebGL that can also be enabled:

Next steps

The basics of the terminal have been covered in this document, read on to find out more about:

  • Tasks — Tasks let you integrate with external tools and leverage the terminal heavily.
  • Mastering VS Code’s Terminal — An external blog with plenty of power user tips for the terminal.
  • Explore the rest of the terminal commands by browsing your keybindings.json file within VS Code.

Common questions

I’m having problems launching the terminal

There’s a dedicated troubleshooting guide for these sorts of problems.

Can I use the integrated terminal with the Windows Subsystem for Linux?

Yes, you can select the Windows Subsystem for Linux (WSL) bash shell as your terminal default. If you have WSL enabled (through Windows Features), you can select WSL Bash from the terminal Select Default Shell dropdown. See Developing in WSL for details on working in WSL and the Remote — WSL extension.

Why is VS Code shortcut X not working when the terminal has focus?

Currently the terminal consumes many key bindings, preventing Visual Studio Code from reacting to them. An example of this is Ctrl+B to open the Side Bar on Linux and Windows. This is necessary as various terminal programs and/or shells may respond to these key bindings themselves. You can use the terminal.integrated.commandsToSkipShell setting to prevent specific key bindings from being handled by the terminal.

Can I use Cmder’s shell with the terminal on Windows?

Yes, to use the Cmder shell in VS Code, you need to add the following settings to your settings.json file:

You may refer to Cmder’s wiki for more information.

PowerShell on macOS is complaining about a «-l» argument, how do I fix it?

When configuring the integrated terminal to use PowerShell on macOS, you may hit this error complaining about a «-l» argument. To fix this you will need to override the shell args setting as it defaults to [«-l»] to run login shells by default (for bash/zsh/etc.).

How can I change my default Windows terminal back to PowerShell?

If you want to put the default Integrated Terminal shell back to the default (PowerShell on Windows), you can remove the shell override from your User Settings ( ⌘, (Windows, Linux Ctrl+, ) ).

For example, if you have set your default terminal to bash, you will find terminal.integrated.shell.windows in your settings.json pointing to your bash location.

Remove the entry to use the built-in VS Code default or set it to another shell executable path.

Why is Cmd+k/Ctrl+k not clearing the terminal?

Normally Cmd+k / Ctrl+k clears the terminal on macOS/Windows, but this can stop working when chord keybindings are added either by the user or extensions. The Cmd+k / Ctrl+k keybindings rely on the VS Code keybinding priority system that defines which keybinding is active at any given time (user > extension > default). In order to fix this, you need to redefine your user keybinding that will have priority, preferably at the bottom of your user keybindings.json file:

Why is nvm complaining about a prefix option when the Integrated Terminal is launched?

nvm (Node Version Manager) users often see this error for the first time inside VS Code’s Integrated Terminal:

This is mostly a macOS problem and does not happen in external terminals. The typical reasons for this are the following:

  • npm was globally installed using another instance of node that is somewhere in your path (such as /usr/local/bin/npm ).
  • In order to get the development tools on the $PATH , VS Code will launch a bash login shell on start up. This means that your

/.bash_profile has already run and when an Integrated Terminal launches, it will run another login shell, reordering the $PATH potentially in unexpected ways.

To resolve this issue, you need to track down where the old npm is installed and remove both it and its out of date node_modules. You can do this by finding the nvm initialization script and running which npm before it runs, which should print the path when you launch a new terminal.

Once you have the path to npm, you can find the old node_modules by resolving the symlink by running a command something like this:

This will give you the resolved path at the end:

From there, removing the files and relaunching VS Code should fix the issue:

Can I use Powerline fonts in the Integrated Terminal?

Yes, you can specify Powerline fonts with the terminal.integrated.fontFamily setting.

Note that you want to specify the font family, not an individual font like Meslo LG M DZ Regular for Powerline where Regular is the specific font name.

How do I configure zsh on macOS to jump words with Ctrl+Left/Right arrow?

By default, Ctrl+Left/Right arrow will jump words in bash. You can configure the same for zsh by adding these keybindings:

Why does macOS make a ding sound when I resize terminal split panes?

The keybindings ⌃⌘← and ⌃⌘→ are the defaults for resizing individual split panes in the terminal, while they work they also cause a system «invalid key» sound to play due to an issue in Chromium. The recommended workaround is to tell macOS to no-op for these keybindings by running this in your terminal:

Why is my terminal showing a multi-colored triangle or a completely black rectangle?

The terminal can have problems rendering in some environments, for example you might see a big multi-colored triangle instead of text. This is typically caused by driver/VM graphics issues and the same also happens in Chromium. You can work around these issues by launching code with the —disable-gpu flag or by using the setting «terminal.integrated.rendererType»: «dom» to avoid using the canvas in the terminal.

Why are there duplicate paths in the terminal’s $PATH environment variable and/or why are they reversed?

This can happen on macOS because of how the terminal launches using VS Code’s environment. When VS Code launches for the first time, in order to source your «development environment», it launches your configured shell as a login shell, which runs your

/.zprofile scripts. Now when the terminal launches, it also runs as a login shell, which will put the standard paths to the front (for example, /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin ) and reinitialize your shell environment.

To get a better understanding, you can simulate what is happening by launching an inner login shell within your operating system’s built-in terminal:

Unfortunately, unlike in Linux, standalone macOS terminals all run as login shells by default, since macOS does not run a login shell when the user logs into the system. This encourages «bad behavior», like initializing aliases in your profile script when they should live in your rc script as that runs on non-login shells.

There are two direct fixes for this. You can set «terminal.integrated.inheritEnv»: false , which will strip most environment variables from the terminal’s environment, except for some important ones (like HOME , SHELL , TMPDIR , etc.).

The other fix is to no longer run a login shell in the terminal by setting «terminal.integrated.shellArgs»: [] . If you go with this fix, you will want to make sure any aliases in your profile scripts are moved over to your

/.zshrc file since aliases only apply to the shell they’re set in.

Читайте также:  Acer windows 10 не работает bluetooth
Оцените статью