Code Monkey home page Code Monkey logo

helloworld's Introduction

Working with Embedded Terminal

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.

terminal-example

Do one of the following to run the terminal:

  • Press Alt+F12.
  • Hover the mouse pointer over the icon 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 ellipsis-button button next to Shell path and locate the corresponding file in the invoked dialog:

shell-executable-path

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 plus-button 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:

terminal-tabs

To close an active session, use the cross-button 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 and Ctrl+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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.