Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
57742c0
Add tmux support
manno Jan 31, 2021
d528ea3
wip: fix tmux mode
manno Jan 31, 2021
52047e7
Ignore virtual environment folder
iamjackg Mar 21, 2021
279fc1e
Disable buffering so stdin is immediately sent
iamjackg Mar 21, 2021
6d62711
Fix emptying out of queue (hack)
iamjackg Mar 21, 2021
294ff92
Use callback name instead of function references
iamjackg Mar 21, 2021
753b946
Import get_column_row_count
iamjackg Mar 21, 2021
473cac5
Use bytes everywhere for now, we'll do some proper decoding where nec…
iamjackg Mar 21, 2021
68d2a8c
Add a bunch of embarrassing debug messages
iamjackg Mar 21, 2021
17810e6
Reformat with Black
iamjackg Mar 21, 2021
b829922
Return True after handling keypress
iamjackg Mar 21, 2021
a5e91a9
Return True after handling keypress
iamjackg Mar 21, 2021
08f27fb
Return True after handling keypress
iamjackg Mar 21, 2021
92f9e27
Return True after handling keypress
iamjackg Mar 21, 2021
ab6400d
Remove Shell forking message when using tmux
iamjackg Mar 21, 2021
2f4988b
Not all notifications have more than one word
iamjackg Mar 21, 2021
39cd00a
Rename run_command to spawn_tmux_child
iamjackg Mar 21, 2021
bb526b5
Disable zooming and terminal drag and drop when in tmux mode
iamjackg Mar 21, 2021
167616f
Try to account for terminal separators when giving tmux a window size
iamjackg Mar 21, 2021
87f2697
Lint
iamjackg Mar 21, 2021
cdcdb2d
Handle tmux closing a window on us
iamjackg Mar 21, 2021
db6ebdb
Don't determine CWD if using a remote tmux instance
iamjackg Mar 21, 2021
71fe7d9
Don't buffer remote connections
iamjackg Mar 21, 2021
67bcb33
Prevent zooming through any means when in tmux mode
iamjackg Mar 21, 2021
b0765b8
Black
iamjackg Mar 21, 2021
1c75233
Clean up some debug messages
iamjackg Mar 21, 2021
358a223
Clean up some debug messages
iamjackg Mar 21, 2021
9374c3e
Fix tests
iamjackg Mar 21, 2021
94ad8e0
Actually fix test
iamjackg Mar 22, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ terminatorlib/meliae
.intltool*
data/terminator.appdata.xml
data/terminator.desktop

venv/
22 changes: 14 additions & 8 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Packages are known to be available under the name "terminator" under a
lot of distributions, see below for a list.

I also maintain a PPA for Ubuntu 20.04 and up that has the latest release
If you're running ubuntu 20.04 or later, you can run
If you're running ubuntu 20.04 or later, you can run

```
sudo add-apt-repository ppa:mattrose/terminator
Expand All @@ -24,14 +24,20 @@ dependencies yourself:
**Python 3.5+ recommended:** `python3` or `python37` (in FreeBSD)

**Python GTK and VTE bindings:**
Fedora/CentOS: python3-gobject python3-configobj python3-psutil vte291

Fedora/CentOS: python3-gobject python3-configobj python3-psutil vte291
keybinder3 intltool gettext
Debian/Ubuntu: python3-gi python3-gi-cairo python3-psutil python3-configobj
gir1.2-keybinder-3.0 gir1.2-vte-2.91 gettext intltool dbus-x11
FreeBSD: py37-psutil py37-configobj keybinder-gtk3 py37-gobject3 gettext
Debian/Ubuntu: python3-gi python3-gi-cairo python3-psutil python3-configobj
gir1.2-keybinder-3.0 gir1.2-vte-2.91 gettext intltool dbus-x11
FreeBSD: py37-psutil py37-configobj keybinder-gtk3 py37-gobject3 gettext
intltool libnotify vte3

**Python PyParsing library (only required for Tmux mode):**

Debian/Ubuntu: python-pyparsing

FreeBSD: devel/py-pyparsing

If you don't care about native language support or icons, Terminator
should run just fine directly from this directory, just:

Expand All @@ -43,7 +49,7 @@ And go from there. Manpages are available in the 'doc' directory.
> make sure to update either the shebangs, call the scripts with `python3` or
> use a wrapper script.
>
> Setuptools install will update the scripts with the correct shebang.
> Setuptools install will update the scripts with the correct shebang.

To install properly, run:

Expand Down Expand Up @@ -74,7 +80,7 @@ Where ${PREFIX} is the base install directory; e.g. /usr/local.
If you maintain terminator for an OS other than these, please get in touch
or issue a PR to this file.

Distribution | Contact | Package Info | Source Code | Bug Tracker |
Distribution | Contact | Package Info | Source Code | Bug Tracker |
-------------|---------|-----|-------------|-------------|
ArchLinux | [@grazzolini] | [archlinux.org] | [git.archlinux.org] | [bugs.archlinux.org]
CentOS EPEL | [@mattrose], [@dmaphy] | | [src.fedoraproject.org/branches]
Expand Down
13 changes: 13 additions & 0 deletions TMUX.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Tmux control mode

Terminator support the [tmux control mode](http://man7.org/linux/man-pages/man1/tmux.1.html#CONTROL_MODE).

Remote SSH example, starts tmux on remote host and displays tabs and splits in terminator:
```
terminator -t --remote example.org
```

Local session:
```
terminator -t
```
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ def _find_css_files (self):
packages=[
'terminatorlib',
'terminatorlib.plugins',
'terminatorlib.tmux',
],
setup_requires=[
'pytest-runner',
Expand Down
10 changes: 9 additions & 1 deletion terminator
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import sys
import os
import psutil
import pwd
import time
try:
ORIGCWD = os.getcwd()
except OSError:
Expand Down Expand Up @@ -88,8 +89,10 @@ if __name__ == '__main__':
# continue. Failure to import dbus, or the global config option "dbus"
# being False will cause us to continue without the dbus server and open a
# window.
# Disable DBUS if using tmux, so we can have multiple sessions (e.g. local
# and remote, multiple remotes, etc.)
try:
if OPTIONS.nodbus:
if OPTIONS.nodbus or OPTIONS.tmux:
dbg('dbus disabled by command line')
raise ImportError
from terminatorlib import ipc
Expand Down Expand Up @@ -125,12 +128,17 @@ if __name__ == '__main__':
TERMINATOR.ibus_running = ibus_running

try:
if OPTIONS.tmux:
TERMINATOR.start_tmux(remote=OPTIONS.remote)
while TERMINATOR.initial_layout is None:
time.sleep(0.1)
dbg('Creating a terminal with layout: %s' % OPTIONS.layout)
TERMINATOR.create_layout(OPTIONS.layout)
except (KeyError,ValueError) as ex:
err('layout creation failed, creating a window ("%s")' % ex)
TERMINATOR.new_window()
TERMINATOR.layout_done()
TERMINATOR.initial_layout = None

if OPTIONS.debug and OPTIONS.debug >= 2:
import terminatorlib.debugserver as debugserver
Expand Down
2 changes: 2 additions & 0 deletions terminatorlib/cwd.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

def get_pid_cwd(pid = None):
"""Determine the cwd of the current process"""
if pid is not None:
pid = int(pid)
psinfo = psutil.Process(pid).as_dict()
dbg('psinfo: %s %s' % (psinfo['cwd'],psinfo['pid']))
# return func
Expand Down
4 changes: 3 additions & 1 deletion terminatorlib/notebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,9 @@ def split_axis(self, widget, vertical=True, cwd=None, sibling=None, widgetfirst=
sibling.set_cwd(cwd)
if self.config['always_split_with_profile']:
sibling.force_set_profile(None, widget.get_profile())
sibling.spawn_child()
sibling.spawn_child(
orientation='vertical' if vertical else 'horizontal',
active_pane_id=getattr(widget, 'pane_id', None))
if widget.group and self.config['split_to_group']:
sibling.set_group(None, widget.group)
elif self.config['always_split_with_profile']:
Expand Down
4 changes: 4 additions & 0 deletions terminatorlib/optionparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ def parse_options():
dest='borderless', help=_('Disable window borders'))
parser.add_option('-H', '--hidden', action='store_true', dest='hidden',
help=_('Hide the window at startup'))
parser.add_option('-t', '--tmux', action='store_true',
dest='tmux', help=_('Enable tmux integration'))
parser.add_option('-T', '--title', dest='forcedtitle',
help=_('Specify a title for the window'))
parser.add_option('--geometry', dest='geometry', type='string',
Expand All @@ -72,6 +74,8 @@ def parse_options():
callback=execute_cb,
help=_('Use the rest of the command line as a command to '
'execute inside the terminal, and its arguments'))
parser.add_option('--remote', dest='remote',
help=_('Specify a remote server for tmux to connect to'))
parser.add_option('-g', '--config', dest='config',
help=_('Specify a config file'))
parser.add_option('-j', '--config-json', dest='configjson',
Expand Down
4 changes: 3 additions & 1 deletion terminatorlib/paned.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ def split_axis(self, widget, vertical=True, cwd=None, sibling=None,
sibling.set_cwd(cwd)
if self.config['always_split_with_profile']:
sibling.force_set_profile(None, widget.get_profile())
sibling.spawn_child()
sibling.spawn_child(
orientation='vertical' if vertical else 'horizontal',
active_pane_id=getattr(widget, 'pane_id', None))
if widget.group and self.config['split_to_group']:
sibling.set_group(None, widget.group)
elif self.config['always_split_with_profile']:
Expand Down
Loading