Sublime Forum

How to add custom Timeout in my build system, in sublime text 3, windows 10?

#1

I’ve found a way to add it in Ubuntu, by using the following script:-

{
“cmd”:[“bash”, “-c”, “g++ -std=c++14 -Wall ‘${file}’ -o ‘${file_path}/${file_base_name}’ && timeout 0.5s ‘${file_path}/${file_base_name}’”],
“file_regex”: “^(…[^:]):([0-9]+):?([0-9]+)?:? (.)$”,
“working_dir”: “${file_path}”,
“selector”: “source.c, source.c++”,
“variants”:
[
{
“name”: “Run”,
“cmd”:[“bash”, “-c”, “g++ -std=c++14 ‘${file}’ -o ‘${file_path}/${file_base_name}’ && timeout 0.5s ‘${file_path}/${file_base_name}’ <input.txt >output.txt”]
}
]

but when I tried to modify it for my widows, like this:-

{
“cmd”:[“bash”, “-c”, “g++ -std=c++14 -Wall ‘${file}’ -o ‘${file_path}/${file_base_name}’ && timeout 0.5s ‘${file_path}/${file_base_name}’”],
“file_regex”: “^(…[^:]):([0-9]+):?([0-9]+)?:? (.)$”,
“working_dir”: “${file_path}”,
“selector”: “source.c, source.c++”,
“variants”:
[
{
“name”: “Run”,
“cmd”:[“bash”, “-c”, “g++ -std=c++14 ‘${file}’ -o ‘${file_path}/${file_base_name}’ && timeout 0.5s ‘${file_path}/${file_base_name}’ <input.txt >output.txt”]
}
]

It gave an error, Can you please help me with this?

0 Likes