I’m fairly new to using Sublime Text, and was very fortunate to come across @OdatNurd’s content. With his YouTube video, I was able to set up a Java build environment that works very nicely, and is a lot less resource-intensive than my IDE. Thank you so much for putting your content out there!
I’m using Origami to split the window and bring up Terminus beside my source. The code is compiled and then executed using a single command (I may split this up with variants later). The “problem” I’m encountering is that when testing, I may execute my code several times – and each time I press Command + B, it spawns a new Terminus window.
Here’s what I’d like to have happen:
- If no Terminus tab is open, open it and execute my shell_cmd
- If a terminus tab is open, clear the open shell and execute the shell_cmd within the already-open tab.
I poked around on the Terminus readme, and I see that they have the concept of a “tag”. I’m thinking that I should be able to call the tag, and if it exists, do what I described… but I don’t know how to do that.
Here’s what I have so far:
{
“target”: “terminus_open”,
“cancel”: “terminus_cancel_build”,
“auto_close”: false,
“focus”: true,
“timeit”: false,
“title”: “Java Execution”,
“post_window_hooks”: [
[“carry_file_to_pane”, {“direction”: “right”}]
],
“working_dir”: “$file_path”,
“shell_cmd”: “/Library/Java/JavaVirtualMachines/jdk1.8.0_171.jdk/Contents/Home/bin/javac “$file” && /Library/Java/JavaVirtualMachines/jdk1.8.0_171.jdk/Contents/Home/bin/java “$file_base_name””,
“file_regex” : “^[ ]File "(…?)”, line ([0-9]*)",
“selector”: “source.java”,
“tag”: “Java Exeucutor”
}