在Ubuntu上外部终端与崇高文字2运行一个简单的C程序 [英] Run a simple C program with Sublime Text 2 in external terminal on Ubuntu

查看:583
本文介绍了在Ubuntu上外部终端与崇高文字2运行一个简单的C程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

与建设在Ubuntu崇高文字工作C / CPP第一步。我读到这里和那里,我想出了这个下列工作崇高的构建:

first steps with building and running C/Cpp with Sublime Text on Ubuntu. I read here and there and I came up with this following working sublime-build:

{
    "cmd": ["g++", "$file", "-o", "${file_path}/${file_base_name}"],
    "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
    "working_dir": "${file_path}",
    "selector": "source.c, source.c++, source.cxx, source.cpp",
    "variants":
    [
        {
            "name": "Run",
            "shell": true,
            "cmd": ["gnome-terminal -e 'bash -c \"${file_path}/${file_base_name}; exec bash\"'"]
        }
    ]    
}

是否有特别是在保持终端开放执行完成后?更好的方法

Are there better approaches especially at keeping the terminal open after execution is completed?

任何帮助将是AP preciated。

Any help would be appreciated.

谢谢,
卢卡

推荐答案

它可以在Ubuntu 14.04

It works on Ubuntu 14.04

{
    "cmd": ["g++", "$file", "-o", "${file_path}/${file_base_name}"],
    "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
    "working_dir": "${file_path}",
    "selector": "source.c, source.c++, source.cxx, source.cpp",
    "variants":
    [
        {
            "name": "Run",
            "shell": true,
            "cmd": ["gnome-terminal -e 'bash -c \"${file_path}/${file_base_name};echo;echo;  echo Press ENTER to continue; read line;exit; exec bash\"'"]
        }
    ]    
}

这篇关于在Ubuntu上外部终端与崇高文字2运行一个简单的C程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆