Hello everyone!
This post details some important updates for plugin developers who use embedded terminal functionality in their plugins.
Currently, the Terminal plugin features several implementations of the Terminal view. Users can toggle between them by going to Settings | Tools | Terminal and selecting one of the available options from the Terminal engine dropdown. Up until now, the default option has always been Classic, but starting from v2025.2, Reworked 2025 will become the default. You can read more about the terminal’s evolution in this blog post.
Most users will now see the reworked terminal when they open the Terminal tool window. This means that plugins that try to integrate with terminal tabs created by users and that use the Classic Terminal API might stop working.
However, plugins that create their own terminal components and then interact with their APIs should continue to work as expected. This is because, in order to preserve compatibility, we made all existing public terminal creation APIs return the classic terminal regardless of which Terminal engine option is selected in the settings.
How to adapt to the Terminal API changes
If your plugin integrates with terminal tabs created by users, then you need to use the com.intellij.terminal.ui.TerminalWidget
interface directly instead of casting to com.intellij.terminal.JBTerminalWidget
or org.jetbrains.plugins.terminal.ShellTerminalWidget
, as these classes are compatible with the classic terminal only.
Unfortunately, the TerminalWidget
API is very limited at the moment, but most of its methods should work with any terminal implementation.
Let’s look at the most common terminal integration use cases along with the solutions for them:
- Executing a command in the terminal.
- Solution: Use
TerminalWidget#sendCommandToExecute
.
- Solution: Use
- Getting output text.
- Solution: Use
TerminalWidget#getText
to get all terminal text.
- Solution: Use
- Checking whether a command is running.
- Solution: Use
TerminalWidget#isCommandRunning
.
- Solution: Use
- Getting selected text.
- Workaround: As the reworked terminal uses
com.intellij.openapi.editor.Editor
under the hood, it is possible to add aSelectionListener
usingEditorEventMulticaster#addSelectionListener
. To determine which editor is the terminal editor, you can useTerminalDataContextUtils#isOutputModelEditor
.
- Workaround: As the reworked terminal uses
- Executing an action with a shortcut invoked in the terminal.
- Unfortunately, there is currently no solution or workaround to make this work in the reworked terminal.
Next steps
Within the scope of the 2025.3 release, we plan to improve the public API for the reworked terminal. Please follow IJPL-193161 for more information, and feel free to offer suggestions for terminal features you would like to be able to use in your plugins.
If you have any questions or have spotted any issues relating to terminal functionality, feel free to share them here in the comments.