#! perl
# TabbedEx plugin for rxvt-unicode; based on original tabbed plugin.
# https://github.com/mina86/urxvt-tabbedex
# Copyright 2006-2020 tabbed and tabbedex authors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
=head1 NAME
tabbedex - tabbed interface to urxvt; extended
=head1 DESCRIPTION
This extension implements a tabbed terminal. Once rxvt-unicode starts, slave
terminals can be started in their own tabs and switched between. At each point
only one terminal is visible. rxvt-unicode exits once all tabs are closed.
Once at least two tabs are created a tab bar is displayed at the top of the
window which lists all the slave terminals. Clicking on a number/name of a tab
on that bar switches to it.
tabbedex is an extended version of the tabbed plugin distributed with urxvt.
=head2 Key bindings
Creating new tabs, switching between them and moving them around can be
performed through the following key bindings:
=over
=item B
Creates a new tab.
=item B and B
Switches to the tab on the left or on the right of the current tab. Movement
wraps around once at the first or last tab.
=item B through B
Switches to the first through twelfth tab.
=item B and B
Move current tab to the left or right. Wraps around on the first and last
position.
=item B
Allows current tab to be renamed. Tab bar is shown if it was hidden, current
tab's name (if any) is cleared and cursor is displayed in its place. Typing
text renames the tab, backspace or Ctrl+H delete the last character, Escape or
Ctrl+C aborts the rename operation and Enter accepts the new name.
=back
Default key bindings can be disabled using B resource (see
below) and replaced with custom ones using urxvt's B resource.
=head1 CONFIGURATION
The extension can be configured with X resources just like urxvt itself, for
example:
URxvt.tabbedex.tabbar-fg: 4
URxvt.tabbedex.tabbar-bg: 0
Tabbedex recognises the following resources:
=over
=item B: I
If set (the default), the tab bar will be hidden unless there are at least two
tabs open. This is irrespective of whether C button or tab's title is
displayed.
=item B: I
If set, a C button will be displayed on the left of the tab bar. Clicking
the button creates a new tab. It is not displayed by default.
=item B: I
If set (the default), when tab bar is visible and there is enough space left,
current tab's title will be displayed after the last tab.
=item B: [I