Terminals: Difference between revisions

From miki
Jump to navigation Jump to search
 
(10 intermediate revisions by the same user not shown)
Line 20: Line 20:
</source>
</source>


=== [http://www.tenshu.net/terminator/ Gnome Terminator] ===
=== Gnome Terminator ===
See [[Gnome Terminator]].
A multipane terminal emulator based on Gnome Terminal.

Install it with
<source lang="bash">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
</source>

==== Terminator on GTK3 ====
* See [https://bugs.launchpad.net/terminator/+bug/1030562/comments/101 bug 1030562 (#101)] to download package. '''But you still need to install package dependencies manually'''.

<source lang=bash>
# 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 version and build
debchange --newversion 1.97~ppa3~local --distribution xenial-proposed "gtk3 branch with patches 1520377, 1522542, 1520969"
dpkg-buildpackage -rfakeroot -b -d

# Install
cd ..
sudo dpkg -i terminator_1.97~ppa3~local_all.deb
</source>

==== My default configuration ====
* See [[Configuration Common]]

==== Tip - Using Terminator for console application ====
Say we want to run a custom console application with a custom icon. We can use terminator as follows:
<source lang=bash>
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
</source>

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

<source lang=text>
[[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
</source>

==== On Cygwin ====
* Copy <tt>C:\cygwin\bin\run.exe</tt> as <tt>C:\cygwin\bin\runpython.exe</tt> (wrapper, see <code>man run</code>).
* Create windows shortcut by duplicating e.g. ''xterm'' shortcut and changing command to
<source lang=text>
C:\cygwin\bin\runpython.exe -p /usr/X11R6/bin /usr/bin/terminator --geometry=1435x860+0+0
</source>
:There is an icon at <tt>/usr/share/icons/hicolors/32x32/apps/terminator.png</tt> (convert to .ico with gimp)
* Add a new user environment variable <tt>DISPLAY</tt> = <tt>127.0.0.1:0.0</tt><br/>
* Configuration <tt>~/.config/terminator/config</tt>:
<source lang=text>
[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]
</source>


=== Xterm ===
=== Xterm ===
Line 128: Line 28:


=== RXVT / uRXVT ===
=== RXVT / uRXVT ===
The '''fastest''' terminal using the following test:
<source lang="bash">
time yes | dd count=10k
</source>

rxvt 0.971s
urxvt 0.998s
terminator 2.104s
st 2.227s
gnome-terminal 2.567s
rxvt+screen 3.030s
rxvt+tmux 25.845s


=== [https://github.com/jwilm/alacritty Alacritty] ===
=== [https://github.com/jwilm/alacritty Alacritty] ===
Line 136: Line 48:


;Troubleshoot
;Troubleshoot
* Slower than Gnome Terminal / Terminator on Ubuntu with Intel MESA driver (i915). On Vim, jitter in the scrolling.
* '''{{green|Fixed}}''' &mdash; Slower than Gnome Terminal / Terminator on Ubuntu with Intel MESA driver (i915). On Vim, jitter in the scrolling.
: See [https://github.com/jwilm/alacritty/issues/225#issuecomment-271132853 Issue #225].
: See [https://github.com/jwilm/alacritty/issues/225#issuecomment-271132853 Issue #225]. Now fixed.


=== st (simple terminal) ===
=== st (simple terminal) ===
Line 166: Line 78:


=== True-color support ===
=== True-color support ===

Reference:
* [https://github.com/morhetz/gruvbox/wiki/Terminal-specific morhetz / gruvbox &mdash; Terminal specific]
* [https://gist.github.com/XVilka/8346728 XVilka / TrueColour.md &mdash; Colours in terminal]


=== Cursor type ===
=== Cursor type ===

Latest revision as of 13:17, 11 October 2020

Terminals on Linux

Gnome Terminal

The default terminal on Ubuntu.

Configure cursor type

Use gconftool to configure once for all

gconftool-2 --type string --set /apps/gnome-terminal/profiles/Default/cursor_shape <VALUE>

Or use escape sequence for changing it from application [1]:

echo -ne '\e[0 q'    # reset to profile's setting
echo -ne '\e[1 q'    # blinking block
echo -ne '\e[2 q'    # steady block
echo -ne '\e[3 q'    # blinking underline
echo -ne '\e[4 q'    # steady underline
echo -ne '\e[5 q'    # blinking I-beam
echo -ne '\e[6 q'    # steady I-beam

Gnome Terminator

See Gnome Terminator.

Xterm

Xterm is the legacy terminal emulator under X. See Xterm.

RXVT / uRXVT

The fastest terminal using the following test:

time yes | dd count=10k
rxvt            0.971s
urxvt           0.998s
terminator      2.104s
st              2.227s
gnome-terminal  2.567s
rxvt+screen     3.030s
rxvt+tmux      25.845s

Alacritty

Alacritty is a new GPU-accelerated terminal, touted to be the fastest terminal ever.

Troubleshoot
  • Fixed — Slower than Gnome Terminal / Terminator on Ubuntu with Intel MESA driver (i915). On Vim, jitter in the scrolling.
See Issue #225. Now fixed.

st (simple terminal)

st, aka simple terminal from suckless.org, is a simple terminal implementation for X, that sucks less.

On Ubuntu, install either from package

sudo apt install stterm

Or download the git repository and compile from source.

git clone git://git.suckless.org/st
cd st
make clean install

To configure st, edit config.h and build again. Check also the excellent ArchLinux page on st.

Notty

From Notty project page: notty is a virtual terminal like xterm, gnome-vte, sh, or rxvt. Unlike these programs, notty is not intended to emulate a DEC VT-series physical video terminal, or any other physical device. Instead, notty is an experimental project to bring new features to the command-line which would not have been possible for the physical terminals other terminals emulate.

Terminal features

Terminfo

256-color support

True-color support

Reference:

Cursor type

  • Block vs Caret
  • Blinking vs steady