Configure different terminal shell on Windows

Oxygen general issues.
kirkilj
Posts: 110
Joined: Fri May 14, 2010 12:14 am

Configure different terminal shell on Windows

Post by kirkilj »

We've standardized on using Git-Bash for all interactive shell sessions for our technical writers, who are all on either Win7 or Win10.

Is it possible to configure a different terminal in Oxygen wherever a command line request is being made, such as:
  • Project View: Show In: Terminal
  • CSS ExecuteCommandLineOperation
  • and any others
kirkilj
Posts: 110
Joined: Fri May 14, 2010 12:14 am

Re: Configure different terminal shell on Windows

Post by kirkilj »

I would also like to know what it would take to embed a true terminal view into Oxygen rather than just an output console.
sorin_carbunaru
Posts: 402
Joined: Mon May 09, 2016 9:37 am

Re: Configure different terminal shell on Windows

Post by sorin_carbunaru »

Hello John,

1. You could create a plug-in that customizes the context menu of the Project view ( see ro.sync.exml.project.ProjectController.addPopUpMenuCustomizer(ProjectPopupMenuCustomizer) ) by removing our "Terminal" action and adding yours. This action can run a command that opens Git Bash or even call Git operations. For example:

Open Git Bash:

Code: Select all

Process process = Runtime.getRuntime().exec("cmd.exe /c \"C:\\Program Files\\Git\\git-bash.exe\"");
If you are interested in running commands and also show the results in an output side-view in oXygen, you might want to take a look at "ro.sync.exml.workspace.api.WorkspaceUtilities.startProcess(String, File, String, boolean)". See the example below:

Call "git status":

Code: Select all

        PluginWorkspaceProvider.getPluginWorkspace().startProcess(
            "Git status", 
            new File("C:/Path/To/Git/Repo"), 
            "cmd.exe /c \"git status\"", 
            true);
2. Regarding "ExecuteCommandLineOperation", you can do similar things like this:

Open Git Bash - create an action that runs a command like the following:

Code: Select all

cmd /c "C:\Program Files\Git\git-bash.exe"
Call "git status":
- set "workingDirectory" to "Path/To/Git/Repo"
- set "cmdLine" to "cmd.exe /c "git status""

Unfortunately I just noticed a small issue with it: a side view is created even if you don't choose to show a console. I added an issue for this.

3. To be honest, I don't really know what it takes to create a Terminal side-view in oXygen. I just imagine that the easiest way to do it would be to use an existing terminal (such as Command Prompt) in the background for running the commands, while providing the input from and showing the output in oXygen's GUI.

Such a terminal can be implemented as a plugin. Do you need this terminal to run Git commands that are not covered by our Git plugin? Or for something else? As far as we remember, you usually configure External Tools for the git commands that are not covered by the plugin. Do you want to replace that part?

All the best wishes,
Sorin Carbunaru
oXygen XML
Post Reply