
- OPEN TERMINAL WINDOW ON MAC FULL
- OPEN TERMINAL WINDOW ON MAC CODE
- OPEN TERMINAL WINDOW ON MAC WINDOWS
OPEN TERMINAL WINDOW ON MAC WINDOWS
If we press ⌘⏎ on macOS, or Ctrl+ Enter on Windows and Linux, it opens the Git log window in IntelliJ IDEA. IntelliJ IDEA detects a number of different commands that could be run in the IDE instead of from the command line. If we type the same command again, but this time use ⌘⏎ on macOS, or Ctrl+ Enter on Windows and Linux, IntelliJ IDEA will use the feature in IntelliJ IDEA and open the relevant tool window. If it’s highlighted in yellow and we press Enter, the command will be run in the terminal window just as we’d expect. This is a new feature in IntelliJ IDEA 2020.2 that shows that the command could be run in the IDE, meaning we don’t need to use the command line. You may notice that some commands in the terminal window are highlighted. View steps in video Run IDE Features from the Terminal This takes some of the pain out of debugging problems. In stack traces, you can click on the file name and IntelliJ IDEA will open the file and put the caret on the line that caused the problem. File names in the terminal can also link back to the file in the project. URLs in the terminal window are clickable, so we can click on any link shown in the terminal window to open them in the browser. View steps in video URLs and Stack Traces in the Terminal Window This means that we can have a terminal window in the correct location immediately without having to navigate using the command line. Right click on an item in the Project Window, for example, and select "Open in Terminal". The integration provided by the IDE also extends to being able to open a location from inside the project window in the terminal window from the context menu. View steps in video Terminal Locations from the Command Window
OPEN TERMINAL WINDOW ON MAC CODE
This is not specific to running JShell in the terminal, it’s easy to copy and paste code from anywhere in IntelliJ IDEA into the terminal window. For example, if we’re running the Java REPL JShell in an IntelliJ IDEA terminal window, it’s easy to copy code from the editor and paste it into JShell. Running command line processes from inside IntelliJ IDEA is useful for keeping us in the same context while we’re developing, and for sharing content between different parts of our application. View steps in video Pasting Code from the Editor into the Terminal When we restart IntelliJ IDEA, our terminal session names and other settings will persist. We can close splits or tabs with ⌘W on macOS, or Ctrl+ F4 for Windows and Linux. We can switch between the splits with ⌥⇥ on macOS, or Ctrl+ Tab on Windows and Linux. We can move between the different tabs with ⌘⇧ on macOS or Alt+ ← or Alt+ → on Windows and Linux. That way we can easily reopen the one we’re interested in. You can do this from the context menu, which you can open by right-clicking on the tab. Given that we might be using a number of terminal sessions with a number of different processes or parameters, it’s useful to rename the tabs to something helpful. We might sometimes do this with different Java versions or different arguments to those we’re using in the application.
OPEN TERMINAL WINDOW ON MAC FULL
For example, although IntelliJ IDEA has full integration with Gradle, sometimes we might want to check a build tool like Gradle or Maven runs correctly from the command line. We can run any type of command from the terminal window. For example, you can open up the mongo shell in this split window and can see if the commands have any impact on the running server. For this, we can split our terminal window so that we can run two in the same window. Running commands in different tabs is helpful, but sometimes two different processes are closely related and we want to see them together. Then we can interact with the server that’s running, and check everything is OK for our application. We can open a second terminal tab with ⌘T on macOS, or Ctrl+ Shift+ T on Windows and Linux, to run the MongoDB shell as a new command: mongo

View steps in video Multiple Terminal Sessions By using the built in terminal, we don’t have to switch between applications, and we can easily have all aspects of our development right in front of us in the same window. When MongoDB is running in the terminal session, we can go back to writing the application code in the editor. If we want to start the MongoDB database instance with a specific path for storing the data, we can type: mongod -dbpath Īnd press enter.

The terminal supports all the same commands that the operating system supports. We can open the terminal window with ⌥F12 on macOS, or Alt+ F12 on Windows and Linux.

In this example we have a simple Spring Boot application that needs a running MongoDB database. Opening the IntelliJ IDEA Terminal Window This performs the same function as your operating system’s terminal or command feature, but using the terminal inside IntelliJ IDEA has a number of benefits. In this video we’re going to take a look at IntelliJ IDEA’s built in terminal.
