After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 138609 - Next/prev TAB keybindings should not be passed through on first/last tab
Next/prev TAB keybindings should not be passed through on first/last tab
Status: RESOLVED DUPLICATE of bug 453193
Product: gnome-terminal
Classification: Core
Component: general
2.14.x
Other Linux
: Normal normal
: ---
Assigned To: GNOME Terminal Maintainers
GNOME Terminal Maintainers
: 143291 147041 152314 162860 311294 329824 349475 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2004-03-31 10:03 UTC by Götz Waschk
Modified: 2008-09-24 22:06 UTC
See Also:
GNOME target: ---
GNOME version: 2.15/2.16


Attachments
Don't produce garbage when trying to ctrl-pgup past last tab (753 bytes, patch)
2004-06-26 16:31 UTC, Damien Miller
rejected Details | Review
gnome-terminal-dont-send-prev-next-keys-to-terminal.patch (3.62 KB, patch)
2005-08-26 14:52 UTC, Bastien Nocera
reviewed Details | Review
gnome-terminal-dont-send-prev-next-keys-to-terminal-2.patch (3.56 KB, patch)
2005-09-07 10:54 UTC, Bastien Nocera
committed Details | Review
gnome-terminal-dont-send-prev-next-keys-to-terminal-3.patch (532 bytes, patch)
2006-04-18 18:35 UTC, Bastien Nocera
none Details | Review

Description Götz Waschk 2004-03-31 10:03:17 UTC
When I switch tabs with <Control>-<PgUp> and <Control>-<PgDown> and I
reach the last tab, it will print 5~ on the terminal instead of 
doing nothing.

This is Mandrake 10.0 with GNOME 2.6 with gnome-terminal 2.6
Comment 1 Nick Dimiduk 2004-06-01 16:16:03 UTC
*** Bug 143291 has been marked as a duplicate of this bug. ***
Comment 2 Damien Miller 2004-06-26 04:12:27 UTC
Same on OpenBSD -current. This very annoying :(
Comment 3 Damien Miller 2004-06-26 16:31:16 UTC
Created attachment 29027 [details] [review]
Don't produce garbage when trying to ctrl-pgup past last tab

This patch restores the old behaviour for me. It isn't perfect - it still
leaves the next/previous tab menu items active even when on the last/first tab,
but I think this is a minor regression compared to dumping junk into the user's
terminal session.
Comment 4 Mariano Suárez-Alvarez 2004-06-26 22:38:42 UTC
Note this is not really "dumping junk" but simply "dumping whatever the user is
typing into the terminal"...  Try hitting Ctrl-Page{Up,Down} in xterm.
Comment 5 Sven Herzberg 2004-11-15 07:33:22 UTC
This is fixed in 2.9, isn't it?
Comment 6 Götz Waschk 2004-11-15 08:05:22 UTC
I still have to apply that patch in my package of 2.9.1:
http://wwwra.informatik.uni-rostock.de/~waschk/Mandrake/GNOME2.9/
Comment 7 Mariano Suárez-Alvarez 2004-11-15 08:39:15 UTC
The patch basically makes it impossible to type Ctrl-PageUp/PageDown into a
terminal. Does -no- terminal app need to geet those key combinations?
Comment 8 Damien Miller 2004-11-15 23:44:39 UTC
I don't see that this is a problem: an app that needs these keys (I don't know
of any) wouldn't work properly when multiple tabs are active anyway.

gnome-terminal already captures shift-pageup and control-shift-{t,c,v,n}, so
this is merely a change in degree.
Comment 9 Olav Vitters 2005-01-03 22:12:14 UTC
*** Bug 162860 has been marked as a duplicate of this bug. ***
Comment 10 Olav Vitters 2005-01-03 22:14:35 UTC
*** Bug 147041 has been marked as a duplicate of this bug. ***
Comment 11 Olav Vitters 2005-01-03 22:16:12 UTC
Bug 147041 was regarding the prev tab keybinding. These should both be handled
in the same way. Updating summary.
Comment 12 Bill Hayden 2005-02-03 21:21:22 UTC
*** Bug 152314 has been marked as a duplicate of this bug. ***
Comment 13 Olav Vitters 2005-07-22 19:48:43 UTC
*** Bug 311294 has been marked as a duplicate of this bug. ***
Comment 14 Bill Hayden 2005-07-22 20:05:36 UTC
Note that just trapping <Control>-<PgUp> and <Control>-<PgDown>, as mentioned by
  comments 5 through 8 above, is not sufficient since the keybindings can be
changed.  I, for one, don't use those bindings.
Comment 15 Bill Hayden 2005-07-22 20:16:02 UTC
Now that I've looked more closely at the proposed patch, I see that my previous
comment is not applicable.  I was misunderstanding what was said.

What I don't understand, however, is why we don't do "circular" tabbing like
KDE's terminal.  When you get to the last tab, and you do a "Next Tab", you go
to the first tab.  Likewise when you get to the first tab and do a "Previous
Tab".  Don't like that behaviour?  Make it an option that can be turned off. 
This is definitely one of the features I missed when I switched from KDE to Gnome.
Comment 16 Olav Vitters 2005-07-22 20:21:03 UTC
Bill Hayden: See discussion in bug 92139 for bug cycling. Basically comes down
to accessibility reasons + want a more general preference that just
gnome-terminal. It should work the same in *all* gnome apps; not just one.
Maintainer doesn't want more prefs in g-t (this includes gconf).
Comment 17 Bastien Nocera 2005-08-24 15:45:25 UTC
That patch is not applicable as the menu items wouldn't have the right
sensitivity anymore.

I am more of the idea that the terminal should block those shortcuts (which can
be changed in the Edit->Keyboard shortcuts dialogue) if there's more than one tab.
Comment 18 Bastien Nocera 2005-08-26 14:52:36 UTC
Created attachment 51382 [details] [review]
gnome-terminal-dont-send-prev-next-keys-to-terminal.patch

Don't pass the key presses for "Prev/Next tab" to the terminal itself, if
there's more than one tab. We could potentially do the same thing for shortcuts
to direct tabs.

Also fixes a FIXME in the code now that we use a gtk+ > 2.2.
Comment 19 Ray Strode [halfline] 2005-09-06 15:51:07 UTC
Hi Bastien,

Overall the patch looks reasonable to me.  Assuming it works, I would just
commit it (after code freeze is over, of course).  I don't think gnome-terminal
has an active maintainer right now.

A couple of nitpicks...

+  /* Capture the key presses */
+  gtk_widget_add_events (GTK_WIDGET (window), GDK_KEY_PRESS_MASK);
I think toplevel windows get key press events by default.

+  g_signal_connect (G_OBJECT(window), "key_press_event",
+		    G_CALLBACK (key_press_callback), window);
I believe key-press-event is more canonical than key_press_event.
Comment 20 Bastien Nocera 2005-09-07 10:54:15 UTC
Created attachment 51913 [details] [review]
gnome-terminal-dont-send-prev-next-keys-to-terminal-2.patch

Removed unneeded _add_events call, and use key-press-event instead of
key_press_event (I think they're actually the same, but key-press-event would
be what is specified in the new signal creation in gtk+).
Comment 21 Ray Strode [halfline] 2005-09-07 15:00:10 UTC
Looks fine to me.  It looks like Kjartan already did a 2.12 release for
gnome-terminal, so I think that you should be able to just commit this.  You
might want to ask him though.
Comment 22 Bastien Nocera 2005-09-07 15:42:15 UTC
Committed to gnome-2-12 and HEAD.

2005-09-07  Bastien Nocera  <hadess@hadess.net>

        * src/terminal-window.c: (terminal_window_init),
        (update_tab_sensitivity), (reset_and_clear_callback),
        (accel_event_key_match), (key_press_callback):
        Only send Previous tab/Next tab key events to the terminal if there's
        no tab, and not when we reach the boundary with multiple tabs
        (Closes: #138609)
Comment 23 Götz Waschk 2006-04-18 07:25:24 UTC
This bug is still (or again) valid for 2.14.1.
Comment 24 Bastien Nocera 2006-04-18 18:35:19 UTC
Created attachment 63811 [details] [review]
gnome-terminal-dont-send-prev-next-keys-to-terminal-3.patch

Also remove Num-Lock from the modifiers.
Comment 25 Behdad Esfahbod 2006-04-29 17:20:30 UTC
*** Bug 329824 has been marked as a duplicate of this bug. ***
Comment 26 Olav Vitters 2006-07-31 20:16:16 UTC
*** Bug 349475 has been marked as a duplicate of this bug. ***
Comment 27 Leszek Matok 2006-08-05 08:55:28 UTC
Bastien, you made me smile :) I thought the behavior was really random, just to see that Num Lock changes it. I'd never thought of this. This hits many people, so let me be the one who asks: is there something wrong with the new tiny patch? If not, will it get commited?
Comment 28 Bastien Nocera 2006-08-05 13:04:37 UTC
As the patch is obviously correct and that it's been sitting there for 4 months, committed to HEAD and gnome-2-14

2006-08-05  Bastien Nocera  <hadess@hadess.net>

        * src/terminal-window.c: (accel_event_key_match):
        Only send Previous tab/Next tab key events to the terminal if there's
        no tab, and not when we reach the boundary with multiple tabs,
        and ignore NumLock as well (Closes: #138609)
Comment 29 Bastien Nocera 2008-09-24 21:08:43 UTC
Somebody broke this, and it happens again with:
gnome-terminal-2.23.91-1.fc10.i386
vte-0.17.3-1.fc10.i386
Comment 30 Christian Persch 2008-09-24 22:06:01 UTC

*** This bug has been marked as a duplicate of 453193 ***