User forums > Using Code::Blocks

terminal to launch console apps

(1/1)

danielking:
The default terminal of C::B is xterm.
It will spent a "long" time(about 3 seconds, too long for debugging) on starting up xterm every time.
The option of customizing terminal in Settings->Environment is a little weak.
So I wrote a shell script to resolve this problem.

--- Code: ---#!/bin/bash
export ${2:0:34}
cmd=${2:35}
echo `Terminal --hide-toolbars --hide-menubar -T ${1} -e "$cmd"` >> /dev/null
--- End code ---
I use xfce4, so "Terminal" and its parameters are here.
I save it to /usr/bin/cbterm, and then set the "Terminal to launch console programs:" with

--- Code: ---cbterm $TITLE
--- End code ---
I am a newbie to shell programming. This script maybe not very good. But it works.  :D

Navigation

[0] Message Index

Go to full version