-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathC.sublime-build
More file actions
49 lines (37 loc) · 2.61 KB
/
C.sublime-build
File metadata and controls
49 lines (37 loc) · 2.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{
"shell_cmd": "g++ -std=c++11 -Wall \"${file}\" -o \"${file_path}/${file_base_name}.out\" && \"${file_path}/${file_base_name}.out\"",
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c++, source.cpp, source.cc, source.cxx",
"variants":
[
{
"name": "Run in Terminal",
"linux": {
"shell_cmd": "g++ -std=c++11 -Wall \"${file}\" -o \"${file_path}/${file_base_name}.out\" && xterm -e '${file_path}/${file_base_name}.out && echo && echo Press ENTER to continue && read line && exit'",
// "shell_cmd": "g++ -std=c++11 -Wall \"${file}\" -o \"${file_path}/${file_base_name}\" && gnome-terminal -e 'bash -c \"${file_path}/${file_base_name}&& echo && echo Press ENTER to continue && read line && exit\"'", // for gnome-terminal
// "shell_cmd": "g++ -std=c++11 -Wall \"${file}\" -o \"${file_path}/${file_base_name}\" && xterm -e '${file_path}/${file_base_name}; bash'", // for xterm
// "shell_cmd": "g++ -std=c++11 -Wall \"${file}\" -o \"${file_path}/${file_base_name}\" && xterm -hold -e ${file_path}/${file_base_name}", // for xterm
// "shell_cmd": "g++ -std=c++11 -Wall \"${file}\" -o \"${file_path}/${file_base_name}\" && konsole --hold -e ${file_path}/./${file_base_name}", // for konsole
},
"windows":{
"shell_cmd": "g++ -std=c++11 -Wall \"${file}\" -o \"${file_path}/${file_base_name}.exe\" && start cmd /c \"${file_path}/${file_base_name}.exe & pause\"",
// "shell_cmd": "g++ -std=c++11 -Wall \"${file}\" -o \"${file_path}/${file_base_name}\" && start cmd /k $file_base_name ",
// "shell_cmd": "g++ -std=c++11 -Wall \"${file}\" -o \"${file_path}/${file_base_name}\" && start \"$file_base_name\" call $file_base_name"
},
/**
* 在苹果终端输入exit命令后,竟然不退出,以下解决:
------->终端
-------->偏好设置
------->描述文件
-------->Shell
--------->单shell退出时:
选择:关闭窗口
*/
"osx":{
"shell_cmd": "g++ '${file}' -o '${file_path}/${file_base_name}.out' && osascript -e 'tell application \"Terminal\" to activate do script \"clear&&${file_path}/${file_base_name}.out && echo \\\"Press Enter to exit.\\\"&& read line && exit && exit\"'",
},
"shell": true,
},
]
}