Gnome Terminator

From miki
(Redirected from Terminator)
Jump to navigation Jump to search

Gnome Terminator is a multipane terminal emulator based on Gnome Terminal.

Installation

Install it with

sudo add-apt-repository ppa:gnome-terminator          # Not needed on Ubuntu Precise (part of Universe repo)
sudo apt-get update
sudo apt-get install terminator

Terminator on GTK3

  • See bug 1030562 (#101) to download package. But you still need to install package dependencies manually.
# Get terminator/gtk3 sources
sudo apt install bzr
bzr branch lp:terminator/gtk3
cd gtk3

# Apply latest patches
sudo apt install bzrtools
bzr patch <(wget -O - https://bugs.launchpad.net/terminator/+bug/1520377/+attachment/4526119/+files/terminator-1520377-stale-tab-title.patch)
bzr patch <(wget -O - https://bugs.launchpad.net/terminator/+bug/1522542/+attachment/4535308/+files/terminator-1522542-rotate.patch)
bzr patch <(wget -O - https://bugs.launchpad.net/terminator/+bug/1520969/+attachment/4633044/+files/terminator-1520969-distribute-evenly-v3.patch)

# Install dependencies
sudo apt build-dep terminator
sudo apt install gir1.2-keybinder-0.0 gir1.2-keybinder-3.0 libkeybinder-3.0-0 build-essential intltool libgtk-3-dev gobject-introspection libgirepository1.0-dev valac terminator
sudo apt install cdbs

# ... and quick fix for python-support
# (a better solution would be to apply https://wiki.debian.org/Python/TransitionToDHPython2)
sudo apt install dh-python
sudo ln -sf dh_python2 /usr/bin/dh_pysupport

# Change COLORTERM to gnome-terminal -- Fix broken vertical mode in neovim
vi terminatorlib/config.py
# Replace 'truecolor' by 'gnome-terminal'

# Change version and build
# debchange --newversion 1.97~ppa3~local --distribution xenial-proposed "gtk3 branch with patches 1520377, 1522542, 1520969"
# debchange --newversion 1.97~ppa3~local2 --distribution xenial-proposed "Fix broken vertical mode in neovim"
debchange --newversion 1.97~ppa3~local3 --distribution xenial-proposed "Restore TERM, but set COLORTERM=gnome-terminal"
dpkg-buildpackage -rfakeroot -b -d

# Install
cd ..
sudo dpkg -i terminator_1.97~ppa3~local_all.deb

My default configuration

Plugins

Tips

Using Terminator for console application

Say we want to run a custom console application with a custom icon. We can use terminator as follows:

terminator -m -p nvim -i /usr/local/icons/neovim.png -u -x nvim
# -m         Maximize
# -p nvim    Select custom profile (see below)
# -i ...     Select custom icon
# -u         Don't use DBus (to avoid terminal appearing in background, see https://bugs.launchpad.net/terminator/+bug/1508531)
# -x nvim    The application to start

We configured the profile as follows. The important settings are scroll_on_keystroke, scrollbar_position and show_titlebar.

  [[nvim]]
    background_color = "#ffffdd"
    cursor_color = "#aaaaaa"
    font = Fantasque Sans Mono 10
    foreground_color = "#000000"
    scroll_on_keystroke = False
    scrollbar_position = hidden
    show_titlebar = False
    use_system_font = False

On Cygwin

  • Copy C:\cygwin\bin\run.exe as C:\cygwin\bin\runpython.exe (wrapper, see man run).
  • Create windows shortcut by duplicating e.g. xterm shortcut and changing command to
C:\cygwin\bin\runpython.exe -p /usr/X11R6/bin /usr/bin/terminator --geometry=1435x860+0+0
There is an icon at /usr/share/icons/hicolors/32x32/apps/terminator.png (convert to .ico with gimp)
  • Add a new user environment variable DISPLAY = 127.0.0.1:0.0
  • Configuration ~/.config/terminator/config:
[global_config]
[keybindings]
  full_screen = <Alt>F11
[profiles]
  [[default]]
    use_system_font = False
    login_shell = True
    foreground_color = "#000000"
    font = Bitstream Vera Sans Mono 9
    background_color = "#ffffdd"
    scrollback_infinite = True
[layouts]
  [[default]]
    [[[child1]]]
      type = Terminal
      parent = window0
    [[[window0]]]
      type = Window
      parent = ""
[plugins]

Middle-click patch on Wayland / Debian Bullseye

On Debian Bullseye with Wayland, middle click does not paste selection as it should [1].

We must import a patch, see commit fb6b940f:

git checkout https://github.com/gnome-terminator/terminator.git
cd terminator
git checkout v1.92
git cp fb6b940f
cd ..
apt source terminator            # version 1.92-2
cd terminator-1.92
cp terminator/terminatorlib/terminal.py terminator-1.92/terminatorlib/

Troubleshooting

Terminator crashes / restart on start

Symptoms: the window opens (full screen), then disappear and reappear again.

This is due to a bad layout configuration in the config file. Delete the layout section.

Ctrl-Shift-0 shortcut not working

This may happen in Linux VM under Windows.

  • On Windows 7, the Ctrl-Shift is by default assigned to keyboard layout change [2].
  • To change Control Panel → Region and Language → Keyboards and Languages → Change Keyboards → Advanced Key Settings → select Between in put languages and click Change Key Sequence. Disable the Ctrl-Shift shortcut.