Patch for tab with X to close

38 views
Skip to first unread message

Costantino Cerbo

unread,
Jun 12, 2009, 5:07:07 PM6/12/09
to terminat...@googlegroups.com
Hello,

here is a new patch with this two features:
  * X on the tab to close it
  * Double click on the tab open the Info Dialog that allows to change the tab-name.

The two images for the X should be currently in the package terminator.
patch.zip

Elliott Hughes

unread,
Jun 12, 2009, 11:55:46 PM6/12/09
to terminat...@googlegroups.com

i think this breaks single-clicking on a tab to switch tab. only
components that don't listen for mouse events themselves let mouse events
pass through, so if you call addMouseListener, you can't rely on the
JTabbedPane to just do it for you.

i think the easiest fix is probably to call addMouseListener in
TerminatorTabbedPane.addTab to add a listener that calls
setSelectedComponent(c) on clicks.

(i'll look at the close buttons when we get the double-click stuff
committed, so it's probably easiest to split this into two patches. i
think the double-click part should be fine once you've simulated the usual
click-through.)

--
Elliott Hughes, http://www.jessies.org/~enh/


Costantino Cerbo

unread,
Jun 13, 2009, 5:51:32 AM6/13/09
to terminat...@googlegroups.com
You're right... yesterday night I haven't sufficiently tested.

With this change in TerminatorTabbedPane.addTab, it should work:
    [...]
    @Override public void addTab(String name, Component c) {
        super.addTab(name, c);
       
        int newIndex = getTabCount() - 1;
        JTerminalPane terminalPane = (JTerminalPane) c;
        TerminatorTabComponent tabEar = new TerminatorTabComponent(terminalPane);
        setTabComponentAt_safe(newIndex, tabEar);
        showInfoOnDoubleClick(tabEar, terminalPane);
    }
   
    private void showInfoOnDoubleClick(final TerminatorTabComponent tabComp, final JTerminalPane terminalPane) {
        tabComp.addMouseListener(new MouseAdapter() {
            @Override
            public void mouseClicked(MouseEvent e) {               
                if (e.getClickCount() == 2) {   
                    InfoDialog.getSharedInstance().showInfoDialogFor(terminalPane);
                } else {               
                    setSelectedComponent(terminalPane);
                }
            }
        });
    }
   [...]
2009/6/13 Elliott Hughes <e...@jessies.org>

Costantino Cerbo

unread,
Jun 13, 2009, 5:55:21 AM6/13/09
to terminat...@googlegroups.com
Oh no... now the right click part is broken!
But I don't understand... we "add" a listener, why does the previous one disappear?

2009/6/13 Costantino Cerbo <c.c...@gmail.com>

Elliott Hughes

unread,
Jun 13, 2009, 4:22:39 PM6/13/09
to terminat...@googlegroups.com

On Sat, June 13, 2009 02:55, Costantino Cerbo wrote:
> Oh no... now the right click part is broken!
> But I don't understand... we "add" a listener, why does the previous one
> disappear?

it doesn't disappear: it's still there. it just never gets called.

when you call setTabComponent, that component is just inset within the tab
"ear" (the bit you click on to switch to the tab, as opposed to the "big
bit" below). bits of the ear still poke through, and if you right-click on
them, you'll find the menu's still there. if this isn't clear, try
changing TerminatorTabComponent so it paints itself as a red rectangle.

anyway, when dispatching mouse events, the search for listeners stops in
the first component (working from the leaves to the root of the tree)
that's registered to receive mouse events. (calling addMouseListener does
this for you.) so because the component on top of the "ear" has a
MouseListener, MouseListeners registered on components underneath with
never be called.

i guess the easiest thing would be to attach a single MouseListener to the
tabbed pane, rather than one to each tab component, and then use
indexAtLocation(e.getX(), e.getY()) (where e is the MouseEvent) to decide
what tab got double-clicked.

--elliott
>>> http://www.jessies.org/~enh/<http://www.jessies.org/%7Eenh/>

Costantino Cerbo

unread,
Jun 13, 2009, 6:06:16 PM6/13/09
to terminat...@googlegroups.com
Wonderful! you're right!
Thanks for your explanation!

Now single, double and right clicks work! ;-)
This is the code:
    public TerminatorTabbedPane() {
        [...]
        showInfoOnDoubleClick();
    }
   
    private void showInfoOnDoubleClick() {

        addMouseListener(new MouseAdapter() {
            @Override
            public void mouseClicked(MouseEvent e) {               
                if (e.getClickCount() == 2) {   
                    int index = indexAtLocation(e.getX(), e.getY());
                    TerminatorTabComponent tab = (TerminatorTabComponent) getTabComponentAt(index);
                    InfoDialog.getSharedInstance().showInfoDialogFor(tab.getTerminalPane());
                }
            }
        });
    }

and then in TerminatorTabComponent I've added a getter for the TerminalPane.

It would be nice, if you could apply this patch and also that one for the X button to SVN trunk

Thanks again!
Costantino

Elliott Hughes

unread,
Jun 13, 2009, 7:49:06 PM6/13/09
to terminat...@googlegroups.com

On Sat, June 13, 2009 15:06, Costantino Cerbo wrote:
> Wonderful! you're right!
> Thanks for your explanation!
>
>
> Now single, double and right clicks work! ;-)
> This is the code:
> public TerminatorTabbedPane() { [...]
> showInfoOnDoubleClick(); }
>
>
> private void showInfoOnDoubleClick() { addMouseListener(new MouseAdapter()
> {
> @Override
> public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { int
> index = indexAtLocation(e.getX(), e.getY()); TerminatorTabComponent tab =
> (TerminatorTabComponent)
> getTabComponentAt(index);
>
> InfoDialog.getSharedInstance().showInfoDialogFor(tab.getTerminalPane());
> }
> }
> });
> }
>
>
> and then in TerminatorTabComponent I've added a getter for the
> TerminalPane.

you want to call *getComponentAt* rather than getTabComponentAt.
(confusing Swing naming.) and you missed the hinted-at case where index is
-1.

> It would be nice, if you could apply this patch...

committed with the changes mentioned in the paragraph above, though it
wasn't actually a patch any more... it's helpful if you send a new patch
each time.

> and also that one for the X
> button to SVN trunk

can you send a clean patch for that? (don't worry about the icons. just
the diff -u against the latest revision.)

--elliott

Costantino Cerbo

unread,
Jun 14, 2009, 6:41:21 AM6/14/09
to terminat...@googlegroups.com
Hello,

the patch ("diff -u" again the last revision) for the close button is attached.

Other subject: when I close a tab, I get always this exception:
java.io.IOException: read(26, buffer, 0, 8192) failed: Input/output error
at terminator.terminal.PtyProcess$PtyInputStream.read(PtyProcess.java:31)
at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:264)
at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158)
at java.io.InputStreamReader.read(InputStreamReader.java:167)
at terminator.terminal.TerminalControl$ReaderRunnable.run(TerminalControl.java:152)
at java.lang.Thread.run(Thread.java:619)

Costantino

patch_tabclose.diff

Elliott Hughes

unread,
Jun 17, 2009, 3:14:04 AM6/17/09
to terminat...@googlegroups.com
On Sun, June 14, 2009 03:41, Costantino Cerbo wrote:
> Hello,
>
> the patch ("diff -u" again the last revision) for the close button is
> attached.

===================================================================
--- src/terminator/TerminatorTabbedPane.java (revision 1554)
+++ src/terminator/TerminatorTabbedPane.java (working copy)
@@ -178,9 +178,41 @@
terminalPane.getControl().addChangeListener(this);

add(label, BorderLayout.CENTER);
- add(outputSpinner, BorderLayout.EAST);
+ add(outputSpinner, BorderLayout.WEST);
+
+ addCloseButton();

it's easier to understand the layout if all the calls to "add" are
together. we tend to use something more like add(makeX()...) instead.

}

+ private void addCloseButton() {
+ final Icon closeXIcon0 = new
ImageIcon(getClass().getResource("/terminator/closeicon0.gif"));
+ final Icon closeXIcon1 = new
ImageIcon(getClass().getResource("/terminator/closeicon1.gif"));

we keep resources in the lib directory. but if all we want is GNOME icons,
we can get those via GnomeStockIcon.

of course, since we also support Mac OS and Windows, we need to do
something reasonable for them too.

+ Dimension closeButtonSize = new
Dimension(closeXIcon0.getIconWidth() + 6, closeXIcon0.getIconHeight() +
4);
+ final JButton closeButton = new JButton(closeXIcon0);
+ closeButton.setFocusable(false);
+ closeButton.setContentAreaFilled(false);
+ closeButton.setPreferredSize(closeButtonSize);
+ add(closeButton, BorderLayout.EAST);
+
+ closeButton.addActionListener(new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ terminalPane.doCheckedCloseAction();
+ }
+ });
+
+ closeButton.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseEntered(MouseEvent e) {
+ closeButton.setIcon(closeXIcon1);
+ }
+
+ @Override
+ public void mouseExited(MouseEvent e) {
+ closeButton.setIcon(closeXIcon0);
+ }
+ });

see JButton.setRolloverEnabled and related methods.

+ }
+

attached is something that makes these changes and goes a little further
towards doing the right thing on Linux. i haven't tested on Mac OS or
Windows, though.

> Other subject: when I close a tab, I get always this exception:
> java.io.IOException: read(26, buffer, 0, 8192) failed: Input/output error
> at terminator.terminal.PtyProcess$PtyInputStream.read(PtyProcess.java:31)
> at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:264) at
> sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306)
> at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158) at
> java.io.InputStreamReader.read(InputStreamReader.java:167)
> at
> terminator.terminal.TerminalControl$ReaderRunnable.run(TerminalControl.ja
> va:152)
> at java.lang.Thread.run(Thread.java:619)

yeah, we don't really shut things down in an orderly fashion.

tab-close-patch.diff.txt

Costantino Cerbo

unread,
Jun 17, 2009, 7:25:30 AM6/17/09
to terminat...@googlegroups.com
Ok, I've tested your modified path also with the Laf Nimbus und it's
okay (on rollover it becames red).
With GTK Laf is almost like Firefox (with border), but I find it a
little bit too hight (therefore I've se hgap = 4)

Unfortunately I've no chance to test under Mac Os.


Sometimes the Spinner remains visibile also if nothing is done (it
freezes)... for example when you open multiple tabs very fast with
"alt+t"

2009/6/17 Elliott Hughes <e...@jessies.org>:

Elliott Hughes

unread,
Jun 18, 2009, 1:01:36 AM6/18/09
to terminat...@googlegroups.com
On Wed, June 17, 2009 04:25, Costantino Cerbo wrote:
> Ok, I've tested your modified path also with the Laf Nimbus und it's
> okay (on rollover it becames red). With GTK Laf is almost like Firefox
> (with border), but I find it a
> little bit too hight (therefore I've se hgap = 4)

i don't understand: the BorderLayout's hgap is already set to 4 in my patch.

> Unfortunately I've no chance to test under Mac Os.

it doesn't look very good. (nor did the existing activity indicators.) we
could really do with a more Safari-like JTabbedPane on Mac OS. sadly,
neither Quaqua nor "Mac Widgets for Java" has any such thing.

i'll wait and see what mad says about how it looks on Windows.

> Sometimes the Spinner remains visibile also if nothing is done (it
> freezes)... for example when you open multiple tabs very fast with "alt+t"

that's always been the case though. (and i think it's telling the truth:
the prompt has been drawn, and you haven't seen it.)

Costantino Cerbo

unread,
Jun 18, 2009, 10:54:38 AM6/18/09
to terminat...@googlegroups.com
2009/6/18 Elliott Hughes <e...@jessies.org>:

> i don't understand: the BorderLayout's hgap is already set to 4 in my patch.

you're right, but I don't know why, they are higher than in
gnome-terminal or Firefox (see attached screenshot)
I've done some tries, and it seems that hgap has no effect in this case.

Anyway for me it isn't very important because I use the Nimbus LAF
(Gtk Laf looks still ungly... I hope it will be better in the next
java releases).

hgap.png

Elliott Hughes

unread,
Jun 18, 2009, 12:49:00 PM6/18/09
to terminat...@googlegroups.com
On Thu, June 18, 2009 07:54, Costantino Cerbo wrote:
> 2009/6/18 Elliott Hughes <e...@jessies.org>:
>> i don't understand: the BorderLayout's hgap is already set to 4 in my
>> patch.
>
> you're right, but I don't know why, they are higher than in
> gnome-terminal or Firefox (see attached screenshot) I've done some tries,
> and it seems that hgap has no effect in this case.

ah, the screenshot's useful: you mean _taller_ rather than higher. (yeah,
i know, "alta" works fine for both purposes, but it's too late to fix
English!)

this has been annoying me too, but it's unrelated to this change. i
haven't found any way to fix it from our code. i've tried different fonts
and i've tried fiddling with borders, but the GTK LAF has a bad habit of
ignoring most of the stuff you set and just doing its own thing anyway.
(try using setBackground on a JTextField, for example, and watch it have
absolutely no effect.)

actually, FatBits shows that Evergreen's tabs are one pixel shorter than
Terminator's (even without this patch), so it's possible we might be able
to win one pixel back, even if we can't get the others.

> Anyway for me it isn't very important because I use the Nimbus LAF
> (Gtk Laf looks still ungly... I hope it will be better in the next
> java releases).

it's the same in the early access releases of JDK7, and in OpenJDK.

i've signed the OpenJDK SCA because i'd like to have a go at fixing some
of these GTK LAF problems. the guy i was talking to is on holiday at the
moment, or i'd be showing him patches to JColorChooser that make it look
more like the real thing. not a very useful place to start, but an easy
place to start.

Martin Dorey

unread,
Jun 18, 2009, 2:00:34 PM6/18/09
to terminat...@googlegroups.com

> i'll wait and see what mad says about how it looks on Windows.

 

The grey color makes the control look disabled when it isn't.  Firefox's close icon for a tab, for me, is a white X on a background that's red when it's the topmost tab and grey otherwise, unless rolled over, in which case it appears like the topmost tab.  The background gets brighter on rollover, much like whatever window manager Gnome/Debian inflicts me with.  Other windows use a black X on a darker (but still only mid) grey background.  Some of the more modern (by which you don't want to assume any reasonable definition of modern - I'm still running Windows 2000) Office apps that I have installed use a lighter grey background, which goes darker on roll-over.  I don't think Windows users are a fussy lot, and I'm certainly not, so most of the previous description is just for completeness, but the current icon does look disabled.

 

-----Original Message-----
From: terminat...@googlegroups.com [mailto:terminat...@googlegroups.com] On Behalf Of Elliott Hughes
Sent: Wednesday, June 17, 2009 22:02
To: terminat...@googlegroups.com
Subject: [terminator-users] Re: Patch for tab with X to close

 

 

On Wed, June 17, 2009 04:25, Costantino Cerbo wrote:

> Ok, I've tested your modified path also with the Laf Nimbus und it's

> okay (on rollover it becames red). With GTK Laf is almost like Firefox

> (with border), but I find it a

> little bit too hight (therefore I've se hgap = 4)

 

i don't understand: the BorderLayout's hgap is already set to 4 in my patch.

 

> Unfortunately I've no chance to test under Mac Os.

 

it doesn't look very good. (nor did the existing activity indicators.) we

could really do with a more Safari-like JTabbedPane on Mac OS. sadly,

neither Quaqua nor "Mac Widgets for Java" has any such thing.

 

i'll wait and see what mad says about how it looks on Windows.

 

> Sometimes the Spinner remains visibile also if nothing is done (it

> freezes)... for example when you open multiple tabs very fast with "alt+t"

 

that's always been the case though. (and i think it's telling the truth:

the prompt has been drawn, and you haven't seen it.)

 

Elliott Hughes

unread,
Jun 18, 2009, 3:52:44 PM6/18/09
to terminat...@googlegroups.com
On Thu, June 18, 2009 11:00, Martin Dorey wrote:
>> i'll wait and see what mad says about how it looks on Windows.
>
> The grey color makes the control look disabled when it isn't. Firefox's
> close icon for a tab, for me, is a white X on a background that's red when
> it's the topmost tab and grey otherwise, unless rolled over, in which case
> it appears like the topmost tab. The background gets brighter on
> rollover, much like whatever window manager Gnome/Debian inflicts me with.
> Other windows use a black X on a darker (but still
> only mid) grey background. Some of the more modern (by which you don't
> want to assume any reasonable definition of modern - I'm still running
> Windows 2000) Office apps that I have installed use a lighter grey
> background, which goes darker on roll-over. I don't think Windows users
> are a fussy lot, and I'm certainly not, so most of the previous
> description is just for completeness, but the current icon does look
> disabled.

the Chrome close-tab button i was copying is similar, and i actually liked
that because it addressed one of my dislikes about the usual close-tab UI
(that it's a bit excessively in your face), and -- though you can't see it
in the screenshot -- i felt it made the transition to the dangerous
"armed" state much more obvious.

http://www.google.com/chrome/intl/en/images/dlpage_lg.jpg

of course, Chrome uses a different kind of tab, so i don't know what it
looks like on a Windows tab. on the Mac OS tabs, it's almost invisible
(never mind "disabled") normally, and doesn't look right on rollover
because, i think, it's flat on a curved surface making it look like a
decoration rather than a button. i'm not sure it's even possible to make
anything that looks sensible for the Mac OS LAF (without writing our own
JTabbedPane UI delegate, that is).

any chance of a screenshot? if it's as invisible as on Mac OS, i'll
definitely have to come up with something else.

i wonder if there's anything in the Windows LAF that would let us get
suitable stock icons? presumably they're firefox-specific anyway, even
though they look like a smaller version of the XP window close icon.

--elliott

> -----Original Message-----
> From: terminat...@googlegroups.com
> [mailto:terminat...@googlegroups.com] On Behalf Of Elliott Hughes
> Sent: Wednesday, June 17, 2009 22:02
> To: terminat...@googlegroups.com
> Subject: [terminator-users] Re: Patch for tab with X to close
>
>
>
> On Wed, June 17, 2009 04:25, Costantino Cerbo wrote:
>
>> Ok, I've tested your modified path also with the Laf Nimbus und it's
>> okay (on rollover it becames red). With GTK Laf is almost like Firefox
>> (with border), but I find it a
>> little bit too hight (therefore I've se hgap = 4)
>
> i don't understand: the BorderLayout's hgap is already set to 4 in my
> patch.
>
>> Unfortunately I've no chance to test under Mac Os.
>>
>
> it doesn't look very good. (nor did the existing activity indicators.) we
> could really do with a more Safari-like JTabbedPane on Mac OS. sadly,
> neither Quaqua nor "Mac Widgets for Java" has any such thing.
>
> i'll wait and see what mad says about how it looks on Windows.
>
>> Sometimes the Spinner remains visibile also if nothing is done (it
>> freezes)... for example when you open multiple tabs very fast with
> "alt+t"
>
>
> that's always been the case though. (and i think it's telling the truth:
> the prompt has been drawn, and you haven't seen it.)
>
>> 2009/6/17 Elliott Hughes <e...@jessies.org>:

Martin Dorey

unread,
Jun 18, 2009, 5:01:57 PM6/18/09
to terminat...@googlegroups.com
> any chance of a screenshot?

I didn't try to catch the rollover case or Firefox or Office, but you'll
find Terminator's patch output now attached.

> i wonder if there's anything in the Windows LAF that would let us get
> suitable stock icons?

I could more easily look with a hint as to where, if you have one.
"C:\Program Files\Java\jdk1.6.0_13\jre\lib\images", for example, only
contains a directory called "cursors", which doesn't look useful.
invisibly-grey-tab-close.jpg

Costantino Cerbo

unread,
Jun 18, 2009, 5:08:18 PM6/18/09
to terminat...@googlegroups.com
The Netbeans platform also offers an example of cross-system X button on tab.
If you don't have Netbeans installed, but the last JDK, you can launch
the Java VisualVM to see an example of these closable tabs.

See also here: http://blogs.sun.com/geertjan/entry/netbeans_apis_add_close_button.
They use the class CloseButtonTabbedPane (through TabbedPaneFactory)
to create the X button:
http://hg.netbeans.org/core-main/file/bb7146ca556d/openide.awt/src/org/openide/awt/CloseButtonTabbedPane.java

...and here are their icons:
http://hg.netbeans.org/core-main/file/bb7146ca556d/openide.awt/src/org/openide/awt/resources

2009/6/18 Elliott Hughes <e...@jessies.org>

Costantino Cerbo

unread,
Jun 18, 2009, 5:16:10 PM6/18/09
to terminat...@googlegroups.com
I've attached how the tabs look like with the Nimbus LAF: I think pretty good.

Regarding the "almost" invisible X, I find it not so bad, at least with Nimbus.
An other example is of course provided by Eclipse: there the X appears
only on mouse rollover, otherwise it isn't visible,

Nimbus.png

Elliott Hughes

unread,
Jun 18, 2009, 5:26:39 PM6/18/09
to terminat...@googlegroups.com
On Thu, June 18, 2009 14:01, Martin Dorey wrote:
>> any chance of a screenshot?
>
> I didn't try to catch the rollover case or Firefox or Office, but you'll
> find Terminator's patch output now attached.

ah, yes, that's way too pale. (i assume it's a bit better against the
lighter XP background, but i've no idea what versions of Windows our
Windows users are actually on.)

>> i wonder if there's anything in the Windows LAF that would let us get
>> suitable stock icons?
>
> I could more easily look with a hint as to where, if you have one.
> "C:\Program Files\Java\jdk1.6.0_13\jre\lib\images", for example, only
> contains a directory called "cursors", which doesn't look useful.

that was more a note to self to look at the source combined with a prod
for ed to let us know if he already knows the answer. (on the assumption
he worries about/deals with the Windows LAF more than the rest of us.) i
would hope if the Windows LAF does have anything like this, it works via
some kind of theme/stock icon API, as the GTK LAF does.

unless there's something obvious & easy, i'll probably just try a darker
gray. i'll fix the example code to show the buttons against Windows-gray
as well as platform-you're-running-on-gray too.

Elliott Hughes

unread,
Jun 18, 2009, 10:30:05 PM6/18/09
to terminat...@googlegroups.com
On Thu, June 18, 2009 14:08, Costantino Cerbo wrote:
> The Netbeans platform also offers an example of cross-system X button on
> tab. If you don't have Netbeans installed, but the last JDK, you can
> launch the Java VisualVM to see an example of these closable tabs.

(amusingly, on GTK, the one platform we get right, they look like nothing
like the real thing.)

> See also here:
> http://blogs.sun.com/geertjan/entry/netbeans_apis_add_close_button.
> They use the class CloseButtonTabbedPane (through TabbedPaneFactory)
> to create the X button:
> http://hg.netbeans.org/core-main/file/bb7146ca556d/openide.awt/src/org/op
> enide/awt/CloseButtonTabbedPane.java
>
> ...and here are their icons:
> http://hg.netbeans.org/core-main/file/bb7146ca556d/openide.awt/src/org/ope
> nide/awt/resources

interesting, but despite the large amount of code and the numerous images,
none of them actually seem to look like the native equivalents.
(pixel-perfect fidelity being the obvious reason to go that route.)

given that Microsoft's Vista UI Guidelines show multiple variants (but
don't explicitly address the topic at all, as far as i could see), i think
Martin's claim that Windows users don't care much is reasonable. i'll make
the gray darker so it's less close to Windows 2000's default control gray,
and commit.

we'll worry about doing something better on Mac OS when we switch to Java
6 there (because until then they don't get tab component support anyway).
at the moment they have to have Java 6 on their PATH to override our
choice of Java 5.

--elliott

Costantino Cerbo

unread,
Jun 19, 2009, 4:12:05 AM6/19/09
to terminat...@googlegroups.com
2009/6/19 Elliott Hughes <e...@jessies.org>:
> Ii'll make the gray darker so it's less close to Windows 2000's

default control gray, and commit.

Ok, it's fine!
I think you should also update the "Multiple Tabs" screenshots on the
web site and also say that double clicking on tabs allows to change
their name.

Cheers,
Costantino

Costantino Cerbo

unread,
Jun 19, 2009, 6:51:39 PM6/19/09
to terminat...@googlegroups.com
> it's the same in the early access releases of JDK7, and in OpenJDK.
>
> i've signed the OpenJDK SCA because i'd like to have a go at fixing some
> of these GTK LAF problems. the guy i was talking to is on holiday at the
> moment, or i'd be showing him patches to JColorChooser that make it look
> more like the real thing. not a very useful place to start, but an easy
> place to start.

Yes, good idea, I should also do it (helping fixing the GTK LAF).
I find particular annoying that the font is too thin respect to the
true GTK font (see again the screenshot that compare the tab size
between Terminator and Gnome-Terminal)

Elliott Hughes

unread,
Jun 24, 2009, 12:36:19 AM6/24/09
to terminat...@googlegroups.com
On Fri, June 19, 2009 01:12, Costantino Cerbo wrote:
> I think you should also update the "Multiple Tabs" screenshots on the
> web site...

yeah, one of these days we should take some new screenshots.

> and also say that double clicking on tabs allows to change their
> name.

i've mentioned that double-clicking opens the info dialog in the
(newly-created and still pretty empty) manual, but i'm not sure we want to
recommend people use the info dialog to change a tab's name; the intention
is that they've set PS1 so that it updates the tab/window title as they go
about their business.

Martin Dorey

unread,
Jun 24, 2009, 1:02:19 AM6/24/09
to terminat...@googlegroups.com
Just some random jottings, if anyone wanted to flesh out a section on the title:

If some careless PS1 changed a carefully crafted title, I'd be annoyed, as there's no lock, no history and no undo. I quite often do change the title with the info dialog, when a window gets devoted to tail -f or the like. I know not to carefully craft it.

Some example code, showing how to set PS1 or at least mentioning compatibility with xterm's sequence for setting the title, might not go amiss.

----- Original Message -----
From: terminat...@googlegroups.com <terminat...@googlegroups.com>
To: terminat...@googlegroups.com <terminat...@googlegroups.com>
Sent: Tue Jun 23 21:36:19 2009
Subject: [terminator-users] Re: Patch for tab with X to close


Matt Hillsdon

unread,
Jun 24, 2009, 3:59:20 AM6/24/09
to terminat...@googlegroups.com
Martin Dorey wrote:
> Just some random jottings, if anyone wanted to flesh out a section on the title:
>
> If some careless PS1 changed a carefully crafted title, I'd be annoyed, as there's no lock, no history and no undo. I quite often do change the title with the info dialog, when a window gets devoted to tail -f or the like. I know not to carefully craft it.
>
> Some example code, showing how to set PS1 or at least mentioning compatibility with xterm's sequence for setting the title, might not go amiss.
>
Perhaps this will be useful:
http://matt.hillsdon.net/svn/eclipse/terminator/trunk/FAQ

Relevant section:
> 1. View title isn't working or only works in some applications (e.g. vim).
>
> You'll need to teach your bash start-up scripts about the 'terminator'
> terminal
> type. E.g. on Ubuntu edit ~/.bashrc and add '|terminator' (no quotes)
> to the
> block below after 'rxvt*'.
>
> # If this is an xterm set the title to user@host:dir
> case "$TERM" in
> xterm*|rxvt*)
> PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}:
> ${PWD/$HOME/~}\007"'
> ;;
> *)
> ;;
> esac
>
> See also jessies.org FAQ entry.
I don't claim to know a lot about this but I observed the above worked
and it seemed a lot simpler than the current jessies FAQ entry. I just
checked on a Fedora system and they also have a case on $TERM in .bashrc
that can be similarly modified.

Cheers,

Matt.

Elliott Hughes

unread,
Jun 24, 2009, 11:56:48 AM6/24/09
to terminat...@googlegroups.com

that's because the FAQ entry is answering a slightly more general
question, and trying to leave you with some reusable pieces. but if Ubuntu
comes with a default .bashrc (i didn't know; i probably copied my own over
it without even looking) it might be worth us explaining what changes to
make. likewise Cygwin and Mac OS.

i have extra hacks in my work prompt setup; i look for the GNOME
session-id environment variable, and if i see it, i don't put the hostname
in (since i'm on the console of some machine). i also chop off the boring
part of the domain name, since i remember which company i work for and
would like those 16 characters back.

--elliott

> I just
> checked on a Fedora system and they also have a case on $TERM in .bashrc
> that can be similarly modified.
>
> Cheers,
>
>
> Matt.

--
Elliott Hughes, http://www.jessies.org/~enh/


Reply all
Reply to author
Forward
0 new messages