IntelliJ IDEA provides an embedded terminal that allows you to work with command line tools available in your operating system. For instance, these can be PowerShell or cmd.exe on Windows, Shell or Bash on Linux. You can also use the terminal to work with a Git command line.
- Run Terminal
- Configure Terminal Type
- Work with Terminal
- Manage Multiple Sessions
- Manage Terminal Settings
Do one of the following to run the terminal:
- Press
Alt+F12
. - Hover the mouse pointer over the button in the IDE's lower left corner and select Terminal in the invoked menu.
To change the default terminal type, go to File | Settings | Tools | Terminal and provide a path to the required shell executable in the Shell path field. Click the button next to Shell path and locate the corresponding file in the invoked dialog:
The table below lists common shell executables and their default locations for Windows:
Shell Type | Default Shell Path |
---|---|
Command Prompt | C:\Windows\System32\cmd.exe |
PowerShell | C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe |
Git Bash | C:\Program Files\Git\bin\bash.exe |
Common shell paths for Linux:
Shell Type | Default Shell Path |
---|---|
Bash | /bin/bash |
Shell | /bin/sh |
To run a command in the terminal, press Enter
. The Up
and Down
arrow keys allow you to navigate through the history of commands.
You can work within the terminal using specified shortcuts or a context menu available by right-clicking the terminal's surface. Below are the main commands provided by IntelliJ IDEA:
Context Menu Item | Shortcut | Description |
---|---|---|
Find | Ctrl-F |
Invokes the search panel that allows you to find the specified text. |
Open as URL | Opens the selected URL in a default browser. | |
Copy | Ctrl-C |
Copies the selected text to the clipboard. |
Paste | Ctrl-V |
Pastes the text from the clipboard. |
Clear Buffer | Ctrl-K |
Clears the terminal. |
Page Up | Shift-Page Up |
Scrolls page up. |
Page Down | Shift-Page Down |
Scrolls page down. |
The embedded terminal allows you to open different sessions and navigate between them.
To create a new session, do one of the following:
- Click the button on the terminal's toolbar.
- Right-click a current session window (or a session tab) and choose New Session in the context menu (
Ctrl+Shift-T
). A new session opens in a separate tab:
To close an active session, use the button on the terminal's toolbar. Below are the context menu commands and corresponding shortcuts allowing you to work with sessions:
Context Menu Item | Shortcut | Description |
---|---|---|
New Session | Ctrl+Shift-T |
Creates a new session. |
Close Session | Ctrl+Shift-W |
Closes the active session. |
Next Tab | Alt-Right |
Switches to the next session. |
Previous Tab | Alt-Left |
Switches to the previous session. |
Rename Tab | Allows you to rename the session tab. |
- Tools | Terminal - provides access to various terminal-specific settings. For instance, you can change the default working directory, the default name of a session tab, etc.
- The following global IDE settings are also applied to the terminal:
-
Keymap - the
Ctrl+C
andCtrl+V
shortcuts. -
Editor | General | Appearance - the Caret blinking option.
Note that the Use block caret option is not in effect for the terminal because it always has a block caret.
-
Appearance and Behavior | Appearance - the Antialiasing option for IDE.
-
Editor | Color Scheme | Console Font - terminal font settings.
-
Editor | Color Scheme | Console Colors - terminal colors.
-
Editor | Color Scheme | General - the Editor | Selection background and Selection foreground options.
Note that that new terminal color and font settings will be applied after IntelliJ IDEA restart.
-