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.
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?
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
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).
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
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.
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.
Igor referenced this bugreport in commit 42e9d6b0b8c8cb67b0446b00184cb811731b2634 Save accelerators map on exit https://git.xfce.org/apps/xfce4-terminal/commit?id=42e9d6b0b8c8cb67b0446b00184cb811731b2634
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!
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.
(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.
Igor referenced this bugreport in commit 12a6523a3d05bb16947316a9efe3eae37ac37ef1 Properly clear last_active_tab https://git.xfce.org/apps/xfce4-terminal/commit?id=12a6523a3d05bb16947316a9efe3eae37ac37ef1