How to open the Terminal in New UI
已回答
Hi I use the code below to open the Terminal in IDE then paste some text to the command line, in the old UI it works well, but it won't work in New UI.
ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow("Terminal");
if (toolWindow != null) {
if (!toolWindow.isVisible()) {
toolWindow.show(null);
TerminalView terminalView = ServiceManager.getService(project, TerminalView.class);
JBTerminalWidget terminalWidget = terminalView.getWidgets().iterator().next();
Terminal terminal = terminalWidget.getTerminal();
terminal.writeCharacters(command);
}
}
How to do that in New UI? Thank you very much for help!!
请先登录再写评论。
Sorry, my mistake. I found out the problem.
Hi,
Could you please share the solution so others can benefit from it in the future?