PhpStorm 2019.1 Help

Terminal Emulator

PhpStorm includes an embedded terminal emulator for working with the system command-line shell from inside the IDE. Initially, it runs with your default system shell and supports Windows PowerShell, Command Prompt (cmd.exe), sh, bash, zsh, csh, and so on.

Open the Terminal tool window

Do one of the following:

  • Press Alt+F12.

  • Select View | Tool Windows | Terminal from the main menu.

  • Click the Terminal tool window button The Terminal tool window button.

  • Hover your mouse pointer over The tool windows icon in the lower left corner of the IDE, then choose Terminal from the menu.

By default, the Terminal runs with the current directory set to the root directory of the current project. You can change the default start directory in the Terminal settings or right-click any file (for example, in the Project tool window or any open tab) and select Open in Terminal: this will run the terminal in the directory of that file.

In the Terminal tool window, you can do the following:

Start a new session

  • Click the Add button on the toolbar. A new session is opened in a separate tab:

    New session in the terminal

Sessions are saved when you close the project or PhpStorm, that is, tab names, current working directory, and even the shell history is preserved.

To close an active session, click the Close button on the terminal toolbar or right-click the current session tab and select Close Tab from the context menu.

Switch between tabs

  • Press Alt+Right and Alt+Left to switch the active tab.

Alternatively, you can press Alt+Down to see the list of all terminal tabs.

Rename a tab

  • Right-click the tab and select Rename Session from the context menu.

Browse the history of entered commands

  • Use the Up and Down keys.

You can specify the desired shell to use with the embedded terminal emulator, change the start directory, and define environment variables among other settings.

Configure the terminal emulator

  • In the Settings/Preferences dialog (Ctrl+Alt+S), go to Tools | Terminal.

The following settings are inherited by the embedded terminal emulator from the IDE settings:

  • On the Keymap page, you can configure the copy (Ctrl+C) and paste (Ctrl+V) shortcuts.

  • On the editor's Appearance page, you can configure caret blinking. The setting Use block caret is not inherited in the terminal: its caret is always block.

  • Under the editor's Color Scheme settings, you can change the following options:

    • On the Console Fonts page: line spacing, and console fonts.

    • On the Console Colors page: console colors.

    • On the General page: selection foreground and background colors.

Last modified: 26 July 2019