Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
A new, lightweight, tabbed GTK2 terminal emulator [Ebuild!]
View unanswered posts
View posts from last 24 hours

Goto page 1, 2, 3  Next  
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
Lews_Therin
l33t
l33t


Joined: 03 Oct 2003
Posts: 657
Location: Banned

PostPosted: Fri Mar 11, 2005 5:00 am    Post subject: A new, lightweight, tabbed GTK2 terminal emulator [Ebuild!] Reply with quote

For latest news, go here
The information in this post is out-of-date


I've been working on it for a while now, but recently decided to port it from GTK-- to pure GTK+. It's now to the point where it will compile and run pretty well, with a few bugs:

    Resizing is wonky. It will resize to greater than it's starting size, but not to less than it.

    The backspace and delete keys will not work properly inside programs (fdisk, etc-update, etc). They work from the programs' perspective, but instead of deleting the character in the terminal it just gives either ^H (backspace) or ^[[3~ (delete)

    I've not added keyboard shortcuts to it yet, mainly because I'm too lazy to. They worked in the GTK-- version, but GTK+'s menu API is deranged.

    There may be memory leaks. Most seem to have been fixed when I moved to pure GTK+, but there may still be some.

    No makefile. There's only one command to make it, but if somebody wants to whip up a Makefile or whatever just post it.


I don't have a website, so here's the code - just copy and paste into Vim (or whatever). Post patches, ideas, or code samples in this thread. You can e-mail them to me if you want (dorrin@gmail.com), but it's an open question if I will even see them for days (I check e-mail irreguarly, at best).

Compile it with:
Code:
g++ -Wall `pkg-config gtk+-2.0 --cflags --libs` `pkg-config vte --cflags --libs` -g terminal.cpp -o main


Source code snipped. See below

Compiling it will give you a bunch of warnings about unused functions - don't worry about those (worry if any other warnings/errors show up). I have a bunch of signal handlers that need pruning, I just made one for every VTE signal and decided to remove some later.

It requires GTK2, pkg-config, and vte. All are in portage.


Last edited by Lews_Therin on Mon Mar 28, 2005 1:54 am; edited 4 times in total
Back to top
View user's profile Send private message
stonent
Veteran
Veteran


Joined: 07 Aug 2003
Posts: 1139
Location: Texas

PostPosted: Fri Mar 11, 2005 6:09 am    Post subject: Reply with quote

Compiles with gcc-04 030505 and ICC 8.0

Compiling with gcc 4 using -Os and stripping the binary makes a 23kb program.

For some reason the icc compiled version starts extremely slow.
_________________
Inspiron 4100 & Sun UltraAXe
Portage on Solaris|Dell Laptop Hacks
The way you feel about organized religion is the same way I feel about organized socialism.
Back to top
View user's profile Send private message
Lews_Therin
l33t
l33t


Joined: 03 Oct 2003
Posts: 657
Location: Banned

PostPosted: Fri Mar 11, 2005 6:33 am    Post subject: Reply with quote

Compiling with 3.4, -Os, and stripping makes a 14k one :P

I wonder why it's slow in ICC...I'll emerge it, hopefully it's my bug and not GTK/VTE's.
Back to top
View user's profile Send private message
stonent
Veteran
Veteran


Joined: 07 Aug 2003
Posts: 1139
Location: Texas

PostPosted: Fri Mar 11, 2005 7:05 am    Post subject: Reply with quote

I can't seem to produce the slowness anymore. It must have been a fluke.

I did a little playing with icc's optimizations and got this.

Code:
terminal.cpp(342) : (col. 32) remark: main has been targeted for automatic cpu dispatch.
/opt/intel/compiler80/include/c++/xutility(1671) : (col. 2) remark: LOOP WAS VECTORIZED.
/opt/intel/compiler80/include/c++/xutility(1670) : (col. 2) remark: _ZSt6fill_nIPP8GTermTabjS1_EvT_T0_RKT1_ has been targeted for automatic cpu dispatch.


compiled using

Code:
icc -Wall -tpp6 -O3 -axK `pkg-config gtk+-2.0 --cflags --libs` `pkg-config vte --cflags --libs` -g terminal.cpp -o main

_________________
Inspiron 4100 & Sun UltraAXe
Portage on Solaris|Dell Laptop Hacks
The way you feel about organized religion is the same way I feel about organized socialism.
Back to top
View user's profile Send private message
Lews_Therin
l33t
l33t


Joined: 03 Oct 2003
Posts: 657
Location: Banned

PostPosted: Fri Mar 11, 2005 7:09 am    Post subject: Reply with quote

stonent wrote:
I can't seem to produce the slowness anymore. It must have been a fluke.

I did a little playing with icc's optimizations and got this.

Code:
terminal.cpp(342) : (col. 32) remark: main has been targeted for automatic cpu dispatch.
/opt/intel/compiler80/include/c++/xutility(1671) : (col. 2) remark: LOOP WAS VECTORIZED.
/opt/intel/compiler80/include/c++/xutility(1670) : (col. 2) remark: _ZSt6fill_nIPP8GTermTabjS1_EvT_T0_RKT1_ has been targeted for automatic cpu dispatch.


compiled using

Code:
icc -Wall -tpp6 -O3 -axK `pkg-config gtk+-2.0 --cflags --libs` `pkg-config vte --cflags --libs` -g terminal.cpp -o main


I don't know what that means :P

I tried to emege ICC, but it requires a license - quite frankly, they can bite me. If the slowness turns up again and you're able to track down why, I'd be glad to change the source, but it looks like I'll be sticking with gcc for now.
Back to top
View user's profile Send private message
stonent
Veteran
Veteran


Joined: 07 Aug 2003
Posts: 1139
Location: Texas

PostPosted: Fri Mar 11, 2005 7:12 am    Post subject: Reply with quote

It means ICC found a loop that was able to be vector optimized. (Something not quite in gcc yet)

So, super-dooper optimized piece of code in there somewhere.
_________________
Inspiron 4100 & Sun UltraAXe
Portage on Solaris|Dell Laptop Hacks
The way you feel about organized religion is the same way I feel about organized socialism.
Back to top
View user's profile Send private message
Lews_Therin
l33t
l33t


Joined: 03 Oct 2003
Posts: 657
Location: Banned

PostPosted: Sun Mar 27, 2005 3:33 am    Post subject: Reply with quote

I've been doing some major updates. For one, there are now much fewer bugs. It still has

    *The backspace/delete problem, but you can fix it by changing a line of source if you don't want to use the program 'screen'. However, if you make this change, 'screen' will no longer be able to detect the backspace key. If you want to change this setting, uncomment line 296 of gterm.cpp.

    *Found a much better way to make menus, but have decided not to use shortcut keys for menu functions. Basically, they would interfere with some programs

    *Still a few memory leaks, but many have been sealed.


Also, it has a few nifty features that I bloody love that I've not found in any other terminal emulator - namely, the ability to custom-name a tab (useful if you have many open to the same directory).

<snipped>

See here


Last edited by Lews_Therin on Mon Mar 28, 2005 1:54 am; edited 3 times in total
Back to top
View user's profile Send private message
Saa
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jul 2004
Posts: 138

PostPosted: Sun Mar 27, 2005 3:35 am    Post subject: Reply with quote

Why not setup a sourceforge account?
Back to top
View user's profile Send private message
Lews_Therin
l33t
l33t


Joined: 03 Oct 2003
Posts: 657
Location: Banned

PostPosted: Sun Mar 27, 2005 3:36 am    Post subject: Reply with quote

Saa wrote:
Why not setup a sourceforge account?


They needed me to tell them why my project was "unique" or "special" in some way. I decided to post this while getting an account set up.

EDIT: Waiting on approval for the hosting. If and when it gets approved, I'll move the stuff over there.
Back to top
View user's profile Send private message
wswartzendruber
Veteran
Veteran


Joined: 23 Mar 2004
Posts: 1261
Location: Idaho, USA

PostPosted: Sun Mar 27, 2005 3:48 am    Post subject: Reply with quote

No more GNOME Terminal? YEAH!!!
_________________
Git has obsoleted SVN.
10mm Auto has obsoleted 45 ACP.
Back to top
View user's profile Send private message
Lews_Therin
l33t
l33t


Joined: 03 Oct 2003
Posts: 657
Location: Banned

PostPosted: Sun Mar 27, 2005 3:56 am    Post subject: Reply with quote

wswartzendruber wrote:
No more GNOME Terminal? YEAH!!!


That's why I made it. To paraphrase somebody else that I forget the identity of:

Quote:
When I just want to install Gnome-terminal, it wants to install libgnome, libbonobo, gnome-vfs, gnome-themes, and gnome-plays-with-kittens
Back to top
View user's profile Send private message
arnvidr
l33t
l33t


Joined: 19 Aug 2004
Posts: 629
Location: Oslo, Norway

PostPosted: Sun Mar 27, 2005 1:00 pm    Post subject: Reply with quote

Hey, this I gotta try out. I rather wait for an ebuild though.. :roll:
Back to top
View user's profile Send private message
Lews_Therin
l33t
l33t


Joined: 03 Oct 2003
Posts: 657
Location: Banned

PostPosted: Sun Mar 27, 2005 6:13 pm    Post subject: Reply with quote

I got a "ghetto" ebuild working. You'll have to re-make the archive if you downloaded it before the ebuild went up, it was in a structure Portage didn't like. Any who download it after this post should be fine.
Back to top
View user's profile Send private message
Q-collective
Advocate
Advocate


Joined: 22 Mar 2004
Posts: 2071

PostPosted: Sun Mar 27, 2005 6:53 pm    Post subject: Reply with quote

Lews_Therin wrote:
I got a "ghetto" ebuild working. You'll have to re-make the archive if you downloaded it before the ebuild went up, it was in a structure Portage didn't like. Any who download it after this post should be fine.

Were to download it?
Back to top
View user's profile Send private message
Lews_Therin
l33t
l33t


Joined: 03 Oct 2003
Posts: 657
Location: Banned

PostPosted: Sun Mar 27, 2005 8:06 pm    Post subject: Reply with quote

Q-collective wrote:
Lews_Therin wrote:
I got a "ghetto" ebuild working. You'll have to re-make the archive if you downloaded it before the ebuild went up, it was in a structure Portage didn't like. Any who download it after this post should be fine.

Were to download it?


Look up. I edited my second post in the thread.
Back to top
View user's profile Send private message
Saa
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jul 2004
Posts: 138

PostPosted: Sun Mar 27, 2005 9:45 pm    Post subject: Reply with quote

I have to say that I admire your work on this. When you get more bugs worked out of it, I'll definately be giving it a try. Thanks for the work on this, I've been wanting a term that has all the features you put into this, especially the ability to theme it with gtk,
Back to top
View user's profile Send private message
Lews_Therin
l33t
l33t


Joined: 03 Oct 2003
Posts: 657
Location: Banned

PostPosted: Sun Mar 27, 2005 9:53 pm    Post subject: Reply with quote

Saa wrote:
I have to say that I admire your work on this. When you get more bugs worked out of it, I'll definately be giving it a try. Thanks for the work on this, I've been wanting a term that has all the features you put into this, especially the ability to theme it with gtk,


Thanks. The bugs are really not bad at all, with the exception of the stupid Screen vs Properly Made Programs backspace thing. I'm reading through a bunch of stuff to try and figure out valgrind...hopefully I'll be able to remove most or all of the memory leaks.

Also, feel free to help fix the code :wink:
Back to top
View user's profile Send private message
Saa
Tux's lil' helper
Tux's lil' helper


Joined: 03 Jul 2004
Posts: 138

PostPosted: Sun Mar 27, 2005 10:10 pm    Post subject: Reply with quote

I'd love to, but my extent of C knowledge is "hellow world" :?
Back to top
View user's profile Send private message
killfire
l33t
l33t


Joined: 04 Oct 2003
Posts: 618

PostPosted: Sun Mar 27, 2005 11:01 pm    Post subject: Reply with quote

Saa wrote:
I'd love to, but my extent of C knowledge is "hellow world" :?


8O

how did you get that extra 'w' in there!??!?!?!

:lol: :lol:

hehe, im still working on socket programming.... blehhh. i should really get a book; man pages piss me off....

killfire
_________________
my website, built in HAppS: http://dbpatterson.com
an art (oil painting) website I built a pure python backend for: http://www.lydiajohnston.com
Back to top
View user's profile Send private message
andrewski
Guru
Guru


Joined: 30 Apr 2004
Posts: 366
Location: Royersford, PA, USA

PostPosted: Sun Mar 27, 2005 11:08 pm    Post subject: Reply with quote

Ahem...
http://os-cillation.com/article.php?sid=40
Back to top
View user's profile Send private message
n3x
Apprentice
Apprentice


Joined: 14 Apr 2003
Posts: 247
Location: Kingston, Ontario (uni) Westport, CT (home)

PostPosted: Sun Mar 27, 2005 11:16 pm    Post subject: Reply with quote

andrewski wrote:
Ahem...
http://os-cillation.com/article.php?sid=40


hehe: I just saw this thread and was about to say the same thing.

Code:
emerge xfce-extra/terminal


But perhaps yours is better.
Back to top
View user's profile Send private message
Lews_Therin
l33t
l33t


Joined: 03 Oct 2003
Posts: 657
Location: Banned

PostPosted: Sun Mar 27, 2005 11:23 pm    Post subject: Reply with quote

andrewski wrote:
Ahem...
http://os-cillation.com/article.php?sid=40


That just substitues XFCE for GNOME. The less external library dependencies, the better.
Back to top
View user's profile Send private message
Lews_Therin
l33t
l33t


Joined: 03 Oct 2003
Posts: 657
Location: Banned

PostPosted: Mon Mar 28, 2005 12:19 am    Post subject: Reply with quote

Well, I've been trying to find and correct memory leaks...and have come to the conclusion that the "people" who work on font support for Linux are in reality well-trained monkeys. Here are some examples

Code:
==7113== 787389 bytes in 314 blocks are still reachable in loss record 132 of 132
==7113==    at 0x1B904AD5: malloc (vg_replace_malloc.c:131)
==7113==    by 0x1BF6BA90: (within /usr/lib/libfreetype.so.6.3.7)


If I'm reading that correctly, that's a 787k memory leak. Here's another:

Code:
==7113== 466555 bytes in 1821 blocks are still reachable in loss record 130 of 132
==7113==    at 0x1B904AD5: malloc (vg_replace_malloc.c:131)
==7113==    by 0x1BFDDBD4: FcPatternFreeze (in /usr/lib/libfontconfig.so.1.0.4)


466k of memory, gone. 1.3 megabytes between these two leaks. The program leaks about 2.5 megabytes, and maybe 3/4 to 5/6 of that is from Freetype, Fontconfig, and Xft.

The 300 bytes my code was leaking doesn't seem so bad anymore.
Back to top
View user's profile Send private message
Lews_Therin
l33t
l33t


Joined: 03 Oct 2003
Posts: 657
Location: Banned

PostPosted: Mon Mar 28, 2005 1:52 am    Post subject: Reply with quote

Woot, Tasslehoff has been kind enough to offer hosting until Sourceforge approves me. Here's a new ebuild to take advantage of that:

Code:
# $Header: $

inherit eutils flag-o-matic

DESCRIPTION="Lightweight GTK2 terminal emulator"
HOMEPAGE=""
SRC_URI="http://gterm.php-scripter.com/${P}.tar.bz2"

LICENSE="GPLv2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""

DEPEND="virtual/x11
   >=x11-libs/gtk+-2.4
   >=x11-libs/vte-0.11.11-r2"

src_compile() {
   emake || die
}

src_install() {
   mkdir -p ${D}usr/bin/
   cp ${S}/gterm ${D}usr/bin/gterm
}


Save it as x11-terms/gterm-0.1.1.ebuild in your overlay, digest it (ebuild gterm-0.1.1.ebuild digest) and emerge it.

Again - Thanks Tasslehoff!!
Back to top
View user's profile Send private message
Lews_Therin
l33t
l33t


Joined: 03 Oct 2003
Posts: 657
Location: Banned

PostPosted: Mon Mar 28, 2005 7:41 am    Post subject: Reply with quote

It seems that VTE is the culprit behind the memory problems. It is using about 1.5 megabytes of RAM per open terminal. I can literally spawn a new instance of XTerm, swallow it in my app, and save 1 meg of memory per tab.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum