-
Notifications
You must be signed in to change notification settings - Fork 0
/
2020-09-26-terminal.html
293 lines (255 loc) · 12.7 KB
/
2020-09-26-terminal.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="alternate"
type="application/rss+xml"
href="https://icot.github.io/rss.xml"
title="RSS feed for https://icot.github.io/">
<title>Terminal emulators</title>
<meta name="author" content="icot">
<meta name="referrer" content="no-referrer">
<link href="static/style.css" rel="stylesheet" type="text/css"/>
<link rel="icon" href="static/favicon.ico">
</head>
<body>
<div id="preamble" class="status"><div class="header"> <a href="https://icot.github.io">icot.github.io</a> <div class="sitelinks"> <a href="about.html">about</a> | <a href="archive.html">archive</a> | <div class="dropdown"> <a href="tags/html" class="dropbtn">tags</a> <div class="dropdown-content"> </div> </div> | <a href="rss.xml">rss</a> </div></div></div>
<div id="content">
<div class="post-date">26 Sep 2020</div><h1 class="post-title"><a href="https://icot.github.io/2020-09-26-terminal.html">Terminal emulators</a></h1>
<nav id="table-of-contents" role="doc-toc">
<h2>Table of Contents</h2>
<div id="text-table-of-contents" role="doc-toc">
<ul>
<li><a href="#orge506df3">1. Alacritty</a></li>
<li><a href="#orgf584634">2. Kitty</a>
<ul>
<li><a href="#org5414dfb">2.1. ~/.config/kitty/kitty.conf</a></li>
</ul>
</li>
<li><a href="#orgf0cdb92">3. Throughput/Latency</a>
<ul>
<li><a href="#org878911f">3.1. Lazy test conditions and comments</a></li>
</ul>
</li>
</ul>
</div>
</nav>
<p>
I’ve been using the same terminal emulator (<b><b>rxvt</b></b> and latter <b><b>urxvt</b></b>) since around 2008.
I was pretty happy with the setup, running it with <b>urxvtd/urxvtc</b> until I tried to play around
with family fonts including powerline symbols, and certain unicode characters which I never
managed to get to display correctly.
</p>
<p>
Additionally, at some point I added a second monitor to my home setup, with a higher resolution
(2560x1440) than the older one (1920x1080) and finding a font family/size combination that rendered
properly in both resolutions was rather problematic, so I was open to try alternatives.
</p>
<div id="outline-container-orge506df3" class="outline-2">
<h2 id="orge506df3"><span class="section-number-2">1.</span> Alacritty</h2>
<div class="outline-text-2" id="text-1">
<p>
I had been looking into Rust CLI tools after a colleague recommended <a href="https://github.com/sharkdp/bat">bat</a>, the cat alternative.
I’m always a bit wary of the trend to re-implement <i>standard</i> tools in the latest trendy programming
language, but as I was also interested in looking into Rust itself, I did some looking into other
CLI tools developed in Rust, finding things like <b>dust</b>, <b>fd</b>, <b>exa</b> and also <a href="https://github.com/alacritty/alacritty">alacritty</a>:
</p>
<blockquote>
<p>
Alacritty is a terminal emulator with a strong focus on simplicity and
performance. With such a strong focus on performance, included features are
carefully considered and you can always expect Alacritty to be blazingly fast.
By making sane choices for defaults, Alacritty requires no additional setup.
However, it does allow configuration of many aspects of the terminal.
</p>
<p>
The software is considered to be at a beta level of readiness – there are a few
missing features and bugs to be fixed, but it is already used by many as a daily
driver.
</p>
</blockquote>
<p>
I was curious regarding the GPU gimmick, so I cloned the repository and built it locally and was quickly
very satisfied with a few things:
</p>
<ol class="org-ol">
<li><b>Very</b> fast feeling (in terms of latency), specially when used with TMUX, in comparison with <b>urxvt</b>.</li>
<li>Out of the box working seamlessly with the font families I wanted to use.</li>
<li>Somehow less noticeable difference in font size when using the same font size in both monitors side
to side. I don’t really understand how and why, but felt better to the eye.</li>
</ol>
<p>
I instantly started using it as my main terminal and have used it exclusively with no major issue
for the last ~5 months, until I tried <a href="https://sw.kovidgoyal.net/kitty/">kitty</a> last week.
</p>
</div>
</div>
<div id="outline-container-orgf584634" class="outline-2">
<h2 id="orgf584634"><span class="section-number-2">2.</span> Kitty</h2>
<div class="outline-text-2" id="text-2">
<p>
I had heard about <b>kitty</b> before, but for some reason assumed it was more OS X oriented as
most of the people recommending it in forums where using it on that system.
</p>
<p>
After hearing about it again in a HackerNews thread I did a bit of reading and found out that:
</p>
<ol class="org-ol">
<li>It’s also GPU based like <b>alacritty</b></li>
<li>Not looking to be minimal, more rich feature setup: tab and multiplexing support</li>
<li>Available in <b>Debian</b> testing repositories, which I use</li>
</ol>
<p>
I missed tab support with <b>alacritty</b>, as I used the functionality with <b>urxvt</b> and like it for
some of my workflows.
</p>
<p>
I needed to add some minimal modifications to the default configuration, mostly to switch
the main modifier from Ctrl+Shift to just Ctrl, and then to disable some duplicated key mappings
after changing the main modifier which conflicted with some of my shell keybindings.
</p>
<p>
The latency feeling is equally fast as <b>alacritty</b>, but the fact that <b>kitty</b> is already
a Debian package, plus the tab support are winner qualities for me.
</p>
</div>
<div id="outline-container-org5414dfb" class="outline-3">
<h3 id="org5414dfb"><span class="section-number-3">2.1.</span> ~/.config/kitty/kitty.conf</h3>
<div class="outline-text-3" id="text-2-1">
<div class="org-src-container">
<pre class="src src-python"><span style="color: #505050;"># </span><span style="color: #505050;">General behaviour</span>
allow_remote_control true
strip_trailing_spaces true
copy_on_select true
<span style="color: #505050;"># </span><span style="color: #505050;">Font</span>
font_family Source Code Pro
font_size <span style="color: #0000c0;">11.5</span>
<span style="color: #505050;"># </span><span style="color: #505050;">Theme</span>
include ~/workspace/kitty-themes/themes/Monokai.conf
<span style="color: #505050;"># </span><span style="color: #505050;">Tab Bar</span>
tab_bar_style powerline
<span style="color: #505050;"># </span><span style="color: #505050;">mappings</span>
kitty_mod ctrl
<span style="color: #505050;"># </span><span style="color: #505050;">Disable conflicting mappings</span>
<span style="color: #8f0075;">map</span> kitty_mod+a no_op
<span style="color: #8f0075;">map</span> kitty_mod+c no_op
<span style="color: #8f0075;">map</span> kitty_mod+e no_op
<span style="color: #8f0075;">map</span> kitty_mod+r no_op
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-orgf0cdb92" class="outline-2">
<h2 id="orgf0cdb92"><span class="section-number-2">3.</span> Throughput/Latency</h2>
<div class="outline-text-2" id="text-3">
<p>
I was curious about the actual differences, but measuring the latency is not trivial.
After reading Dan Luu’s articles on terminal<sup><a id="fnr.1" class="footref" href="#fn.1" role="doc-backlink">1</a></sup> and keyboard<sup><a id="fnr.2" class="footref" href="#fn.2" role="doc-backlink">2</a></sup> latency, I wanted
to try to replicate some of the results myself (for the 3 terminal I used), and also
was curious about the editor latency results from Pavel Fatin<sup><a id="fnr.3" class="footref" href="#fn.3" role="doc-backlink">3</a></sup> and the use of
his tool <a href="https://github.com/pavelfatin/typometer">typometer</a> but didn’t manage to make it work in the first try (need to
follow certain recommendations to ensure that no program is catching keypresses other
than typometer), so I leave that out for now.
</p>
<p>
I lazily (a few manual repetitions only) replicated the bandwidth tests from <sup><a id="fnr.1.100" class="footref" href="#fn.1" role="doc-backlink">1</a></sup>:
</p>
<div class="org-src-container">
<pre class="src src-zsh">timeout 64 sh -c 'cat /dev/urandom | base32 > junk.txt'
timeout 8 sh -c 'cat junk.txt | tee junk.term_name'
</pre>
</div>
<table>
<colgroup>
<col class="org-left">
<col class="org-left">
<col class="org-left">
<col class="org-left">
</colgroup>
<tbody>
<tr>
<td class="org-left"><b>Throughput (MB/s)</b></td>
<td class="org-left"><b>alacritty</b></td>
<td class="org-left"><b>kitty</b></td>
<td class="org-left"><b>urxvt</b></td>
</tr>
<tr>
<td class="org-left"><b>standalone</b></td>
<td class="org-left">66.8</td>
<td class="org-left">34.25</td>
<td class="org-left">52.88</td>
</tr>
<tr>
<td class="org-left"><b>+tmux</b> (%standalone)</td>
<td class="org-left">37.75 (56%)</td>
<td class="org-left">38.25 (111.6%)</td>
<td class="org-left">39 (76%)</td>
</tr>
<tr>
<td class="org-left"><b>latency eye test</b></td>
<td class="org-left">very fast</td>
<td class="org-left">very fast</td>
<td class="org-left">very fast</td>
</tr>
<tr>
<td class="org-left"><b>latency eye test</b> + tmux</td>
<td class="org-left">smooth</td>
<td class="org-left">smoothest</td>
<td class="org-left">clunky, text rendered in chunks</td>
</tr>
</tbody>
</table>
</div>
<div id="outline-container-org878911f" class="outline-3">
<h3 id="org878911f"><span class="section-number-3">3.1.</span> Lazy test conditions and comments</h3>
<div class="outline-text-3" id="text-3-1">
<ul class="org-ul">
<li>All tests in the same computer and conditions</li>
<li>Results are a single “representative” value. I ran a set of executions on each setup case
to rule out outliers, but didn’t record properly the times to calculate means/stdev</li>
<li>The eye tests corresponded to my personal feeling experienced when running the tests and observing
the text scrolling down.</li>
<li>I’d say that the differences <b>alacritty</b> and <b>kitty</b> are very minimal. The clunkyness in the scrolling
when using <b>urxvt</b> + tmux I had already noticed, but doesn’t impact the actual throughput.</li>
</ul>
</div>
</div>
</div>
<div id="footnotes">
<h2 class="footnotes">Footnotes: </h2>
<div id="text-footnotes">
<div class="footdef"><sup><a id="fn.1" class="footnum" href="#fnr.1" role="doc-backlink">1</a></sup> <div class="footpara" role="doc-footnote"><p class="footpara">
<a href="https://danluu.com/term-latency/">https://danluu.com/term-latency/</a>
</p></div></div>
<div class="footdef"><sup><a id="fn.2" class="footnum" href="#fnr.2" role="doc-backlink">2</a></sup> <div class="footpara" role="doc-footnote"><p class="footpara">
<a href="https://danluu.com/keyboard-latency/">https://danluu.com/keyboard-latency/</a>
</p></div></div>
<div class="footdef"><sup><a id="fn.3" class="footnum" href="#fnr.3" role="doc-backlink">3</a></sup> <div class="footpara" role="doc-footnote"><p class="footpara">
<a href="https://pavelfatin.com/typing-with-pleasure/">https://pavelfatin.com/typing-with-pleasure/</a>
</p></div></div>
</div>
</div><div class="taglist"><a href="https://icot.github.io/tags.html">Tags</a>: <a href="https://icot.github.io/tag-terminal.html">terminal</a> <a href="https://icot.github.io/tag-emulator.html">emulator</a> <a href="https://icot.github.io/tag-latency.html">latency</a> <a href="https://icot.github.io/tag-kitty.html">kitty</a> <a href="https://icot.github.io/tag-alacritty.html">alacritty</a> </div></div>
<div id="postamble" class="status"><center>
<a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">
<img alt="Creative Commons License" style="border-width:0; height:1.5em"
src="https://mirrors.creativecommons.org/presskit/buttons/80x15/png/by-sa.png"/></a>
<br />
<span xmlns:dct="http://purl.org/dc/terms/" href="http://purl.org/dc/dcmitype/Text"
property="dct:title" rel="dct:type">
This personal blog </span> by <a xmlns:cc="http://creativecommons.org/ns#"
href="https://icot.github.io"
property="cc:attributionName" rel="cc:attributionURL">icot</a>
is licensed under a <a rel="license"
href="http://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 International License</a>.
<br />
Made with <a href="https://emacs.org">
<img class="inline" src="https://upload.wikimedia.org/wikipedia/commons/0/08/EmacsIcon.svg" style="height:1.5em; margin-bottom:-0.3em; opacity: 0.9;" alt="Emacs" title="Emacs"/></a>
, <a href="https://orgmode.org">
<img class="inline" src="static/org-mode-unicorn-borderless-icon.svg" alt="Org mode unicorn logo" style="height:1.5em; margin-bottom:-0.3em; opacity:0.9;" title="Org Mode"></a>
and <a href="https://github.com/bastibe/org-static-blog">bastibe/org-static-blog</a>
with the CSS theme based on <a rel="jao.io" href="https://jao.io">jao.io</>'s one.
</center>
</div>
</body>
</html>