‘Ubuntu’+‘Atom’+‘gcc-make-run’更改调试终端为Gnome-terminal
2017-06-28 09:49
726 查看
‘Ubuntu’+‘Atom’+‘gcc-make-run’更改调试终端为Gnome-terminal
0、为什么
在Ubuntu下安装了gcc-make-run插件后对C/C++代码编译运行。默认打开的是X-term,很丑而且。。。。。。算了就是很丑。1、Ubuntu安装Atom
通过PPA安装sudo add-apt-repository ppa:webupd8team/atom
sudo apt-get update
sudo apt-get install atom
2、相关插件的安装
2.1安装npm
sudo apt-get install npm
2.2命令行安装插件
windows:cd Users/用户名/.atom/package
ubuntu:
cd ~/.atom/package
如果package文件夹不存在可以自己新建一个
git clone 插件的github仓库目录 cd 克隆下来的插件目录 npm install
2.3部分插件github仓库目录
atom-simplified-chinese-menu插件(汉化)https://github.com/chinakids/atom-simplified-chinese-menu
gcc-make-run插件(C/C++编译插件)
https://github.com/tomlau10/gcc-make-run
linter-gcc插件(C/C++代码风格美化插件)
https://github.com/hebaishi/linter-gcc
linter插件
https://github.com/steelbrain/linter
3、修改配置文件
atom ~/.atom/package/gcc-make-run/lib/gcc-make-run.coffee
修改下列代码对应的部分,没接触过coffeescript,但是根据代码英文字母也能猜出来实际上就是修改
when 'linux'...后面的代码内容。
buildRunCmd: (info) -> # get config mk = atom.config.get('gcc-make-run.make') info.env = _extend({ ARGS: atom.config.get('gcc-make-run.args') }, process.env) if info.useMake switch process.platform when 'win32' then info.cmd = "start \"#{info.exe}\" cmd /c \"\"#{mk}\" -sf \"#{info.base}\" run & pause\"" when 'linux' then info.cmd = "gnome-terminal -t \"#{info.exe}\" -x \"" + @escdq("\"#{mk}\" -sf \"#{info.base}\" run") + "; read -n1 -p 'Press any key to continue...'\"" when 'darwin' then info.cmd = 'osascript -e \'tell application "Terminal" to activate do script "' + @escdq("clear && cd \"#{info.dir}\"; \"#{mk}\" ARGS=\"#{@escdq(info.env.ARGS)}\" -sf \"#{info.base}\" run; " + 'read -n1 -p "Press any key to continue..." && osascript -e "tell application \\"Atom\\" to activate" && osascript -e "do shell script ' + @escdq("\"osascript -e #{@escdq('"tell application \\"Terminal\\" to close windows 0"')} + &> /dev/null &\"") + '"; exit') + '"\'' else # normal run switch process.platform when 'win32' then info.cmd = "start \"#{info.exe}\" cmd /c \"\"#{info.exe}\" #{info.env.ARGS} & pause\"" when 'linux' then info.cmd = "gnome-terminal -x bash -c \"#{info.dir}/#{info.exe} #{info.env.ARGS} ; exec bash\"" when 'darwin' then info.cmd = 'osascript -e \'tell application "Terminal" to activate do script "' + @escdq("clear && cd \"#{info.dir}\"; \"./#{info.exe}\" #{info.env.ARGS}; " + 'read -n1 -p "Press any key to continue..." && osascript -e "tell application \\"Atom\\" to activate" && osascript -e "do shell script ' + @escdq("\"osascript -e #{@escdq('"tell application \\"Terminal\\" to close windows 0"')} + &> /dev/null &\"") + '"; exit') + '"\'' # check if cmd is built return true if info.cmd? atom.notifications.addError('gcc-make-run: Cannot Execute Output', { detail: 'Execution after compiling is not supported on your OS' }) return false
相关文章推荐
- codeblocks中更改gnome-terminal终端调试方法
- Ubuntu 13.10 安装Terminalx 后更改默认终端设置
- ubuntu下code::blocks更改调试终端
- ubuntu下codeblocks编译器更改调试终端
- Ubuntu下CodeBlocks更改调试终端
- Ubuntu下CodeBlocks更改调试终端
- ubuntu下codeblocks更改调试终端
- 在ubuntu中更改默认的gcc和g++
- codeblocks更改调试终端
- ubuntu直接在当前目录下打开终端terminal的方法
- 小红旗+R启动 控制台终端(Gnome Terminal) - Fedora 16
- ubuntu 11.10 如何打开terminal(终端)
- windows下建立gcc/g++/gdb/make编译及调试C/C++的IDE环境
- Linux 0.11 在ubuntu-11和gcc-4.6.1下编译调试至正常运行的过程详解
- ubuntu下调试android手机,并进入手机shell终端
- ubuntu 终端(Terminal) 常用等宽字体
- ubuntu直接在当前目录下打开终端terminal的方法
- Eclipse远程开发调试Linux应用程序,Eclipse+cdt+Uniwin+Ubuntu+gcc+gdb,打造超级Linux开发平台
- Ubuntu下启动终端(terminal)的快捷键
- Fedora 12中更改Code Blocks调试终端