! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Feature request: Ctrl+Tab to switch between the two most recent tabs
Status:
RESOLVED: FIXED
Severity:
enhancement
Product:
Xfce4-terminal
Component:
General

Comments

Description Far223 2019-03-15 20:20:17 CET
In Firefox, there is an option (not sure if it is the default) to switch to recent tabs by pressing Ctrl+Tab, just like Alt+Tab switches to previously focused windows in window managers. I am not asking for this complete feature set which would be long to implement.

But since you have implemented a way to bind Ctrl+Tab in #15092, could you also add an option so that repeatedly pressing Ctrl+Tab cycles between the two most recent tabs? e.g. I have 5 tabs open, I switch to the second and then the fourth by clicking on them, and now pressing Ctrl+Tab alternates between the second and the fourth tab.
Comment 1 Igor editbugs 2019-03-21 17:05:36 CET
Hi, thanks for the suggestion!

I'm not sure about adding 2 conflicting options: if both are set to true, what will Ctrl+Tab do then?
Comment 2 Git Bot editbugs 2019-03-21 17:13:10 CET
Igor referenced this bugreport in commit 62df87a0012dd7c25e1c86916b32c38672c4640b

Add action to switch to last active tab

https://git.xfce.org/apps/xfce4-terminal/commit?id=62df87a0012dd7c25e1c86916b32c38672c4640b
Comment 3 Far223 2019-03-22 12:32:46 CET
Since Ctrl+Tab is not a normal keyboard shortcut anyway, you could maybe have only one hidden pref: when false (or true), Ctrl+Tab cycles forward and Ctrl+Shift+Tab cycles backward. When true, Ctrl+Tab switches to the last active tab and Ctrl+Shift+Tab does nothing.

Or you could have two prefs: one that makes the tab key do something, and another that chooses between the two modes (which requires that the first pref be true).
Comment 4 Git Bot editbugs 2019-03-27 18:02:31 CET
Igor referenced this bugreport in commit 650b4f8324d3b977bd3cf2ccdef4a08f0a067e7d

Add support for the Tab key in shortcuts

https://git.xfce.org/apps/xfce4-terminal/commit?id=650b4f8324d3b977bd3cf2ccdef4a08f0a067e7d
Comment 5 Igor editbugs 2019-03-27 18:06:25 CET
I've made something better (I hope).

Please meet the first-ever support for keyboard shortcuts that contain Tab in GTK apps!
Now, you can assign a Tab key shortcut to any action via the ~/.config/xfce4/terminal/accels.sm file.
Comment 6 Far223 2019-03-31 12:24:25 CEST
Thank you very much, I tried binding close-tab and last-active-tab to "<Primary>Tab" in ~/.config/xfce4/terminal/accels.scm and it worked. Two things to add though:

----- the line

; (gtk_accel_path "<Actions>/terminal-window/last-active-tab" "")

didn't automatically appear in my ~/.config/xfce4/terminal/accels.scm, I had to add it manually. But this might be a problem with upstream GTK.

----- if you close the current tab or the last active tab and there are still more than one tab, doing last-active-tab does nothing and gives the error

(xfce4-terminal:5902): GLib-GObject-WARNING **: 11:07:35.266: invalid unclassed pointer in cast to 'GtkWidget'

because the last active tab has been closed. I am fine with last-active-tab doing nothing in this case.
Comment 7 Git Bot editbugs 2019-03-31 22:57:14 CEST
Igor referenced this bugreport in commit 42e9d6b0b8c8cb67b0446b00184cb811731b2634

Save accelerators map on exit

https://git.xfce.org/apps/xfce4-terminal/commit?id=42e9d6b0b8c8cb67b0446b00184cb811731b2634
Comment 8 Igor editbugs 2019-03-31 22:59:07 CEST
Hi Far223, the latest commit should write all missing actions to the file when exiting the terminal.

I cannot reproduce the GLib-GObject-WARNING here, could you please describe the steps? Thanks!
Comment 9 Far223 2019-04-01 21:50:04 CEST
To reproduce this: start xfce4-terminal, open two new tabs so that we have three in total. The last active tab is the second one and the third one is focused. Now close the second one with a middle click on it or the cross (without focusing it). Now do last-active-tab: it does nothing because it wants to go to the one we just closed.
Comment 10 Igor editbugs 2019-04-01 21:57:34 CEST
(In reply to Far223 from comment #9)
> To reproduce this: start xfce4-terminal, open two new tabs so that we have
> three in total. The last active tab is the second one and the third one is
> focused. Now close the second one with a middle click on it or the cross
> (without focusing it). Now do last-active-tab: it does nothing because it
> wants to go to the one we just closed.
Thanks!

I still cannot reproduce it with the cross but closing the last active tab with middle click does the trick.
Comment 11 Git Bot editbugs 2019-04-01 22:01:37 CEST
Igor referenced this bugreport in commit 12a6523a3d05bb16947316a9efe3eae37ac37ef1

Properly clear last_active_tab

https://git.xfce.org/apps/xfce4-terminal/commit?id=12a6523a3d05bb16947316a9efe3eae37ac37ef1

Bug #15201

Reported by:
Far223
Reported on: 2019-03-15
Last modified on: 2019-04-01

People

CC List:
0 users

Version

Version:
0.8.7.4

Attachments

Additional information