崇高なテキストは、プログラム出力ウィンドウをdosウィンドウに設定します

まず、Cコンパイルシステム構成ファイルは次のとおりです。

{
    "shell":true,
    "cmd": "cmd /c g++ -fexec-charset=GBK ${file} -o ${file_path}/${file_base_name} && start cmd /c \"${file_path}/${file_base_name} && pause\"",
    "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
    "working_dir": "${file_path}",
    "selector": "source.c",

    "variants":
    [
        {
            "name": "Run",
            "cmd": "cmd /c && start cmd /c \"${file_path}/${file_base_name} && pause\""
        }
    ]
}

最終的な出力ウィンドウを決定する重要なステートメントはcmdです。

"cmd": "cmd / c g ++ -fexec-charset = GBK $ {file} -o $ {file_path} / $ {file_base_name} && start cmd / c \" $ {file_path} / $ {file_base_name} && pause \ " "、

この文には、ファイルのコンパイルと生成されたバイナリファイルの実行という2つのプロセスが含まれています。

コンパイルするファイルがtest.cで、パスがD:\ code \ test.cであるとすると、上記のコマンドの効果は、cmdウィンドウに手動で入力した次のコマンドと同じです。

g ++   -fexec-charset = GBK D:\ code \ test.c -o D:\ code \ test && D:\ code \ test &&一時停止

説明:

1)-fexec-charset = GBK:cmdウィンドウからの漢字出力を防ぐため

2)cmd / cを開始します:cmdウィンドウを再起動します

 

次に、Pythonコンパイルシステム構成ファイルは次のとおりです。

{
	"encoding":"cp936",
	"shell":true,
	"cmd": "start cmd /k python -u ${file}",
	"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
	"selector": "source.python"
}

 

81件の元の記事を公開 21件の賞賛 30,000回以上の閲覧

おすすめ

転載: blog.csdn.net/qq_33575901/article/details/102513314