Hi. I am updating my IntelliJ plugin to support IntelliJ 2025.1 EAP 5 ( 2025.1 EAP build 251.21418.62) and ran into an issue with terminal widget compatibility.
Previously, I used:
However, in IntelliJ 2025.1 EAP build 251.21418.62 , createShellWidget(...) now returns TerminalWidgetImpl , which is not compatible with ShellTerminalWidget .
Attempting to convert it using JBTerminalWidget.asJediTermWidget(terminalWidget) returns null , leading to an incompatible types error when assigning it to ShellTerminalWidget .
What is the correct way to handle TerminalWidgetImpl in 2025.1? Is there an official way to retrieve a ShellTerminalWidget from TerminalWidgetImpl.
Has ShellTerminalWidget been deprecated or replaced in the new API?
Any guidance on handling these API changes would be greatly appreciated! Thanks
In previous versions, widget instanceof TerminalWidgetBridge bridge returned true because the created TerminalWidget was com.intellij.terminal.JBTerminalWidget$TerminalWidgetBridge . However, starting from IntelliJ EAP 5, this check now returns false since the created TerminalWidget is org.jetbrains.plugins.terminal.block.TerminalWidgetImpl , causing asJediTermWidget to return null .
This is caused by enabling an updated terminal implementation in 2025.1 EAPs. Please avoid casting to ShellTerminalWidget with ShellTerminalWidget.toShellJediTermWidgetOrThrow(terminalWidget). Instead, please use com.intellij.terminal.ui.TerminalWidget directly. Is there any API missing for you?
Thanks, @Sergey.Simonchik. We no longer encounter this NPE in the beta builds. Were there any API changes between the transition from EAPs to beta? We experienced this issue in EAP 5, 6, and 7 but not in beta.
Additionally, we attempted to use com.intellij.terminal.ui.TerminalWidget directly, but we noticed that some APIs are missing, such as hasRunningCommands(), executeCommand(), getTerminal(), and grabFocus(). Do you have any alternatives for these?
Were there any API changes between the transition from EAPs to beta?
Yes, the change was in switching default TerminalWidget implementation. After the switch it can be casted to ShellTerminalWidget via ShellTerminalWidget.toShellJediTermWidgetOrThrow(terminalWidget).
hasRunningCommands()
It will be available as com.intellij.terminal.ui.TerminalWidget#isCommandRunning in 2025.2
executeCommand()
It’s available as com.intellij.terminal.ui.TerminalWidget#sendCommandToExecute
grabFocus()
It’s available as com.intellij.terminal.ui.TerminalWidget#requestFocus
getTerminal()
No, it won’t be available. What are the particular cases requiring this API?
Thanks for the explanation. I wanted to clarify—since you mentioned avoiding casting to ShellTerminalWidget with ShellTerminalWidget.toShellJediTermWidgetOrThrow(terminalWidget) , but also noted that after the switch, it can be cast using the same method—does that mean it’s okay to use ShellTerminalWidget.toShellJediTermWidgetOrThrow(terminalWidget) , or should we strictly rely on com.intellij.terminal.ui.TerminalWidget instead? Because in the current Beta build 251.23774.109 we do not face any issues regarding this. So are you planning to make any changes in 2025.2 ?