[CQ32] Make any build system interactive with Terminus!
HTML-код
- Опубликовано: 27 сен 2024
- Sublime Text allows you to execute any external program that you want, which is used to power build systems. This is a great way to build and run your software while you're writing it, but it doesn't support interactive builds. Until now.
Terminus is the package for injecting a terminal directly into Sublime Text. It's freely available, works across Windows, MacOS and Linux. In this video, we cover easily converting any existing build system to use Terminus, making interactive builds easily obtainable in Sublime.
Sublime Configuration: git.io/fARZ9
Official Build Documentation: www.sublimetex...
Terminus Package: • [PPR06] Terminus
Origami Package: • [PPR05] Origami
Build System Videos: • Sublime Build Systems
Watch live streams: odatnurd.net/live
#SublimeText #CommonQuestions #Tutorial #BuildSystem #Terminus
Subscribe for more videos: www.youtube.co...
Subscribe for more Sublime live streams: / @terencemartinlive
Follow me on Twitter: / odatnurd
As of the time of this recording, an issue has been uncovered in a library that the Terminus package uses which makes some build systems using "shell_cmd" fail on Windows. Randy has already identified the error and a fix is on the way (I used it to record this video).
If your build doesn't work, you're on Windows, and you're using "shell_cmd", this might be the reason why. The current workaround is to modify your build to use "cmd" instead of "shell_cmd" though the fix will likely be out soon.
Leave a comment if you need any help converting your build system, and remember to Have a Sublime Day!
Great video. I have released 0.3.12 and hopefully, it doesn't break any existing usages. By the way, I believe F4 (Next Result) and Shift-F4 (Previous Result) do work. In order to go to the first error, a user would need to click the first line and hit F4. (Edit: it wasn't needed for the built in build system because the view doesn't scroll automatically)
@@randylai-yt ooh interesting. It didn't seem to work when I tried it, but I was a little or of it due to being sick so I probably did something wrong 😁
22:00 to end what are you explaing about ?
@@OdatNurd help me out with it
@@victordvickie I'm not entirely sure what you're asking; can you be a bit more specific?
Every time I thought "Wow, thats neat, but it could be better" you immediately went into how to improve that part. This has probably just 100x my productivity. Incredible tutorials sir.
Awesome! So glad I could help out!
One thing I liked was the simple example code, which makes the tutorial easy to follow, and the step by step implementation of the build.
Just started doing some Udemy training in C and really wanted to use Sublime Text with the class. Now I don't have to use some other IDE, thanks to you I can build within Sublime Text without having to switch tabs. Thanks, and the detail was very helpful to understand how Sublime Text works as well. I'll be checking out more of your videos!
Glad it was helpful!
This video is filled with extremely helpful and perfectly explained sublime tools! Thanks a lot for saving me time and making me more productive!!
Great to hear and glad to help!
@@OdatNurd You're awesome! thank you for making these vids!
thank you very much i was looking for this since many months ago. But today I got this. Thanks
Glad I could help out!
Thank you so much for this video! It's extremely easy to follow, and gets straight to the point.
Awesome, glad to help!
my C++ class wants us to use visual studio which is great, but it slows down my computer alot. Sublime text is great in the fact that it is so lightweight, and following this tutorial I was able to get it set up with C++. Thanks man!
Thanks so much for the support! Glad I could help!
just wanted to let you know that thanks for such a helpful vid, i followed some other tutorials for terminus however they didnt work for me, buy your vid helped me finally get it done right, i also added some of your custimazations to my own such as opening output in a seperate tab etc. Thanks for the help 👍
Awesome, so glad I could help!
OdatNurd, your channel is SUBLIME!
Thank you so much!
Holy Moly!!! Super informative, so advanced fire and super f**king clear. Thank you so much OdatNurd, I loved it .
Awesome!
Thank you, this was really helpful and straightforward! Looking forward to watch more of your videos!
Awesome, glad I could help!
Thanks. This was insightful for helping me run small Python automation programs out of Sublime Text. Helpful!
That's great to hear, thanks!
Excellent video, very thorough. Very little fluff. Thank you
Thanks, glad I could help out! :)
Thank you so much for this video! I was trying to configure all these steps without any success!
Glad it helped!
So much work simply to get user input but i finally did it lol. Sublime looks so much cooler than Mu
Nice work! It can take a little bit of extra work to get Sublime set up just how you like it, but the reward is a tool that's customized just for you. :)
very cool, coming from code blocks and this is exactly what i was looking for
Glad I could help! :)
Thank You!! It's beautifully explained!
Glad you liked it!! :D
Very helpful, thank you!
30 minute video for 3 minute process ~SMH~
1 - install Terminus from package manager
2 - add (to your build file)
"target": "terminus_exec",
"cancel": "termnus_cancel_build",
3 - done
Thank you very much. It helped me a lot.
Glad it helped!
hey OdatNurd I have two column view 1st column for code editing and 2nd one for running terminus. Most of the time I open file in terminus using the command "subl 'filename' " which opens a file in the terminus column ie. the 2nd column. What I have to do to open a file only on the 1st column while running "subl 'filename' " command in the terminus coloumn?.
Hi I followed the tutorial up until 11:10. Unfortunately I did not get the terminus window. I am able to see the Python Terminus option under Tools/Build System and Build with Terminus. Nothing happens when I choose to build. This is what I have.
{
"target": "terminus_exec",
"cancel": "terminus_cancel_build",
"shell_cmd": "python -u \"$file\"",
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python",
"env": {"PYTHONIOENCODING": "utf-8"},
"variants":
[
{
"name": "Syntax Check",
"shell_cmd": "python -m py_compile \"${file}\"",
}
]
}
I should also mention that the color scheme did not update. Everything is yellow. Under the view tab I have Python syntax selected. My sample code is properly colored.
I also tried changing "shell_cmd" to "cmd".
I am on Windows 10 and Sublime Version 3.2.2.
Hmm.. that looks like it should work. Do you see any errors in the Sublime console when you run the build?
@@OdatNurd There were no errors in the Sublime console. It just seems like nothing happens. Since I was in a crunch for setting up an interactive terminal, I ended up installing SublimeREPL. Although the functionality is different than that of Terminus.
I can’t get terminus to open in a split view with post window hooks. Everything else works though so I’m not sure what’s happening.
Do you have the Origami package installed?
Thanks, man.
Glad to help!
Is there a way to add a :close" widget on the terminal panel when its side by side since its a bit of a hassle to use the drop down menu and then delete using origami
There's not a way to add a widget to it, but it would be possible to set up something like a key binding that not only closes the terminal but also swaps back to a single column layout (or destroys the current pane) so that you don't have to take that action manually. Does that sound like what you're trying to do?
@@OdatNurd yeah that does, how do I accomplish that?
There are a few ways to do it, depending on if you use the Chain of Command or Multicommand packages or if you use neither (in which case you need a simple plugin). I put some examples and an explanation at the following link. Please let me know if it works for you. :) git.io/JqJCG
I've applied the instructions in this video, I was able to get a pane for my terminus but it keeps opening as a tab without actually splitting the screen. My aim is to get both the code and the output visible side by side. Please, what could be wrong?
Do you also have the origami package installed?
when i switched to terminus_exec, sublime no longer show errors inline in my code, i can click on the path and it points to the right line / column in the code, but there is no red stuff that shows the error anymore, what could it be?
The thing that knows how to show errors in the code after a build is the exec command. Terminus doesn't currently support doing that, which is why using it to build stops you from being able to see errors like that.
My terminal is not opening 😔 I did same steps.. Earlier normal build was opening by ctrl + B
But now it is not doing anything.. Plz Help
Do you see any errors in the sublime console? Did the status bar tell you there's no build system when you try to build?
Is there a keyboard shortcut to open terminus directly from sublime? Right now, I gotta do command+shift+p and then search for terminus.
There's not one by default, but the readme shows you how to add one.
Do you have a tutorial for key-bindings to make Terminus automatically grab the current working directory for the file? I found James231 key bindings, but they seem to be for Windows and I'm on Linux. Right now, toggling the Terminus panel takes me to the root directory of my PC
There's an example of a binding that does that in the Terminus README; it will go to the folder the current file is in or if there's no current file, the first open folder. Does that one do what you want?
Is it possible to specify a variant of the build system as a normal exec command build?
I have a project build setup and the "normal" build (compile all) is a terminus build. I also want to start a build variant which just use the sublime default exec command.. Because I already defined "auto_close" to false, it will complain in the variant about that... Of course I could create another build system for that variant, but then it doesn't pup up with crtl+shift+b as a variant fur that build system...
I've never attempted anything like that myself, but something to try would be to set the `"target": "exec"` (and if you specify the `cancel` key, also `"cancel": {"kill": true}.`) in your variant, and for any build keys like `auto_close` in the outer build that `exec` doesn't support, add them to the variant and set their value to `null`. If that doesn't work then a simple shim plugin that filters keys that `exec` doesn't understand could do the job.
every single comment has been answered, gotta say that is something really surprising
Thanks, I try! Sometimes RUclips is not very forthcoming with notifications of comments though. 😁
I have a new MacBook (M1 Pro). When I try to run a script on Terminus with module import called "goose3", I get the error below:
.../PIL/_imaging.cpython-38-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))...
Does anyone know how to fix this issue? I'm using Sublime 3. Tried on Sublime 4, Terminus works fine. No error in integrated Mac terminal as well.
It looks like it's going to use a library that's for the wrong architecture. To run ST3 on that system you would need to use Rosetta; my guess would be a problem related to that .
is it normal that my python package aint highlighted like yours?
The highlight that you see would be distinct if you don't use the same color scheme as I do. Also as Sublime development goes on, the color schemes and syntax definitions get more refined. So it's possible
how can i make java work with terminus, so i can give command line inputs?
For this you want a build system such as the one in this link (forum.sublimetext.com/t/java-build-system-not-working/25745/2?u=odatnurd). This build can compile and then execute a single-file Java program, so just adding in the appropriate "target" key as outlined in this video and you should be up and running.
Wow, so sick! Is there is a way to start the terminal in the current opened files folder?
From a build system you can include "working_dir": "${file_path}" to have the working directory set to the path of the current file (use ${folder} instead for the first folder open in the window. For a regular terminal, the key binding you use can also include that key ("cwd" can also be used; it's an alias for "working_dir"). The README for Terminus has some example key bindings that show how to do that: packagecontrol.io/packages/Terminus
@@OdatNurd Thanks!
Such a helpful video. I use this everytime I set up SublimeText on a new computer. The last couple times I've done this, I was able to go to 'Build With' and select from the list (which contained the original build system and the added Terminus build) just like you're able to do in the video. For whatever reason this time (it is the first time doing it on a Linux device), I have to choose the Build System each time from the drop-down menu, and then 'Build With' will only show that specific build (Terminus if it's Terminus, or the original if I select it). Do you have any idea why that might be happening?
The Build With command tries to show you a list of all of the relevant builds, but when you set the current build to a specific build system, the only builds that it can infer are any named variant builds inside of the sublime-build file.
You should not have to re-select the build in the menu every time though, unless you are closing and recreating the window. Are you using Projects at all, for example?
No, I'm not using Projects. One thing I haven't tried is to set the build system to Automatic and then go to "build with".
For further clarification, I think it's at 10:27 in your video, when you press the key command for build or build with, the command pallete box shows a drop-down with the regular Python as well as Python Terminus. Mine will only show Python if I choose the Python (standard) build system, or Python Terminus if I select that build system. In the past, I always got the same list yours is showing with both options. Not a huge deal, I was just wondering what might be different. Perhaps if I set to 'automatic' in build system it will allow for the multiple choices again?
@@220SouthlandAve Yep, I would think so. Build WIth only shows you possible candidates based on the current situation, so if you set a specific build from the list, the options are constrained to just those. Normally, you want it set to Automatic except for specific situations, such as project specific builds that are presumably more custom to that project.
@@OdatNurd Awesome. Thanks again
while using the tab functionality . whenever I build my file .. the sublime jumps on to the next file that is opened instead on remaining on the file .. is there any keyword I have to include in my build file to change the things to do so ? Pls help ! Thanks in advance !
I'm not entirely sure what you mean; when you execute the build is the focus jumping to the Terminus view or some other view? Or when you press the tab key the focus changes to a different tab in the window?
@@OdatNurd I mean to say let say I have 2 files open right now in my sublime file 1 and file 2 and now I want to build the file 1 .. I press Build file and it does build .. but also with that it jumps to the file 2 instead of remaining on file 1
@@OdatNurd I have the same problem. When I press CTRL+B (or from the menu) it switches to the tab on the right of the current one.
@@0xB8xor0xFF Hmm interesting. I don't think I've seen that before. Are you using the setup that runs Terminus in a tab to the right? What build of Sublime are you using? With that I can try to replicate it and see what's going on.
Tell me pleace, how to solve this problem. Terminus does not start from the virtual environment. Even if you specify the path to the interpreter ("D:\\python_work\\alien_invasion\\venv\\Scripts\\python"), the terminal is freezes. I tried examples from the documentation site for Key Bindings, Build System. still won't start..
Do you see any errors in the Sublime console?
@@OdatNurd No. No any errors. The interpreter just doesn't work. Or hanging. I tried it on windows and linux. although a similar design works for REPL
{
"shell_cmd": "source /path/to/your/virtualenv/bin/activate && python -u \"$file\"",
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python",
"env": {"PYTHONIOENCODING": "utf-8"},
"target": "terminus_open",
"cancel": "terminus_cancel_build",
"variants": [
{
"name": "Run",
"shell_cmd": "source /path/to/your/virtualenv/bin/activate && python -u \"$file\""
}
]
}
This code for Build System suggested me to use chatGPT-4. And it partially works on Linux! I'll keep digging!
chatGPT forgot to add the line: "cwd": "${file_path:${folder}}", after that everything worked as it should!
{
"target": "terminus_open",
"selector": "source.java",
"shell_cmd": "javac \"$file\" && java \"$file\"",
"cwd": "C:\\Program Files\\Java\\jdk-15.0.1",
"auto_close": false,
"panel_name": "java_run",
"timeit": true
}
Can anyone tell me why my java build system does not work for multiple java files?
The command line in the "shell_cmd" is specifically trying to compile and then execute just the file that you're currently editing (represented by $file). To work with multiple files you would need to extend it to also include other Java files as well. The best way to do that is probably to use a Java specific build tool such as Gradle, Maven or Ant.
great video!!
@OdaNurd I have a question: where I can set my virtual env?
I need to build in terminus with a specific venv
I don't use Python very much outside of plugin development in Sublime, but I think that when you set up a virtual environment in a folder it ends up with a `bin` folder inside of it that will include a `python` that knows to run in that environment.
If that's the case (it's been a while) then I think the easiest way to do this is to modify the `shell_cmd` or `cmd` you're using so that instead of being just `python`, it's `/path/to/venv/bin/python` instead. If you're on Windows. remember to double up the \ characters in the path (or use / instead; Windows is fine with that).
Hey, thanks for the great video!
Thanks!
How to change the stuff of path? I couldn't get it to choose terminus or python to execute....I am just a beginner sorry...
No worries, I'm sure we can get you sorted out. Can you explain a bit about what it is that you tried that didn't work?
@@OdatNurd my python terminus have a permission error when i run
@@OdatNurd And i don't know the setting at the end of video
I tinker with Sublime and love the speed, but I can’t make the switch. The simplest things require tedious and lengthy research, and even at that it many times the research fails to work in sublime.
Example: setting up debugging for Python beyond print statements and logging (old school)
Thank you for posting this as it helps get a little better debugging capabilities from Python in Sublime.
I really wish I could get the graphical debugger package to work, but it never lets me select a configuration and the manual configuration docs are deplorable.
I know how you feel on that; I owe a video on this on the channel but in my own playing with it (during a live stream) I did not find it particularly intuitive to set up either, so I need to play with it more.
Just wanted to follow up and say thanks. Now that the Terminus plug-in is working, I can finally use Sublime! I can use the pdb debugger, interactively, which is awesome. The issue prior to that was getting the venv to work in my build system. It works now, I'm just not exactly sure why it works, something to do with pathing.
Flake8 is working properly as well. It would be nice to get the ability to see attribute and method predictions for functions and classes, but I'm afraid I'm going to break what I have . . . .but it soooo nice to have a fast editor, maybe it's best to just stick with the basics.🙂
Thanks!
Is there is a way to quickly clean-up the terminal? Like a Command+K shortcut?
That depends; what do you mean exactly by cleaning up the terminal? Closing it or clearing the contents?
@@OdatNurd clearing the contents
@@AndreyAzimov Terminus contains a "terminus_send_string" command that can send a string of text to the terminal. Using that in a key binding, you could send a string like "reset
" or "cls
" (depending on your OS) to do a clear. That would only work if your terminal was sitting at a command prompt, though.
pls help me it doesnt work and I dont know why I click the "show console" in the view tab and there is a repeating error there like this.
ERROR:root:Your operating system denied the spawn of /usr/local/bin/python3 process. Make sure your configured interpreter is a valid python binary executable and is in the PATH
I've never seen an error like that before that I can recall; does trying to execute that version of Python work from your terminal?
@@OdatNurd I re install my sublime and now my error in console is this
Unable to find target command: terminus_exec.
Thank you for the response
@@paologonzales4361 that error indicates that you haven't reinstalled terminus.
@@OdatNurd ohh how would I do that? sorry Im very new to this
@@OdatNurd its ok now. Thank you very much
hi there, thanks for the useful video. do you know if that would be possible to stay in the same terminal window when rerunning a code or running another one (without Terminus opening up a new window every now and again)?
This is indeed possible; see this video for how: ruclips.net/video/HaH3U53UvcY/видео.html
Thank you for making this helpful video. I followed both this and the video titled Terminus.
ran into a problem, need help - I can't call any function code, as simple as;
def a(x):
'''
x: int or float.
'''
return x + 1
a(3)
the output is nothing at all
I'm on windows and I use "cmd"
the problems seems to be just for "calling" function codes and nothing else
Your code doesn't contain any print statements, so it doesn't generate any output to be displayed. You may be used to using a REPL environment where calculated values are automatically printed, but executing python scripts doesn't behave the same
You're right! now I understand.
Thanks ever so much!
Awesome! It's a fairly common problem to run into when you're starting out 😁
Wow,thats what i wanted.iwant this terminal for my sublime text which is interactive and better than repl.how can i get that
This video tells you how to make a build system interactive with the Terminus package. If you're new and don't know what Terminus is, I also have a video that talks about that as well: ruclips.net/video/mV0ghkMwTQc/видео.html
Do you have any idea why when i include terminus in my build, my build won't work? But when i don't include terminus, it's allright
Do you see any errors in the console? There are a couple of build keys that can be used in standard builds that Terminus doesn't like. If you're using those you'd see an error in the console, for example.
@@OdatNurd the build just won't show up.
May be that's because i've installed some packages or my linux package updates make it happen. i just don't know
If the build doesn't show up in the menu until Tools > Build Systems at all, then it's either not got the right extension (sublime-build) or it's not inside of a Package. Any file that meets that criteria shows up, even if it's not a valid build (in which case you see a "No Build System" error appear in the status bar when you try to build).
@@OdatNurd Now it's working again, i don't know why
May be restarting the os makes it work again
thanks for your help
@@onimekyo7633 Glad it's working for you!
amazing video man! you've been a great help
also can you tell me what color scheme you're using? I'll be grateful ^_^
Thanks! In Sublime Text 3 I use Monokai as my color scheme. In ST4 I've switched to Mariana since it's the new default there, but that's only visible in the newer videos.
Great thanks
No worries!
I've been having issues getting python files to run from their own working directory. In my "cmd" I'm just calling python -u $file as you have in the video. When I do this in a non-terminus build, I can print the current working directory in a python script and it's correct.
However, when I do this in a terminus-build like you have here, it prints out my HOME directory (on a mac), regardless of where the file I'm running is located.
Are you aware of any way to fix this? Thanks for the video!
The current directory can be set by adding "working_dir": "$file_path" to a build, which sets it in this case to the path of the current file. However if you don't include this key, Sublime does this by default so long as the file that's current when you execute the build is saved to disk (which for Python it must be). So if that's not happening for you here, you might want to double check your shell startup scripts to see if they have something like `cd ~` in them or something that would alter the current folder when the shell starts up.
how to switch between terminus and code
This was asked recently in the forum; check here: forum.sublimetext.com/t/terminus-keybinding-to-focus-on-texteditor/59356/5
Do you have a tutorial for mac os as well? Sadly, I can't make it work.
Terminus should work identically across all platforms (I use Sublime on all of them). What problem are you having?
@@OdatNurd I'm new to sublime, probably I did not install the correct python 3 build system. I don't have the same build like yours. So If I copy the exact build system you have, would it work on mine?
@@PeaceWalkerify The example I was using was taken directly from the files that ship with Sublime; does yours not look like that?
Great thanks ;
what about sublime text 4 isnt support interactive builds ?
Nothing has changed in Sublime Text 4 regarding supporting interactive builds out of the box, so you still need to use something like Terminus or SublimeREPL for that.
@@OdatNurd Thank you for the information ^^, hope that Terminus will be installed natively in sublime text 4, because easier to install in a classroom that is not connected to the internet, view that it is impossible to add manually (somethink like adding Terminus package without internet connection).
@@nairiridha8643 It's possible to install Terminus manually, but installing packages that use dependencies manually can be a bit of a trial if you're not familiar with the underpinnings of the sytem.
Hey man, great video! for some reasons on terminus I'm getting a different version of python. It's 3.9 on Mac terminal, 2.7 on terminus. Even if I activate a conda env it loads the wrong python version. Do you know why that could be the case? Thanks :)
Something like that sounds like a PATH problem; something to note is that you might be using zsh as your standard interactive shell, but Sublime and determinist use bash to execute commands. So it may not be picking up the path that you expect.
Thank you very much, this valuable info would be the same with other programming language like C or Rust
You are welcome!
Out of a topic question. How to open 2 terminals using terminus in sublime text 3 pls?
You should be able to choose "Terminus: Open default shell in tab (view)" or "Terminus: Open default shell in panel" commands as many times as you like to get extra terminals. If you create them in panels, you need to use the Panel Chooser menu (click the icon on the far left side of the status bar) to find the panel you want.
Thank you for the video. I just got Terminus build started for Python on ST4 following your video. But I have noticed that when use the "PATH": "$PATH;C:\\XXX\\PY39" in the env option I am getting the following message even though the program executes after that. I am on WIn10 machine. Is there a mistake on my part
"DOSKEY' is not recognized as an internal or external command,
operable program or batch file."
Sounds like there might be some sort of startup script getting executed too. I would guess it's trying to use DOSKEY because it thinks it's setting up an interactive terminal. Do you see the same message if you start a command prompt manually?
@@OdatNurd No I don't see the same message when I start the command prompt manually
Bro I have a few doubts pls reply for example if we write a infinite loop and when I run it and it goes on forever in the
terminal panel what shortcut should I press to cancel the build? How do you also kill the terminal and clear the output
like reset it pls explain?
Thank you for the video
It really helped a lot
Keep going :)
If you're running something in a Terminus tab, you can just close the tab to stop the program; if you're working in a panel, then choose `Tools > Cancel Build` from the menu or command palette. Clearing the terminal is the same thing you would do in any other terminal; use `cls` if you're on Windows or `reset` if you're on Linux/MacOS to clear it. Note however that if you're actively running a program, you can't get it to arbitrarily clear the console unless the program you're running has such a feature built in.
@@OdatNurd Thank you so much, I want to ask some thing else as well what is the view package file in sublime text used for? and also for example now that I have got my terminus setup for python if I want to set it up for java for example can I just find the build file in view package file pls explain? pls don't get annoyed I'm asking doubts I know that you don't have time and you have to maintain your channel but just help me I'm new to sublime.
Bro reply!! I'm on windows
@@samuelkoshy1378 VIew Package File is used to look at the contents of a package file without having to know where it's stored, since there are several places they can live. Also, the build system that comes presupplied with Sublime for Java just compiles a single file, but doesn't run it. To use Java with Sublime you need to know enough about Java to create your own build system first.
@@OdatNurd
Thank you Understood, Your the best
how to work with different envroments??
Terminus does the same thing that you would do in a terminal; every build is like you opening a new terminal. So if you wanted something like a specific python virtual environment for example your `shell_cmd` would need to be something like `activate_environment && python thething.py` or similar.
Or, you could possibly use a fully qualified path to the appropriate Python interpreter directly in the `shell_cmd` to save that step.
@@OdatNurd Thanks I created a python file that 'creates build system for each virtual environment in env folder and removes them if virtualenv is deleted'.
Thank you so much for your videoss.
The "timeit" command does not work for me, but every other thing does.
Glad to help! In what way doesn't timeit work?
I can't find "Terminus" on package control
Are you running a recent version of Sublime Text? Terminus is available for all platforms, but it requires build 3160 or later (essentially version 3.1).
Great video, but I do feel that you can shorten the length of the video to some extent (perhaps down to 10 minutes) by only pointing out key information. It makes it easier for you to make more videos and easier for us to digest the information. I personally like the videos of Corey Schafer, as they are concise and to-the-point.
Thanks for the tip! I'm working on shifting everything to this sort of content layout at the moment. :)
Awesome clip! Everything works superb! The only "problem" I have is that I can't double click on an error to get to it. Is there something I might have missed?
That requires file_regex and/or line_regex to be set to something that will match the errors; did you copy from an existing sublime-build file?
@@OdatNurd Hmm not sure I understand, sorry just started to learn how to code/script. This is what my "regex line" looks like:
"file_regex": "^[ ]file \"(...?)\", line ([0-9]*)",
@@plantchargedgames That looks like something meant to match Python errors. The regex is case sensitive, so that might be a reason why it's failing. I'd try this:
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)"
@@OdatNurd Oh man you are the best, works like a charm! Thank you! :)
Every time I press 'ctrl + b' it opens a new tab in the side panel. Is there a way to make it close the previous tab when I press 'ctrl + b'?
edit: Hopefully this makes more sense. Is there a way to make "target": "terminus_exec" open to the right.
Or make "target": "terminus_open" act like "target": "terminus_exec" where every time you press 'ctrl +b' it just refreshes the panel?
edit 2: I'm just going to use the terminus_exec..
Great video, it helped me loads even thought it took me over an hour to get it to work aha! Came here from forum.sublimetext.com
Hi David, sorry I didn't notice this earlier; my notifications are going a bit wacky lately. I had something like this working at some point in the past when someone asked, but I can't seem to find the solution that I had at the time. It was back before 'terminus_exec' was available, though. This seems like a good topic for a follow up video!
@@OdatNurd Yes please.
@@itsgunship1629 David, I was runnign the same issue and I just find a solution!!. In the "pre_window_hooks" you can add commands for closing and opening terminals or Origami panes. I uset this:
"target": "terminus_open",
"auto_close": false,
"cancel": "terminus_cancel_build",
"focus": true,
"pre_window_hooks": [
["destroy_pane", {"direction": "right"}],
["terminus_close_all"],
],
"post_window_hooks": [
["carry_file_to_pane", {"direction": "right"}]
],
So whenever you press CTRL+B all the terminals instances will close and the origami pane will close too. Then everything will work as usual
@OdatNurd - Sublime Text Tutorials THANKS FOR THE VIDEO YOUR ARE AWESOME!
Thank you so very much for this video and many others that you have done. They have been fantastic resources for me whilst working in Sublime Text. I just have a simple question.... At this point in the video: ruclips.net/video/etIJMVIvVgg/видео.html you use a shortcut to close out of the build window and then can see an empty pane in the background. I have tried using the 'esc' key though nothing happens. When I have the terminus set to terminus_exec I can use the 'esc' key to close out of the build window at the bottom of the screen no problem though when I use terminus_open to have the window show in a new tab on the right hand side "esc" just seems to do nothing and I have to manually move my mouse up to the 'x' to close the build window. (This is after the build completes and the timit shows the time duration. ) Any ideas here? I have Origami installed and I'm thinking there might be a setting messed up? THANK YOU for your time and help!
Thanks for the kind words!
I have a key binding like the following (which is outlined in the Terminus README). The example uses ctrl+w because that's the key that's used to close tabs (on Linux/Windows), but you can use any key you like:
{
"keys": ["ctrl+d"],
"command": "terminus_close",
"context": [{ "key": "terminus_view"}]
},
@@OdatNurd This is perfect. Thank you so very much! I should have read the README! :)
@@DanielGajeski Haha, the important thing is, it's working :)
Hi my frend, thank you for this best video about sublime!!! Please say me, how i can with terminus save file in directory with my progs? Not in user directory?
To fix that you need to add a "working_dir" key in your sublime-build file to tell Sublime/Terminus to change the current directory to a specific directory. Without that, Terminus will default to a location you don't want (as you've seen).
A good starting point is to add: "working_dir": "${file_path}",
That will set the location to the folder where the file you're currently building is stored.
@@OdatNurd Thank you!!! All working correctly!
Hey, is there a way to make java interactive with terminus?
I've never used it myself, but starting with Java 9, there's a jshell command that's a REPL environment for Java. It seems to allow you to interactively write and execute Java code, so that could possibly be used for something like this.
Hey! This video was really great, I was able to enable it successfully, but how can I run commands in the terminal? Like python3 manage.py runserver for django? Thanks a lot!
I'm not familiar with that package in particular, but if there's a command line that you would normally execute from a command prompt you should be able to use "shell_cmd" to execute the same command that you would in a terminal. If you need it to be interactive you can also just use Terminus to open a terminal directly in Sublime and execute your commands there instead,
@@OdatNurd oh wow, is there like a tutorial for this?
Muito bom cara muito bom mesmo, tem uma galera ai no youtube que é so conversa fiada
Estou feliz que você achou o vídeo útil!
Terminus is great. "target": "terminus_exec" works as expected.
I would like to send the output to a panel (like in your example).
You change exec to open "target": "terminus_open",
But, this does not work (nothing happens when I press Ctrl-B).
{
"target": "terminus_open",
"cancel": "terminus_cancel_build",
"focus": true,
"auto_close": false,
"title": "D Output",
"cmd": ["rdmd", "$file"],
"working_dir": "$folder",
"file_regex": "^(.*?)\\(([0-9]+)(,[0-9]+)?\\)",
"selector": "source.d",
"syntax": "Packages/D/DMD Output.sublime-syntax",
}
Do you see any errors in Sublime's console?
Nothing. I did have a terminus console open and it only had the startup text. terminus_open seems to do nothing. If I change the target to terminus_exec it works.
When I click Ctrl-B, I see this in the console...
Traceback (most recent call last):
File "C:\Users\Me\AppData\Roaming\Sublime Text\Installed Packages\Terminus.sublime-package\terminus/commands.py", line 29, in
TypeError: run_async() got an unexpected keyword argument 'syntax'
OK, thanks for the help. The syntax line caused an error. I deleted it and terminus now opens in a panel.
@@brucewernick6542 Awesome!
Can you print of all code of this video ?
Do you mean the build system samples? The bulk of the example comes from the built in file, but I can throw up a gist with all of the versions used here.
Does this work with java? Great video tho
It should, yes. The Java build system that Sublime comes with only compiles a single Java file and doesn't run it, but if you have a build system for Java that does both this would work for that as well.
gosh, would be much more helpful as an article.
04:01 build system
Do you have a question about how to find the build system you're looking for in the menu?
stop yapping and get to the tutorial
The consele says Unable to find target command: terminus_exec what did I do wrong :D
Oh, I know why: WHILE : IF NOT INSTALL TERMINUS CAN'T RUN. Yes, i was trying to run something before installing it in the first place :D
@@KaaNxxBlacK 😁 Happens to everyone! Let me know if you have any other issues getting things set up. 😃
haha ....anybody saw the number of dislikes??
The Sublime community is amazing! :)
@@OdatNurd it sure is
You have earned yourself an additional subscriber. I had been banging my head against the wall about this for days. And this is far more convenient and efficient than anything else that I have seen.
Thanks! Glad I could help out, and welcome to the channel! 😁
I got an error in sublime,, when i use python,, in def function if my code will not arrange properly it will break
I'm not entirely sure what you mean by this; do you have a sample of code that's not working?
Thanks!
Thanks so much to you as well!
Hi!
When I select python terminus as my build system, it won't allow me to type in anything; Just the letter ñ, although I can use ctrl+shift+k to clean the terminal. What could be the issue? See my python terminal code below:
{
"target": "terminus_exec",
"cancel": "terminus_cancel_build",
"focus": true,
"shell_cmd": "python -u \"$file\"",
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python",
"env": {"PYTHONIOENCODING": "utf-8"},
"variants":
[
{
"name": "Syntax Check",
"shell_cmd": "python -m py_compile \"${file}\"",
}
]
}
That's a strange problem. The build looks correct; does the same thing happen if you open a terminus terminal and run Python manually in it?
i dont know why but is not working when i press ctrl + b nothing happens btw my build system is this
i found this build system on youtube so i dont really know how it works
{
"target": "terminus_exec",
"cancel": "terminus_cancel_build",
"cmd": ["javac", "$file_name","&&","start","cmd","/k","java", "$file_base_name"],
"path":"C:\\Program Files\\Java\\jdk-14.0.2\\bin",
"shell": true
}
am i going wrong somewhere
can somebody plz help me out plz
Terminus does not support "shell" and "path" as keys in the build. Most likely if you check the Sublime console after running a build you'll see error messages in there related to this. If you check 22:30 in this video, it covers this and how to modify the build to not use those two keys.
Hi! Thank you for the amazing tutorial, i had sucess on creating the build for my SublimeText, but i had quite of a problem while executing some codes.
When i import the OS library and try to use the os.system("shutdown") command, it returns "shuwdown is not recognized as an internal or external command", any idea why this is occurring?
Off the top of my head, that is a Linux only tool and you need to be root to use it so it might not be on the standard PATH. Were you intending to try and shut the computer down?
Hi Mr Martin. I'm still not convinced by terminous, I don't see the point. Using a workspace I have access to terminal a key stroke away and it's "the real terminal", which I can have on full screen for maximum ouput. Can I write bash scripts in terminous, run system apps eg top? ie does terminous have all the functionality of the terminal or am I missing something? Am happy to have my errors pointed out ! There are many cool packages for ST3, but I just don't get this one, what am i missing ? Hope all's well over the pond, ATB 🙂
Terminus is literally a terminal directly inside of Sublime Text; whatever you can do in an external terminal, you can do inside of Terminus. Wether or not that's a useful thing is very much a personalized thing. Some people absolutely insist that they never have to leave Sublime to do anything, others insist that only an external terminal will do, and in the middle are people that find it handy for some things while still using external terminals.
Hi sir, how are you!? I am having problem executing my programs on my terminal, ive followed each steps in this video.. I dont know why my termius doesnt even show up, I have to finish my project too..
Please can you help me
Did you install the Terminus package itself? What do you mean by it not showing up?
what Color Scheme are you using? I'm using Sublime Text 4 and it looks different
In Sublime text 4, my color scheme is Mariana; it's the new default.
I think Ill just save the headache and us vs code like a grownup
The nice thing is, we all have the choice to use whatever tools we think are most appropriate for us.
Can you use terminus to run your c++ code in a separate cmd window? I've been searching everywhere but I still can't make it to work
What do you mean by "separate cmd window"? If you mean in a command prompt external to Sublime, yes (but you don't need Terminus for that, just a regular build system will do it). This link is a link to the playlist on build systems; near the bottom there are videos for executing in an external window for Windows, Linux and MacOS: ruclips.net/p/PLGfKZJVuHW91WyVIitRhcTPD1PTFIPsia
hello, what is the terminus cancel code for c++?? thanks for the informative video btw
You would use the same value as is seen here; that command will cancel all builds started by terminus, it's not specific to the different types of files. The only time it won't have any effect is if you're running your build in a tab instead of in a panel at the bottom of the window. And that case, you have to close the tab to cancel the build.
Hi. Is it possible to remove the message: process is terminated with return code ...
Hello! Sorry for the delay in response; I have not been getting notifications lately. There's not a setting that does this, so to achieve it you would need to create an override on the appropriate file in Terminus that displays it into the terminal. This is assuming that the one you're seeing is one that Terminus is adding and not one that the program you're running is adding on its own before it exits.
I can provide more details on such an override if you're interested in going down that road.
Thank You for this..... but every time when i press ctrl + b it'll open new tab. Can we do like this that ctrl + b open only one tab and every time i update my python code and pressing ctrl + b updating only current tab instead of new one?
Check out this video; it has some examples that show how to get it to reuse the same tab each time which may do what you want: ruclips.net/video/HaH3U53UvcY/видео.html
@@OdatNurd Thank You 🤩
I have a lot of problems when a hard task run in the panel, is too slow
Unless it's something that is displaying a large amount of continuous output, that's not a Terminus specific thing. It doesn't run things, it just shows their output.
Is there any way to cancel build if it exceeds particular time limit, like execution time should not cross that limit.(In order to cancel infinite loop execution by default).
Not in core Sublime, but a plugin can do that. An example of that can be found at the following link. It requires a couple of simple changes to your build to give it the timeout. Note however that it's not compatible with Terminus ; using the custom command would replace Terminus. To do something like this with Terminus you'd need to craft your build such that it executes some external script that both does what you want and also kills itself if it takes too long. github.com/STealthy-and-haSTy/SublimeScraps/blob/master/build_enhancements/timeout_exec.py
@@OdatNurd Thanks for your information.
Good work! Ps how set build output to vertical. I mean the screen will be split into two parts. I am using sublime text 3 in linux
Préférences : to right
How to do that is outlined in this video at 16:45; it requires the Origami package to be installed in addition to Terminus, however.
Your video series are the best by far. Thank you :)
Thanks!
Hi thanks for this awesome lecture. However is there any way to have the terminus terminal open on a separate window? Without having to switch tabs each time you run a build. Thank you
You can open Terminus in it's own window, but build systems interface only with the window in which the file you're building exists; so in a case like that you would need a plugin of some sort to use in your build that would somehow redirect the build to another window. However in that case, you're probably better off just manualy running your program inside the Terminus panel and not using a build system (and in that case, you could also just use an OS terminal instead)