asked Oct 2, 2023 at 16:49

2 gold badges16 silver badges21 bronze badges
answered Nov 6, 2023 at 14:19
PyCharm includes an embedded terminal emulator for working with your command-line shell from inside the IDE. Use it to run Git commands, set file permissions, and perform other command-line tasks without switching to a dedicated terminal application.
Enable the Terminal plugin
This functionality relies on the Terminal plugin, which is bundled and enabled in PyCharm by default. If the relevant features aren’t available, make sure that you didn’t disable the plugin.
Press Ctrl+Alt+S to open settings and then select .
Open the tab, find the plugin, and select the checkbox next to the plugin name.
Open the Terminal tool window
Go to or press Alt+F12.
Right-click a project item in the Project tool window and choose Open in terminal from the context menu. This way the terminal will start with the directory corresponding to the selected item.
Start a new local session
To start a new session in a separate tab, click
on the toolbar or press Ctrl+Shift+T.

To run multiple sessions inside a tab, right-click the tab and select or in the context menu.
The saves tabs and sessions when you close the project or PyCharm. It preserves tab names, the current working directory, and even the shell history.
To close a tab, click on the toolbar or press Ctrl+F4.
Press Alt+Right and Alt+Left to switch between active tabs. Alternatively, you can press Alt+Down to see the list of all terminal tabs.
To clear the terminal screen, press Ctrl+L.
Start a new SSH session
On the toolbar, click
and select New SSH Session.
Enter the address of the host to which you want to connect, and provide authentication data.

Or, if you have configured SSH configurations, you can select one of them from the list.

To terminate the connection, click in the terminal tab.
Rename terminal tab
Right-click the tab and select from the context menu.
Search in terminal
To search for a certain string in a session, press Ctrl+F. This searches all text in the session: the prompt, commands, and output.
By default, the search is not case-sensitive. You can click in the search field to make it case-sensitive.
Configure the terminal emulator
Press Ctrl+Alt+S to open settings and then select .
Alternatively, click
on the Terminal toolbar and select .
New Terminal
Starting with the 2024.1 release, a beta version of the new terminal is available in the New UI of PyCharm.
Along with its improved look and feel aligned with the new UI, other major features include:
Command completion, including completion for command names, arguments, flags, and paths. For each suggested value, the new terminal displays quick documentation.

Completion for command names and arguments is available as you type them, but you can also press Ctrl+Space or Tab after a command name to get the list of possible arguments.
To display the history of commands that you have previously entered, press Up in the input area.
Enable New Terminal
Open the tool window: .
In the tool window header, click
and select Enable New Terminal.

Alternatively, open the IDE settings (Ctrl+Alt+S) and go to .
Search in output blocks
In the tool window, press Ctrl+F.

Last modified: 17 June 2024


Issue in PyCharm: PowerShell Script Not Digitally Signed
Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows
This error occurs because the activate.ps1 script in your virtual environment is not digitally signed, and the current execution policy in PowerShell prevents the execution of unsigned scripts.
Solution: Changing the PowerShell Execution Policy
To resolve this issue, you need to change the execution policy in PowerShell to allow the running of unsigned scripts. Here are the steps to change the execution policy:
- Open PowerShell or Windows Terminal as Administrator
- Change the Execution Policy:
- To allow the execution of unsigned scripts, set the execution policy to RemoteSigned. This allows scripts created on the local computer to be run without being signed, but requires that scripts downloaded from the internet are signed by a trusted publisher.
- Type the following command and press Enter: Set-ExecutionPolicy RemoteSigned
- If prompted for confirmation, type Y and press Enter.
- Restart PyCharm:
- Close PyCharm and reopen it. Navigate to the Terminal tab again and try activating the virtual environment. The error message should no longer appear, and the virtual environment should activate successfully.
Use this page to customize the settings of the embedded terminal emulator.
Enable the Terminal plugin
This functionality relies on the Terminal plugin, which is bundled and enabled in PyCharm by default. If the relevant features aren’t available, make sure that you didn’t disable the plugin.
Press Ctrl+Alt+S to open settings and then select .
Open the tab, find the plugin, and select the checkbox next to the plugin name.
New Terminal
Starting with the 2024.1 release, a beta version of the new terminal is available in the New UI of PyCharm.
Project Settings
These settings affect the terminal only for the current project:
Specify the working directory where every new shell session should start. By default, it starts in the root directory of the current project.
Specify custom environment variables for every new shell session.
Application Settings
These settings affect the terminal in any project that you open with the current PyCharm instance:
Specify the shell that will run by default. PyCharm should automatically detect the default shell based on your environment. Here are some examples of different shells:
Z shell:
/bin/zshBash for Windows:
bash.exeCommand Prompt:
cmd.exeCygwin:
"C:\cygwin\bin\bash.exe" --login -i
- Default Tab name
Specify the default name for new tabs.
Play the bell sound on various events.
- Close session when it ends
Close the current session when the corresponding process ends (for example, by
kill).Enable the mouse pointer support in the embedded local terminal.
- Copy to clipboard on selection
Copy text selected in the terminal to the clipboard.
- Paste on middle mouse button click
Paste clipboard contents by clicking the middle mouse button.
- Override IDE shortcuts
Use shell-specific shortcuts instead of IDE shortcuts when the tool window is active.
Integrate the terminal with the system shell to properly keep track of your command history for sessions and load a custom config file with required environment variables.
Shell integration works for
sh,bash,zsh, andfishshells.Highlight HTTP links in the terminal and make them clickable.
- Use Option as Meta key
On macOS, use the Option key as the Meta key.
- Run Commands using IDE
Detect and highlight commands that can be used as IDE features instead of running them in the terminal and reading console output.
When enabled, instead of pressing Enter, which runs the command in the terminal, press Ctrl+Enter to open the corresponding GUI element.
For the Python interpreter being a virtual environment, with this checkbox selected, the virtual environment is automatically activated (
activateis performed automatically).
On the settings page, you can configure the copy Ctrl+C and paste Ctrl+V shortcuts.
On the page, you can configure line spacing and fonts.
On the page, you can configure font colors.
On the page, you can configure the selection foreground and background colors.
Last modified: 17 June 2024



