0

I am new to plugin development for JetBrains and would like to know how I can execute a command in the terminal with JetBrains Gateway.

I've tried like this:

var shellTerminalWidget = TerminalView.getInstance(project).createLocalShellWidget(currentWorkspacePath, "NewTab");
shellTerminalWidget.executeCommand(command);

It works well when I test locally. However, when I use JetBrains Gateway and install this plugin on the host, it doesn't work any longer, and I can't find any exceptions in the log.

Is there any difference when using Gateway?

LazyOne
  • 158,824
  • 45
  • 388
  • 391

1 Answers1

0

Right now such code creates an invisible terminal which should be shared explicitly:

BackendTerminalManager.getInstance(project).shareTerminal(...)

But we are going to fix in and automatically share all created local terminals in remoteDev, feel free to trach this issue:

https://youtrack.jetbrains.com/issue/CWM-6928

xtmq
  • 3,380
  • 22
  • 26
  • Thank you very much, but I can't find the class BackendTerminalManger. How could I install the related dependencies, and how could I get some related documents. Thanks – IceCream-jy Nov 08 '22 at 08:52
  • I added the dependency and tried but this message was shown: `java.lang.NoClassDefFoundError: com/jetbrains/rdserver/terminal/BackendTerminalManager`. And my GoLand version is 2022.2. – IceCream-jy Nov 09 '22 at 02:50
  • Yes, you have to reference backend terminal plugin in your plugin in that case – xtmq Nov 09 '22 at 15:50