0

The title says it all, build cancel does nothing, command pallet does nothing, keybind does nothing. I have changed the keybind from prefrences with this:

{ "keys": ["ctrl+alt+c"], "command": "cancel_build" },

I have added my own Python terminus build:

{
"target": "terminus_exec",
"cancel": "terminus_cancel_build",
"focus": true,
"cmd": ["python3", "-u", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python",

"env": {"PYTHONIOENCODING": "utf-8"},

"windows": {
    "cmd": ["py", "-u", "$file"],
},

"variants":
[
    {
        "name": "Syntax Check",
        "cmd": ["python3", "-m", "py_compile", "$file"],

        "windows": {
            "cmd": ["py", "-m", "py_compile", "$file"],
        }
    }
]

}

(I am really new to sublime text and also to coding) Thanks in advance. Edit: I am using Windows 10, in python installer I have selected the add to PATH option and changing keybind does nothing. I use this as my test file:

while True:
   print("Stop it!")
Blue
  • 1
  • 2
  • Have you tried changing the key binding? Try `ctrl+alt+shift+c` and see if that works. – MattDMo Jul 20 '21 at 14:33
  • Also, what OS are you using? If Windows, does `py -u filename.py` work on the command line? Dumb question - are you sure you have Python installed and in your PATH? – MattDMo Jul 20 '21 at 14:38
  • Also, can you clarify what you expect to happen versus what does? For example unless you're running a long running program, chances are high that the build finishes on it's own before you can cancel it. Are you trying to stop a running task and it's not stopped, are you expecting the panel to close, etc. – OdatNurd Jul 20 '21 at 18:22
  • @MattDMo I have edited my post, your suggestion didn't work and yes the command you told me to test works on the command line. – Blue Jul 20 '21 at 20:22
  • @OdatNurd I have updated post, check to see what I am trying to stop. – Blue Jul 20 '21 at 20:22
  • Your build looks correct, so at a guess I would imagine that the problem you're having relates to how much faster your program can send data to the console than data can be displayed BY the console; or if you will, because it's spamming so hardcore the cancel probably works but it would take the terminal a while to get to the point where it shows you that the build is cancelled (at a guess). I would try it with something that's not so aggressive, like a program that asks for input., and then cancel the build while it's waiting. – OdatNurd Jul 23 '21 at 00:54
  • @OdatNurd Thank you so much that was the problem I guess. – Blue Jul 24 '21 at 17:36

1 Answers1

0

There was not even a problem, the code I was running was so hard on my system that cancelling took ages. (Props to @OdatNurd for finding it)

Blue
  • 1
  • 2