fatty 0.99.8 → 0.99.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +316 -211
- data/README.org +94 -0
- data/exe/fatty +58 -9
- data/exe/themer +273 -0
- data/lib/fatty/ansi/renderer.rb +17 -7
- data/lib/fatty/api/output.rb +4 -15
- data/lib/fatty/api/suspend.rb +9 -0
- data/lib/fatty/api.rb +1 -0
- data/lib/fatty/callback_environment.rb +1 -0
- data/lib/fatty/config_files/themes/capuchin_monk.yml +4 -8
- data/lib/fatty/config_files/themes/catppuccin_latte.yml +4 -8
- data/lib/fatty/config_files/themes/catppuccin_mocha.yml +4 -8
- data/lib/fatty/config_files/themes/cyberpunk.yml +4 -8
- data/lib/fatty/config_files/themes/dracula.yml +4 -8
- data/lib/fatty/config_files/themes/everforest_dark.yml +4 -8
- data/lib/fatty/config_files/themes/gruvbox_dark.yml +4 -8
- data/lib/fatty/config_files/themes/gruvbox_light.yml +4 -8
- data/lib/fatty/config_files/themes/mono.yml +6 -10
- data/lib/fatty/config_files/themes/monokai.yml +4 -8
- data/lib/fatty/config_files/themes/nordic.yml +16 -8
- data/lib/fatty/config_files/themes/onedark.yml +4 -8
- data/lib/fatty/config_files/themes/solarized_dark.yml +4 -8
- data/lib/fatty/config_files/themes/solarized_light.yml +4 -8
- data/lib/fatty/config_files/themes/terminal.yml +8 -12
- data/lib/fatty/config_files/themes/tokyo_night.yml +4 -8
- data/lib/fatty/config_files/themes/wordperfect.yml +1 -5
- data/lib/fatty/log_formats/json.rb +1 -1
- data/lib/fatty/log_formats/text.rb +1 -2
- data/lib/fatty/output_buffer.rb +40 -5
- data/lib/fatty/renderer/curses.rb +60 -8
- data/lib/fatty/renderer/truecolor.rb +46 -10
- data/lib/fatty/session/output_session.rb +25 -9
- data/lib/fatty/terminal.rb +12 -0
- data/lib/fatty/themes/manager.rb +12 -3
- data/lib/fatty/themes/resolver.rb +1 -1
- data/lib/fatty/version.rb +1 -1
- metadata +4 -1
data/README.md
CHANGED
|
@@ -1,111 +1,115 @@
|
|
|
1
|
-
- [Introduction](#
|
|
2
|
-
- [Quick Start](#
|
|
3
|
-
- [Installing](#
|
|
4
|
-
- [Trying it Out with the \`fatty\` Demo](#
|
|
5
|
-
- [Builtin commands](#
|
|
6
|
-
- [Screenshots](#
|
|
7
|
-
- [Command line editing](#
|
|
8
|
-
- [Searchable Output](#
|
|
9
|
-
- [Paging Markdown](#
|
|
10
|
-
- [Popup Selection](#
|
|
11
|
-
- [Usage](#
|
|
12
|
-
- [Launching a Fatty Terminal](#
|
|
13
|
-
- [`on_accept`](#
|
|
14
|
-
- [Parameters to `on_accept`](#
|
|
15
|
-
- [The `line` parameter to `on_accept`](#
|
|
16
|
-
- [The callback parameter to `on_accept`](#
|
|
17
|
-
- [Output ordering](#
|
|
18
|
-
- [Long-running callbacks and interruption](#
|
|
19
|
-
- [ANSI colors in output](#
|
|
20
|
-
- [Other parameters to `Terminal.new`](#
|
|
21
|
-
- [The Callback API](#
|
|
22
|
-
- [`append(text, follow: true, role: nil)`](#
|
|
23
|
-
- [`append_now(text, follow: true, mode: nil, role: nil)`](#
|
|
24
|
-
- [`markdown(text)`](#
|
|
25
|
-
- [`status(text, role: :info)`](#
|
|
26
|
-
- [`good(text, replace: false, render: true)`](#
|
|
27
|
-
- [`info(text, replace: false, render: true)`](#
|
|
28
|
-
- [`warn(text, replace: false, render: true)`](#
|
|
29
|
-
- [`error(text, replace: false, render: true)`](#
|
|
30
|
-
- [`oops(text, replace: false, render: true)`](#
|
|
31
|
-
- [`alert(text, role: :info)`](#
|
|
32
|
-
- [`prompt(prompt, initial: "", cancel_value: nil, history_key: nil, save_history: true)`](#
|
|
33
|
-
- [`check_interrupt!`](#
|
|
34
|
-
- [`add_progress(label:, total: nil, style: :percent, role: :info, width: 40)`](#
|
|
35
|
-
- [Initialization `add_progress(label:, style: :percent, total: nil, role: :info, width: 40)`](#
|
|
36
|
-
- [Update `update(current: nil, indicator: nil, render: false)`](#
|
|
37
|
-
- [Finish](#
|
|
38
|
-
- [Clear](#
|
|
39
|
-
- [`choose(prompt, choices:, initial_choice_idx: 0, cancel_value: nil)`](#
|
|
40
|
-
- [`choose_multi(prompt, choices:, cancel_value: nil)`](#
|
|
41
|
-
- [`confirm(prompt, yes_label: "Yes", no_label: "No", cancel_value: false)`](#
|
|
42
|
-
- [`menu(prompt, choices:, initial_choice_idx: 0, cancel_value: nil)`](#
|
|
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
|
-
- [Theme
|
|
104
|
-
- [
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
1
|
+
- [Introduction](#orgc090857)
|
|
2
|
+
- [Quick Start](#org844168e)
|
|
3
|
+
- [Installing](#orge9b8048)
|
|
4
|
+
- [Trying it Out with the \`fatty\` Demo](#org9284335)
|
|
5
|
+
- [Builtin commands](#orga9c3071)
|
|
6
|
+
- [Screenshots](#org0e411f4)
|
|
7
|
+
- [Command line editing](#org68abe96)
|
|
8
|
+
- [Searchable Output](#orgca94584)
|
|
9
|
+
- [Paging Markdown](#org458ad81)
|
|
10
|
+
- [Popup Selection](#orgfb3da2e)
|
|
11
|
+
- [Usage](#orgf00946d)
|
|
12
|
+
- [Launching a Fatty Terminal](#orgc5ba25f)
|
|
13
|
+
- [`on_accept`](#orgb046bd4)
|
|
14
|
+
- [Parameters to `on_accept`](#orgd3107f2)
|
|
15
|
+
- [The `line` parameter to `on_accept`](#orga7ac101)
|
|
16
|
+
- [The callback parameter to `on_accept`](#org7590a60)
|
|
17
|
+
- [Output ordering](#org640dc41)
|
|
18
|
+
- [Long-running callbacks and interruption](#org34665cc)
|
|
19
|
+
- [ANSI colors in output](#org103299f)
|
|
20
|
+
- [Other parameters to `Terminal.new`](#org456c2ad)
|
|
21
|
+
- [The Callback API](#org5f103bb)
|
|
22
|
+
- [`append(text, follow: true, role: nil)`](#orgf90a804)
|
|
23
|
+
- [`append_now(text, follow: true, mode: nil, role: nil)`](#org96421ae)
|
|
24
|
+
- [`markdown(text)`](#orge61ad54)
|
|
25
|
+
- [`status(text, role: :info)`](#org8d20d95)
|
|
26
|
+
- [`good(text, replace: false, render: true)`](#org4430a3b)
|
|
27
|
+
- [`info(text, replace: false, render: true)`](#org60083e9)
|
|
28
|
+
- [`warn(text, replace: false, render: true)`](#org98a2b3c)
|
|
29
|
+
- [`error(text, replace: false, render: true)`](#orgd4f04ac)
|
|
30
|
+
- [`oops(text, replace: false, render: true)`](#org807c2ce)
|
|
31
|
+
- [`alert(text, role: :info)`](#org96063bb)
|
|
32
|
+
- [`prompt(prompt, initial: "", cancel_value: nil, history_key: nil, save_history: true)`](#org7bb5b38)
|
|
33
|
+
- [`check_interrupt!`](#orga338e63)
|
|
34
|
+
- [`add_progress(label:, total: nil, style: :percent, role: :info, width: 40)`](#orgcb79368)
|
|
35
|
+
- [Initialization `add_progress(label:, style: :percent, total: nil, role: :info, width: 40)`](#org789160a)
|
|
36
|
+
- [Update `update(current: nil, indicator: nil, render: false)`](#orge7cfc41)
|
|
37
|
+
- [Finish](#orgf7533d1)
|
|
38
|
+
- [Clear](#orgede5f40)
|
|
39
|
+
- [`choose(prompt, choices:, initial_choice_idx: 0, cancel_value: nil)`](#org5994004)
|
|
40
|
+
- [`choose_multi(prompt, choices:, cancel_value: nil)`](#orgd82f0ec)
|
|
41
|
+
- [`confirm(prompt, yes_label: "Yes", no_label: "No", cancel_value: false)`](#orga06503c)
|
|
42
|
+
- [`menu(prompt, choices:, initial_choice_idx: 0, cancel_value: nil)`](#org6463694)
|
|
43
|
+
- [`suspend(&block)`](#org5fe1480)
|
|
44
|
+
- [`environment`](#orgd5bf8ee)
|
|
45
|
+
- [Terminal Methods](#org1c1d3fc)
|
|
46
|
+
- [`Teminal#suspend(&block)`](#org5e187ea)
|
|
47
|
+
- [Default Interaction](#org47f52fd)
|
|
48
|
+
- [Parts of the Screen](#orga27a6ad)
|
|
49
|
+
- [Input Field](#orgbd88b45)
|
|
50
|
+
- [Output Pane](#orge98ad82)
|
|
51
|
+
- [Status Area](#org9831bf4)
|
|
52
|
+
- [Alert Area](#org5d9a3d5)
|
|
53
|
+
- [Command-line Editing](#orge76ca34)
|
|
54
|
+
- [Input Context](#org2aaff21)
|
|
55
|
+
- [Cursor Motion](#org14d68c9)
|
|
56
|
+
- [Clearing](#orgd13c620)
|
|
57
|
+
- [Undo and Redo](#org54d5f7a)
|
|
58
|
+
- [Deletion and Killing](#orgcf696da)
|
|
59
|
+
- [Yanking, Mark, and Region](#orga7f73fe)
|
|
60
|
+
- [Count Prefix](#org29d1c16)
|
|
61
|
+
- [History Navigation](#org511da2c)
|
|
62
|
+
- [Completion](#org1648a2a)
|
|
63
|
+
- [Accept or Cancel](#org9afdcdd)
|
|
64
|
+
- [Paging Context](#org8c38312)
|
|
65
|
+
- [Searching Output](#org567c0c0)
|
|
66
|
+
- [String and Regex Search](#orgbf77d1b)
|
|
67
|
+
- [Incremental Search](#orgda99c8d)
|
|
68
|
+
- [Configuration](#orgfd272b4)
|
|
69
|
+
- [General Configuration `config.yml`](#org8e3d563)
|
|
70
|
+
- [`word_char_re`](#org773e7d4)
|
|
71
|
+
- [`esc_delay`](#org8229289)
|
|
72
|
+
- [`history`](#org5789fd5)
|
|
73
|
+
- [`file`](#org1959b2c)
|
|
74
|
+
- [`max`](#orgbb18fb6)
|
|
75
|
+
- [`theme`](#org8a3ecd9)
|
|
76
|
+
- [`truecolor`](#org9ba735f)
|
|
77
|
+
- [`log`](#org13b974b)
|
|
78
|
+
- [`file`](#orgb93c9b8)
|
|
79
|
+
- [`level`](#org0fb9a08)
|
|
80
|
+
- [`tags`](#org2247ba8)
|
|
81
|
+
- [Key code definitions `keydefs.yml`](#org11c2491)
|
|
82
|
+
- [Key bindings `keybindings.yml`](#orgab7252d)
|
|
83
|
+
- [Key Names](#org370c8e8)
|
|
84
|
+
- [Printable Keys](#org3a580c2)
|
|
85
|
+
- [Curses and Fatty Named Keys](#org1e9bcad)
|
|
86
|
+
- [Possibly Invisible Keys](#orgec1f50a)
|
|
87
|
+
- [Unnamed but Recognized Keys](#org56d8cd7)
|
|
88
|
+
- [Mouse Events](#org0eda788)
|
|
89
|
+
- [Modifiers](#orgbffc2cf)
|
|
90
|
+
- [Contexts](#org0662dd0)
|
|
91
|
+
- [Actions](#org55e8a55)
|
|
92
|
+
- [Input buffer actions](#org5c651ab)
|
|
93
|
+
- [Input field actions](#orga37809c)
|
|
94
|
+
- [Shell session actions](#org5bd909b)
|
|
95
|
+
- [Pager actions](#orgcba2897)
|
|
96
|
+
- [Pager search actions](#org2e0b296)
|
|
97
|
+
- [Popup actions](#org76791bc)
|
|
98
|
+
- [Prompt popup actions](#org6b1188d)
|
|
99
|
+
- [Utility Actions](#orgf63740e)
|
|
100
|
+
- [Themes `themes/`](#org3856a84)
|
|
101
|
+
- [Distributed Themes](#org88b0217)
|
|
102
|
+
- [Custom Themes](#org8769885)
|
|
103
|
+
- [Theme Name](#orgd425d6c)
|
|
104
|
+
- [Inheritance from Another Theme](#org1e1695f)
|
|
105
|
+
- [Inheritance within a Theme](#org8557acf)
|
|
106
|
+
- [Theme Roles](#org76e4687)
|
|
107
|
+
- [Role Colors and Attributes and Frame Style](#orge738a22)
|
|
108
|
+
- [The `themer` helper](#orgdd1744c)
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
<a id="orgc090857"></a>
|
|
109
113
|
|
|
110
114
|
# Introduction
|
|
111
115
|
|
|
@@ -133,12 +137,12 @@ In other words, fatty allows you to write a terminal-based REPL of your choosing
|
|
|
133
137
|
`Fatty` is *not* a terminal emulator but runs on top of one.
|
|
134
138
|
|
|
135
139
|
|
|
136
|
-
<a id="
|
|
140
|
+
<a id="org844168e"></a>
|
|
137
141
|
|
|
138
142
|
# Quick Start
|
|
139
143
|
|
|
140
144
|
|
|
141
|
-
<a id="
|
|
145
|
+
<a id="orge9b8048"></a>
|
|
142
146
|
|
|
143
147
|
## Installing
|
|
144
148
|
|
|
@@ -149,7 +153,7 @@ $ gem install fatty
|
|
|
149
153
|
```
|
|
150
154
|
|
|
151
155
|
|
|
152
|
-
<a id="
|
|
156
|
+
<a id="org9284335"></a>
|
|
153
157
|
|
|
154
158
|
## Trying it Out with the \`fatty\` Demo
|
|
155
159
|
|
|
@@ -158,7 +162,7 @@ Once installed, you can try out `fatty` with the included program called `fatty`
|
|
|
158
162
|
Once inside `fatty` you will be prompted with a prompt that names your current directory. Type `help` to get a summary of the builtin commands available to you. If you type anything other than a builtin command, `fatty` attempts to run it as a shell command and displays the output.
|
|
159
163
|
|
|
160
164
|
|
|
161
|
-
<a id="
|
|
165
|
+
<a id="orga9c3071"></a>
|
|
162
166
|
|
|
163
167
|
### Builtin commands
|
|
164
168
|
|
|
@@ -192,12 +196,12 @@ Here are the commands builtin to `fatty`
|
|
|
192
196
|
| colors | Display ANSI, 256-color, and X11 color diagnostics |
|
|
193
197
|
|
|
194
198
|
|
|
195
|
-
<a id="
|
|
199
|
+
<a id="org0e411f4"></a>
|
|
196
200
|
|
|
197
201
|
### Screenshots
|
|
198
202
|
|
|
199
203
|
|
|
200
|
-
<a id="
|
|
204
|
+
<a id="org68abe96"></a>
|
|
201
205
|
|
|
202
206
|
#### Command line editing
|
|
203
207
|
|
|
@@ -206,7 +210,7 @@ Here is the command line, mid-edit showing a region selected and, in dim text to
|
|
|
206
210
|

|
|
207
211
|
|
|
208
212
|
|
|
209
|
-
<a id="
|
|
213
|
+
<a id="orgca94584"></a>
|
|
210
214
|
|
|
211
215
|
#### Searchable Output
|
|
212
216
|
|
|
@@ -215,7 +219,7 @@ While paging output, you can search for words, as here the user searches for the
|
|
|
215
219
|

|
|
216
220
|
|
|
217
221
|
|
|
218
|
-
<a id="
|
|
222
|
+
<a id="org458ad81"></a>
|
|
219
223
|
|
|
220
224
|
#### Paging Markdown
|
|
221
225
|
|
|
@@ -224,7 +228,7 @@ The `fatty` demo running the `markdown` command and paging the output. It shows
|
|
|
224
228
|

|
|
225
229
|
|
|
226
230
|
|
|
227
|
-
<a id="
|
|
231
|
+
<a id="orgfb3da2e"></a>
|
|
228
232
|
|
|
229
233
|
#### Popup Selection
|
|
230
234
|
|
|
@@ -233,17 +237,17 @@ One of the many "widgets" available through `fatty` is the ability to present th
|
|
|
233
237
|

|
|
234
238
|
|
|
235
239
|
|
|
236
|
-
<a id="
|
|
240
|
+
<a id="orgf00946d"></a>
|
|
237
241
|
|
|
238
242
|
# Usage
|
|
239
243
|
|
|
240
244
|
|
|
241
|
-
<a id="
|
|
245
|
+
<a id="orgc5ba25f"></a>
|
|
242
246
|
|
|
243
247
|
## Launching a Fatty Terminal
|
|
244
248
|
|
|
245
249
|
|
|
246
|
-
<a id="
|
|
250
|
+
<a id="orgb046bd4"></a>
|
|
247
251
|
|
|
248
252
|
### `on_accept`
|
|
249
253
|
|
|
@@ -276,14 +280,14 @@ When a `fatty` application runs, `fatty` installs a few files if they do not exi
|
|
|
276
280
|
- `themes`, a directory of pre-defined theme definitions that you can choose from and add to by adding your own themes.
|
|
277
281
|
|
|
278
282
|
|
|
279
|
-
<a id="
|
|
283
|
+
<a id="orgd3107f2"></a>
|
|
280
284
|
|
|
281
285
|
#### Parameters to `on_accept`
|
|
282
286
|
|
|
283
287
|
The `on_accept` proc passed to an instance of `Fatty::Terminal` can take one or two parameters: (1) `line`, the edited line as it exists when the user types `RETURN` and (2) an optional callback parameter that you can use to access the facilities of `fatty`.
|
|
284
288
|
|
|
285
289
|
|
|
286
|
-
<a id="
|
|
290
|
+
<a id="orga7ac101"></a>
|
|
287
291
|
|
|
288
292
|
#### The `line` parameter to `on_accept`
|
|
289
293
|
|
|
@@ -324,7 +328,7 @@ Fatty::Terminal.new(
|
|
|
324
328
|
```
|
|
325
329
|
|
|
326
330
|
|
|
327
|
-
<a id="
|
|
331
|
+
<a id="org7590a60"></a>
|
|
328
332
|
|
|
329
333
|
#### The callback parameter to `on_accept`
|
|
330
334
|
|
|
@@ -349,7 +353,7 @@ Fatty::Terminal.new(
|
|
|
349
353
|
The callback parameter responds to several methods that allow your application to interact with the user. They are documented below.
|
|
350
354
|
|
|
351
355
|
|
|
352
|
-
<a id="
|
|
356
|
+
<a id="org640dc41"></a>
|
|
353
357
|
|
|
354
358
|
#### Output ordering
|
|
355
359
|
|
|
@@ -374,7 +378,7 @@ Calls to `append_now` are different. They append text and immediately render a f
|
|
|
374
378
|
At the end of the callback, `Fatty` finishes the command and updates the pager state. Output produced with `append_now` may therefore appear during the callback, while output from `append`, `markdown`, and the callback's return value appears after the callback returns.
|
|
375
379
|
|
|
376
380
|
|
|
377
|
-
<a id="
|
|
381
|
+
<a id="org34665cc"></a>
|
|
378
382
|
|
|
379
383
|
#### Long-running callbacks and interruption
|
|
380
384
|
|
|
@@ -413,14 +417,14 @@ end
|
|
|
413
417
|
```
|
|
414
418
|
|
|
415
419
|
|
|
416
|
-
<a id="
|
|
420
|
+
<a id="org103299f"></a>
|
|
417
421
|
|
|
418
422
|
#### ANSI colors in output
|
|
419
423
|
|
|
420
424
|
Text passed to `append`, `append_now`, `status`, and `alert` may contain ANSI SGR color/style sequences. Fatty interprets those sequences relative to the current theme role, so an ANSI reset returns to the active Fatty role rather than to the terminal's physical default colors. `fatty` includes the nice [`Rainbow` gem](https://github.com/ku1ik/rainbow) for colorizing text as a convenience.
|
|
421
425
|
|
|
422
426
|
|
|
423
|
-
<a id="
|
|
427
|
+
<a id="org456c2ad"></a>
|
|
424
428
|
|
|
425
429
|
### Other parameters to `Terminal.new`
|
|
426
430
|
|
|
@@ -447,14 +451,14 @@ Fatty::Terminal.new(
|
|
|
447
451
|
With that setup, commands entered in `~/src/byr` are favored when the terminal is again in `~/src/byr`, while commands entered elsewhere remain available as fallback history.
|
|
448
452
|
|
|
449
453
|
|
|
450
|
-
<a id="
|
|
454
|
+
<a id="org5f103bb"></a>
|
|
451
455
|
|
|
452
456
|
## The Callback API
|
|
453
457
|
|
|
454
458
|
Here are the details on the messages that you can send to the callback parameter to the `on_accept` proc.
|
|
455
459
|
|
|
456
460
|
|
|
457
|
-
<a id="
|
|
461
|
+
<a id="orgf90a804"></a>
|
|
458
462
|
|
|
459
463
|
### `append(text, follow: true, role: nil)`
|
|
460
464
|
|
|
@@ -463,7 +467,7 @@ Add the given text to the output pane. After a full page of output is produced,
|
|
|
463
467
|
You can specify a "role" of `:good`, `:info`, `:warn`, or `:error` to color the output according to the current theme's coloring scheme for those roles. Those role names can be symbols or strings.
|
|
464
468
|
|
|
465
469
|
|
|
466
|
-
<a id="
|
|
470
|
+
<a id="org96421ae"></a>
|
|
467
471
|
|
|
468
472
|
### `append_now(text, follow: true, mode: nil, role: nil)`
|
|
469
473
|
|
|
@@ -474,7 +478,7 @@ Setting the mode to `:scrolling` or `:paging` determines whether the output is s
|
|
|
474
478
|
You can specify a "role" of `:good`, `:info`, `:warn`, or `:error` to color the output according to the current theme's coloring scheme for those roles. Those role names can be symbols or strings.
|
|
475
479
|
|
|
476
480
|
|
|
477
|
-
<a id="
|
|
481
|
+
<a id="orge61ad54"></a>
|
|
478
482
|
|
|
479
483
|
### `markdown(text)`
|
|
480
484
|
|
|
@@ -494,7 +498,7 @@ and this should appear on the next line.
|
|
|
494
498
|
```
|
|
495
499
|
|
|
496
500
|
|
|
497
|
-
<a id="
|
|
501
|
+
<a id="org8d20d95"></a>
|
|
498
502
|
|
|
499
503
|
### `status(text, role: :info)`
|
|
500
504
|
|
|
@@ -506,49 +510,49 @@ Display the text in the "status" area, the lines immediately above the input fie
|
|
|
506
510
|
- **:error:** colored something to suggest danger, usually some tone of red.
|
|
507
511
|
|
|
508
512
|
|
|
509
|
-
<a id="
|
|
513
|
+
<a id="org4430a3b"></a>
|
|
510
514
|
|
|
511
515
|
### `good(text, replace: false, render: true)`
|
|
512
516
|
|
|
513
517
|
Display the text in the status area with the role :good.
|
|
514
518
|
|
|
515
519
|
|
|
516
|
-
<a id="
|
|
520
|
+
<a id="org60083e9"></a>
|
|
517
521
|
|
|
518
522
|
### `info(text, replace: false, render: true)`
|
|
519
523
|
|
|
520
524
|
Display the text in the status area with the role :info.
|
|
521
525
|
|
|
522
526
|
|
|
523
|
-
<a id="
|
|
527
|
+
<a id="org98a2b3c"></a>
|
|
524
528
|
|
|
525
529
|
### `warn(text, replace: false, render: true)`
|
|
526
530
|
|
|
527
531
|
Display the text in the status area with the role :warn.
|
|
528
532
|
|
|
529
533
|
|
|
530
|
-
<a id="
|
|
534
|
+
<a id="orgd4f04ac"></a>
|
|
531
535
|
|
|
532
536
|
### `error(text, replace: false, render: true)`
|
|
533
537
|
|
|
534
538
|
Display the text in the status area with the role :error.
|
|
535
539
|
|
|
536
540
|
|
|
537
|
-
<a id="
|
|
541
|
+
<a id="org807c2ce"></a>
|
|
538
542
|
|
|
539
543
|
### `oops(text, replace: false, render: true)`
|
|
540
544
|
|
|
541
545
|
An alias for `error(text)`
|
|
542
546
|
|
|
543
547
|
|
|
544
|
-
<a id="
|
|
548
|
+
<a id="org96063bb"></a>
|
|
545
549
|
|
|
546
550
|
### `alert(text, role: :info)`
|
|
547
551
|
|
|
548
552
|
Display the text in the one-line alert panel just below the input field. In the alert panel, the role only controls the foreground color, not the background.
|
|
549
553
|
|
|
550
554
|
|
|
551
|
-
<a id="
|
|
555
|
+
<a id="org7bb5b38"></a>
|
|
552
556
|
|
|
553
557
|
### `prompt(prompt, initial: "", cancel_value: nil, history_key: nil, save_history: true)`
|
|
554
558
|
|
|
@@ -578,7 +582,7 @@ The `prompt` input has its own history facility separate from the history in the
|
|
|
578
582
|
`prompt` returns whatever the user typed and returns `nil` if the user cancels with C-c or C-g unless you specify an alternative `cancel_value`.
|
|
579
583
|
|
|
580
584
|
|
|
581
|
-
<a id="
|
|
585
|
+
<a id="orga338e63"></a>
|
|
582
586
|
|
|
583
587
|
### `check_interrupt!`
|
|
584
588
|
|
|
@@ -589,7 +593,7 @@ The polling is throttled, so `check_interrupt!` may be called frequently. It sho
|
|
|
589
593
|
Fatty catches `Fatty::Interrupt` at the callback boundary, finishes the current command, restores the terminal state, and resumes the normal input loop.
|
|
590
594
|
|
|
591
595
|
|
|
592
|
-
<a id="
|
|
596
|
+
<a id="orgcb79368"></a>
|
|
593
597
|
|
|
594
598
|
### `add_progress(label:, total: nil, style: :percent, role: :info, width: 40)`
|
|
595
599
|
|
|
@@ -605,7 +609,7 @@ Display a progress widget in the status area to show the user that the system is
|
|
|
605
609
|
- **:trail:** display an "indicator" on each call of `update(indicator: <string>)`
|
|
606
610
|
|
|
607
611
|
|
|
608
|
-
<a id="
|
|
612
|
+
<a id="org789160a"></a>
|
|
609
613
|
|
|
610
614
|
#### Initialization `add_progress(label:, style: :percent, total: nil, role: :info, width: 40)`
|
|
611
615
|
|
|
@@ -616,7 +620,7 @@ Display a progress widget in the status area to show the user that the system is
|
|
|
616
620
|
- **`width`:** The number of characters for the full widget display: it is only relevant for the bar styles and the trail style; otherwise it is ignored.
|
|
617
621
|
|
|
618
622
|
|
|
619
|
-
<a id="
|
|
623
|
+
<a id="orge7cfc41"></a>
|
|
620
624
|
|
|
621
625
|
#### Update `update(current: nil, indicator: nil, render: false)`
|
|
622
626
|
|
|
@@ -722,21 +726,21 @@ Fatty::Terminal.new(
|
|
|
722
726
|
```
|
|
723
727
|
|
|
724
728
|
|
|
725
|
-
<a id="
|
|
729
|
+
<a id="orgf7533d1"></a>
|
|
726
730
|
|
|
727
731
|
#### Finish
|
|
728
732
|
|
|
729
733
|
As the prior examples illustrate, you can issue an ending message at the end of the process by calling `#finish` on the Progress object.
|
|
730
734
|
|
|
731
735
|
|
|
732
|
-
<a id="
|
|
736
|
+
<a id="orgede5f40"></a>
|
|
733
737
|
|
|
734
738
|
#### Clear
|
|
735
739
|
|
|
736
740
|
And, if you have occasion, you can clear the Progress by calling `#clear` on the Progress object.
|
|
737
741
|
|
|
738
742
|
|
|
739
|
-
<a id="
|
|
743
|
+
<a id="org5994004"></a>
|
|
740
744
|
|
|
741
745
|
### `choose(prompt, choices:, initial_choice_idx: 0, cancel_value: nil)`
|
|
742
746
|
|
|
@@ -802,7 +806,7 @@ Fatty::Terminal.new(
|
|
|
802
806
|
```
|
|
803
807
|
|
|
804
808
|
|
|
805
|
-
<a id="
|
|
809
|
+
<a id="orgd82f0ec"></a>
|
|
806
810
|
|
|
807
811
|
### `choose_multi(prompt, choices:, cancel_value: nil)`
|
|
808
812
|
|
|
@@ -820,7 +824,7 @@ Present a set of `choices:`, which can either be
|
|
|
820
824
|
The `prompt` String (by default "Choose Many") can guide the user about the purpose of the choices.
|
|
821
825
|
|
|
822
826
|
|
|
823
|
-
<a id="
|
|
827
|
+
<a id="orga06503c"></a>
|
|
824
828
|
|
|
825
829
|
### `confirm(prompt, yes_label: "Yes", no_label: "No", cancel_value: false)`
|
|
826
830
|
|
|
@@ -831,7 +835,7 @@ Present the user with a simple Yes/No choice using your choice of ways to expres
|
|
|
831
835
|
`confirm` will return `false` on cancellation with C-c or C-g unless you provide an alternative `cancel_value:`, in which case it returns that.
|
|
832
836
|
|
|
833
837
|
|
|
834
|
-
<a id="
|
|
838
|
+
<a id="org6463694"></a>
|
|
835
839
|
|
|
836
840
|
### `menu(prompt, choices:, initial_choice_idx: 0, cancel_value: nil)`
|
|
837
841
|
|
|
@@ -878,7 +882,24 @@ If you want to set one of the choices as the initial choice, set `initial_choice
|
|
|
878
882
|
If you want a value associated with the user's cancellation of the chooser with C-c or C-g, set `cancel_value:` to that value.
|
|
879
883
|
|
|
880
884
|
|
|
881
|
-
<a id="
|
|
885
|
+
<a id="org5fe1480"></a>
|
|
886
|
+
|
|
887
|
+
### `suspend(&block)`
|
|
888
|
+
|
|
889
|
+
The `suspend` method temporarily gives control of the terminal to the application while the supplied block runs. When the block finishes, Fatty restores its terminal state and redraws the interface.
|
|
890
|
+
|
|
891
|
+
This is useful for running interactive terminal programs such as editors, debuggers, shells, or other programs that need direct access to the terminal.
|
|
892
|
+
|
|
893
|
+
```ruby
|
|
894
|
+
env.suspend do
|
|
895
|
+
system(ENV.fetch("EDITOR", "vi"), filename)
|
|
896
|
+
end
|
|
897
|
+
```
|
|
898
|
+
|
|
899
|
+
The value of the block is returned by `suspend`. Terminal state is restored even if the block exits by raising an exception.
|
|
900
|
+
|
|
901
|
+
|
|
902
|
+
<a id="orgd5bf8ee"></a>
|
|
882
903
|
|
|
883
904
|
### `environment`
|
|
884
905
|
|
|
@@ -915,59 +936,71 @@ The environment report also includes a nested `:curses` hash:
|
|
|
915
936
|
| `:can_change_color` | Whether curses can redefine color values |
|
|
916
937
|
|
|
917
938
|
|
|
918
|
-
<a id="
|
|
939
|
+
<a id="org1c1d3fc"></a>
|
|
940
|
+
|
|
941
|
+
## Terminal Methods
|
|
942
|
+
|
|
943
|
+
|
|
944
|
+
<a id="org5e187ea"></a>
|
|
945
|
+
|
|
946
|
+
### `Teminal#suspend(&block)`
|
|
947
|
+
|
|
948
|
+
Return control to the launching terminal, execute the given block, and return.
|
|
949
|
+
|
|
950
|
+
|
|
951
|
+
<a id="org47f52fd"></a>
|
|
919
952
|
|
|
920
953
|
# Default Interaction
|
|
921
954
|
|
|
922
955
|
|
|
923
|
-
<a id="
|
|
956
|
+
<a id="orga27a6ad"></a>
|
|
924
957
|
|
|
925
958
|
## Parts of the Screen
|
|
926
959
|
|
|
927
960
|
|
|
928
|
-
<a id="
|
|
961
|
+
<a id="orgbd88b45"></a>
|
|
929
962
|
|
|
930
963
|
### Input Field
|
|
931
964
|
|
|
932
965
|
Just above the bottom of the screen where all the action takes place: it is a line for editing the input. It displays a prompt followed by an area in which you build the command line using `fatty's` editing facilities.
|
|
933
966
|
|
|
934
967
|
|
|
935
|
-
<a id="
|
|
968
|
+
<a id="orge98ad82"></a>
|
|
936
969
|
|
|
937
970
|
### Output Pane
|
|
938
971
|
|
|
939
972
|
Most of the top part of the screen is reserved for displaying whatever output is sent to it with the `on_accept` callback to the `Terminal`. It can render colored ANSI-encoded strings and will page long output so you can view it a page at a time and even search the output.
|
|
940
973
|
|
|
941
974
|
|
|
942
|
-
<a id="
|
|
975
|
+
<a id="org9831bf4"></a>
|
|
943
976
|
|
|
944
977
|
### Status Area
|
|
945
978
|
|
|
946
979
|
The one to four lines just above the Input Field that displays output to the user that is out of band for the Output Pane. Brief messages of confirmation, warning, or error can be displayed there so as to get the user's immediate attention. Progress bars also render there where their visibility is made prominent.
|
|
947
980
|
|
|
948
981
|
|
|
949
|
-
<a id="
|
|
982
|
+
<a id="org5d9a3d5"></a>
|
|
950
983
|
|
|
951
984
|
### Alert Area
|
|
952
985
|
|
|
953
986
|
Alerts are short-lived, non-scrolling messages shown below the input field. They are intended for user-visible conditions that require attention. `Fatty` uses this area to warn the user of unrecognized key codes and of unbound key presses.
|
|
954
987
|
|
|
955
988
|
|
|
956
|
-
<a id="
|
|
989
|
+
<a id="orge76ca34"></a>
|
|
957
990
|
|
|
958
991
|
## Command-line Editing
|
|
959
992
|
|
|
960
993
|
`fatty` aims to have a full-featured command-line editor for editing a single line of text that is sent to the `on_accept` proc for the `Terminal`. The default keybindings are based on Emacs keybindings, but they are fully customizable. Implementing `vim`-like keybindings is not currently possible because `fatty` has no notion of editing "modes" as would be required for any kind of a modal editor—at least not yet. Maybe some day.
|
|
961
994
|
|
|
962
995
|
|
|
963
|
-
<a id="
|
|
996
|
+
<a id="org2aaff21"></a>
|
|
964
997
|
|
|
965
998
|
### Input Context
|
|
966
999
|
|
|
967
1000
|
When editing the input line or text input for widgets like the \`prompt\`, \`fatty\` provides emacs-like editing keybindings by default. Many of these commands can take a count prefix argument to repeat the command count times. For example, \`M-8 M-0 #\` will insert 80 '#' characters at the cursor.
|
|
968
1001
|
|
|
969
1002
|
|
|
970
|
-
<a id="
|
|
1003
|
+
<a id="org14d68c9"></a>
|
|
971
1004
|
|
|
972
1005
|
#### Cursor Motion
|
|
973
1006
|
|
|
@@ -991,7 +1024,7 @@ When editing the input line or text input for widgets like the \`prompt\`, \`fat
|
|
|
991
1024
|
| C-:left | move cursor left one word |
|
|
992
1025
|
|
|
993
1026
|
|
|
994
|
-
<a id="
|
|
1027
|
+
<a id="orgd13c620"></a>
|
|
995
1028
|
|
|
996
1029
|
#### Clearing
|
|
997
1030
|
|
|
@@ -1002,7 +1035,7 @@ This is one action that does not affect the input buffer but the output pane. It
|
|
|
1002
1035
|
| C-l | clear the output pane |
|
|
1003
1036
|
|
|
1004
1037
|
|
|
1005
|
-
<a id="
|
|
1038
|
+
<a id="org54d5f7a"></a>
|
|
1006
1039
|
|
|
1007
1040
|
#### Undo and Redo
|
|
1008
1041
|
|
|
@@ -1016,7 +1049,7 @@ This is one action that does not affect the input buffer but the output pane. It
|
|
|
1016
1049
|
| M-/ | redo |
|
|
1017
1050
|
|
|
1018
1051
|
|
|
1019
|
-
<a id="
|
|
1052
|
+
<a id="orgcf696da"></a>
|
|
1020
1053
|
|
|
1021
1054
|
#### Deletion and Killing
|
|
1022
1055
|
|
|
@@ -1036,7 +1069,7 @@ When the region is active, destructive editing commands kill the region rather t
|
|
|
1036
1069
|
| M-t | transpose words |
|
|
1037
1070
|
|
|
1038
1071
|
|
|
1039
|
-
<a id="
|
|
1072
|
+
<a id="orga7f73fe"></a>
|
|
1040
1073
|
|
|
1041
1074
|
#### Yanking, Mark, and Region
|
|
1042
1075
|
|
|
@@ -1064,7 +1097,7 @@ Notice that commands that normally delete characters or words, kill the region i
|
|
|
1064
1097
|
| M-w | copy the region |
|
|
1065
1098
|
|
|
1066
1099
|
|
|
1067
|
-
<a id="
|
|
1100
|
+
<a id="org29d1c16"></a>
|
|
1068
1101
|
|
|
1069
1102
|
#### Count Prefix
|
|
1070
1103
|
|
|
@@ -1080,7 +1113,7 @@ Fatty follows the emacs convention of making `C-u` multiply the count prefix by
|
|
|
1080
1113
|
| M-<digit> | accumulate a count argument |
|
|
1081
1114
|
|
|
1082
1115
|
|
|
1083
|
-
<a id="
|
|
1116
|
+
<a id="org511da2c"></a>
|
|
1084
1117
|
|
|
1085
1118
|
#### History Navigation
|
|
1086
1119
|
|
|
@@ -1103,7 +1136,7 @@ You can navigate history items with the `up` and `down` keys as you would expect
|
|
|
1103
1136
|
| C-r | search the history in a popup |
|
|
1104
1137
|
|
|
1105
1138
|
|
|
1106
|
-
<a id="
|
|
1139
|
+
<a id="org1648a2a"></a>
|
|
1107
1140
|
|
|
1108
1141
|
#### Completion
|
|
1109
1142
|
|
|
@@ -1149,7 +1182,7 @@ You can navigate history items with the `up` and `down` keys as you would expect
|
|
|
1149
1182
|
Just as with command line completion, you can invoke a popup of completions with `M-TAB` and a popup of possible file names will appear within which you may filter the candidates down by narrowing. Unlike other forms of completion, the file name completion popup allows you to fill out the path by navigating directories within the popup by hitting `TAB` or `right` to descend into a sub-directory or `S-TAB` or `left` to ascend to the parent directory. The popup title shows the path so far.
|
|
1150
1183
|
|
|
1151
1184
|
|
|
1152
|
-
<a id="
|
|
1185
|
+
<a id="org9afdcdd"></a>
|
|
1153
1186
|
|
|
1154
1187
|
#### Accept or Cancel
|
|
1155
1188
|
|
|
@@ -1165,7 +1198,7 @@ You can end a `fatty` session with `C-c` at the command line, or (only if the bu
|
|
|
1165
1198
|
| C-d | quit \`fatty\` only if the input line is empty |
|
|
1166
1199
|
|
|
1167
1200
|
|
|
1168
|
-
<a id="
|
|
1201
|
+
<a id="org8c38312"></a>
|
|
1169
1202
|
|
|
1170
1203
|
### Paging Context
|
|
1171
1204
|
|
|
@@ -1222,7 +1255,7 @@ You can add line numbers to the display while paging by using the `=` key.
|
|
|
1222
1255
|
You can also "narrow" the output with `<`, which will prompt you for one or more terms to match. The output will then show only lines that match all the terms typed. To return to the full output, "widen" with `>`.
|
|
1223
1256
|
|
|
1224
1257
|
|
|
1225
|
-
<a id="
|
|
1258
|
+
<a id="org567c0c0"></a>
|
|
1226
1259
|
|
|
1227
1260
|
### Searching Output
|
|
1228
1261
|
|
|
@@ -1231,21 +1264,21 @@ While paging, you can initiate a search of the output as indicated in the above
|
|
|
1231
1264
|
After a search session has ended, `fatty` returns to paging but remembers the last search term and allows navigation among them with `n` and `N`: `n` searches in the direction of the last search and `N` searches in the opposite direction. Notice that the current search term and direction are added to the paging bar after the information on your location within the output.
|
|
1232
1265
|
|
|
1233
1266
|
|
|
1234
|
-
<a id="
|
|
1267
|
+
<a id="orgbf77d1b"></a>
|
|
1235
1268
|
|
|
1236
1269
|
#### String and Regex Search
|
|
1237
1270
|
|
|
1238
1271
|
`/` and `?` prompt for a fixed string and search forward or backward. `C-M-s` (or `C-/`) and `C-M-r` (or `C-?`) perform the corresponding regular-expression searches. Accepting the search leaves the selected match active for later navigation with `n` and `N`.
|
|
1239
1272
|
|
|
1240
1273
|
|
|
1241
|
-
<a id="
|
|
1274
|
+
<a id="orgda99c8d"></a>
|
|
1242
1275
|
|
|
1243
1276
|
#### Incremental Search
|
|
1244
1277
|
|
|
1245
1278
|
`C-s` and `C-r` begin forward or backward incremental search. The output moves to matching text as the search term is edited. Accepting commits the match; canceling restores the output position from before the search began.
|
|
1246
1279
|
|
|
1247
1280
|
|
|
1248
|
-
<a id="
|
|
1281
|
+
<a id="orgfd272b4"></a>
|
|
1249
1282
|
|
|
1250
1283
|
# Configuration
|
|
1251
1284
|
|
|
@@ -1263,7 +1296,7 @@ The default user-specific configuration directory follows `XDG_CONFIG_HOME` if i
|
|
|
1263
1296
|
In addition to the user-specific configuration, fatty will read app-specific configuration files from `~/.config/fatty/apps/<app_name>` if `Terminal` was given an `app_name` parameter. It will use a different directory of your choosing if `Terminal` was given an `app_config_dir` directory name.
|
|
1264
1297
|
|
|
1265
1298
|
|
|
1266
|
-
<a id="
|
|
1299
|
+
<a id="org8e3d563"></a>
|
|
1267
1300
|
|
|
1268
1301
|
## General Configuration `config.yml`
|
|
1269
1302
|
|
|
@@ -1286,7 +1319,7 @@ truecolor: auto
|
|
|
1286
1319
|
```
|
|
1287
1320
|
|
|
1288
1321
|
|
|
1289
|
-
<a id="
|
|
1322
|
+
<a id="org773e7d4"></a>
|
|
1290
1323
|
|
|
1291
1324
|
### `word_char_re`
|
|
1292
1325
|
|
|
@@ -1309,7 +1342,7 @@ word_char_re: "[[:alnum:]_.:-]"
|
|
|
1309
1342
|
```
|
|
1310
1343
|
|
|
1311
1344
|
|
|
1312
|
-
<a id="
|
|
1345
|
+
<a id="org8229289"></a>
|
|
1313
1346
|
|
|
1314
1347
|
### `esc_delay`
|
|
1315
1348
|
|
|
@@ -1320,26 +1353,26 @@ esc_delay: 0
|
|
|
1320
1353
|
```
|
|
1321
1354
|
|
|
1322
1355
|
|
|
1323
|
-
<a id="
|
|
1356
|
+
<a id="org5789fd5"></a>
|
|
1324
1357
|
|
|
1325
1358
|
### `history`
|
|
1326
1359
|
|
|
1327
1360
|
|
|
1328
|
-
<a id="
|
|
1361
|
+
<a id="org1959b2c"></a>
|
|
1329
1362
|
|
|
1330
1363
|
#### `file`
|
|
1331
1364
|
|
|
1332
1365
|
The path to the history file to use, by default `~/.fatty_history`
|
|
1333
1366
|
|
|
1334
1367
|
|
|
1335
|
-
<a id="
|
|
1368
|
+
<a id="orgbb18fb6"></a>
|
|
1336
1369
|
|
|
1337
1370
|
#### `max`
|
|
1338
1371
|
|
|
1339
1372
|
The maximum number of lines of history retained, by default 10,000.
|
|
1340
1373
|
|
|
1341
1374
|
|
|
1342
|
-
<a id="
|
|
1375
|
+
<a id="org8a3ecd9"></a>
|
|
1343
1376
|
|
|
1344
1377
|
### `theme`
|
|
1345
1378
|
|
|
@@ -1350,7 +1383,7 @@ theme: nordic
|
|
|
1350
1383
|
```
|
|
1351
1384
|
|
|
1352
1385
|
|
|
1353
|
-
<a id="
|
|
1386
|
+
<a id="org9ba735f"></a>
|
|
1354
1387
|
|
|
1355
1388
|
### `truecolor`
|
|
1356
1389
|
|
|
@@ -1361,7 +1394,7 @@ truecolor: auto
|
|
|
1361
1394
|
```
|
|
1362
1395
|
|
|
1363
1396
|
|
|
1364
|
-
<a id="
|
|
1397
|
+
<a id="org13b974b"></a>
|
|
1365
1398
|
|
|
1366
1399
|
### `log`
|
|
1367
1400
|
|
|
@@ -1383,14 +1416,14 @@ tags:
|
|
|
1383
1416
|
```
|
|
1384
1417
|
|
|
1385
1418
|
|
|
1386
|
-
<a id="
|
|
1419
|
+
<a id="orgb93c9b8"></a>
|
|
1387
1420
|
|
|
1388
1421
|
#### `file`
|
|
1389
1422
|
|
|
1390
1423
|
The path to the log file to use.
|
|
1391
1424
|
|
|
1392
1425
|
|
|
1393
|
-
<a id="
|
|
1426
|
+
<a id="org0fb9a08"></a>
|
|
1394
1427
|
|
|
1395
1428
|
#### `level`
|
|
1396
1429
|
|
|
@@ -1402,7 +1435,7 @@ Can be one of the following
|
|
|
1402
1435
|
- **`debug`:** detailed messages to assist debugging `fatty` plus all of the above.
|
|
1403
1436
|
|
|
1404
1437
|
|
|
1405
|
-
<a id="
|
|
1438
|
+
<a id="org2247ba8"></a>
|
|
1406
1439
|
|
|
1407
1440
|
#### `tags`
|
|
1408
1441
|
|
|
@@ -1420,7 +1453,7 @@ tags:
|
|
|
1420
1453
|
```
|
|
1421
1454
|
|
|
1422
1455
|
|
|
1423
|
-
<a id="
|
|
1456
|
+
<a id="org11c2491"></a>
|
|
1424
1457
|
|
|
1425
1458
|
## Key code definitions `keydefs.yml`
|
|
1426
1459
|
|
|
@@ -1558,7 +1591,7 @@ konsole:
|
|
|
1558
1591
|
After installing that keydefs, I find that the PageDown variants are all recognized by name and modifiers (except for the strange failure of `terminator` to recognize `C-PageDown`!).
|
|
1559
1592
|
|
|
1560
1593
|
|
|
1561
|
-
<a id="
|
|
1594
|
+
<a id="orgab7252d"></a>
|
|
1562
1595
|
|
|
1563
1596
|
## Key bindings `keybindings.yml`
|
|
1564
1597
|
|
|
@@ -1585,7 +1618,7 @@ A keybinding names a key chord, the context in which it applies, and the Fatty a
|
|
|
1585
1618
|
```
|
|
1586
1619
|
|
|
1587
1620
|
|
|
1588
|
-
<a id="
|
|
1621
|
+
<a id="org370c8e8"></a>
|
|
1589
1622
|
|
|
1590
1623
|
### Key Names
|
|
1591
1624
|
|
|
@@ -1599,7 +1632,7 @@ A keybinding uses the unmodified key name under the `key` field:
|
|
|
1599
1632
|
```
|
|
1600
1633
|
|
|
1601
1634
|
|
|
1602
|
-
<a id="
|
|
1635
|
+
<a id="org3a580c2"></a>
|
|
1603
1636
|
|
|
1604
1637
|
#### Printable Keys
|
|
1605
1638
|
|
|
@@ -1615,7 +1648,7 @@ Most printable keys can be written as the character itself. Quote keys that YAML
|
|
|
1615
1648
|
```
|
|
1616
1649
|
|
|
1617
1650
|
|
|
1618
|
-
<a id="
|
|
1651
|
+
<a id="org1e9bcad"></a>
|
|
1619
1652
|
|
|
1620
1653
|
#### Curses and Fatty Named Keys
|
|
1621
1654
|
|
|
@@ -1640,7 +1673,7 @@ Some terminals can report application-keypad sequences such as `keypad_divide`,
|
|
|
1640
1673
|
- `space`
|
|
1641
1674
|
|
|
1642
1675
|
|
|
1643
|
-
<a id="
|
|
1676
|
+
<a id="orgec1f50a"></a>
|
|
1644
1677
|
|
|
1645
1678
|
#### Possibly Invisible Keys
|
|
1646
1679
|
|
|
@@ -1649,7 +1682,7 @@ Some physical keys may never reach Fatty at all. They may be handled by the keyb
|
|
|
1649
1682
|
Use `keytest` to check. If Fatty sees a key as a raw numeric code, you can name it in `keydefs.yml` and bind it. If `keytest` shows nothing, the key is being intercepted before Fatty receives it.
|
|
1650
1683
|
|
|
1651
1684
|
|
|
1652
|
-
<a id="
|
|
1685
|
+
<a id="org56d8cd7"></a>
|
|
1653
1686
|
|
|
1654
1687
|
#### Unnamed but Recognized Keys
|
|
1655
1688
|
|
|
@@ -1674,7 +1707,7 @@ Then bind it in `keybindings.yml`:
|
|
|
1674
1707
|
Fatty does not require custom key names to come from a fixed registry. A custom name only needs to be used consistently between `keydefs.yml` and `keybindings.yml`.
|
|
1675
1708
|
|
|
1676
1709
|
|
|
1677
|
-
<a id="
|
|
1710
|
+
<a id="org0eda788"></a>
|
|
1678
1711
|
|
|
1679
1712
|
### Mouse Events
|
|
1680
1713
|
|
|
@@ -1709,7 +1742,7 @@ scroll_down
|
|
|
1709
1742
|
```
|
|
1710
1743
|
|
|
1711
1744
|
|
|
1712
|
-
<a id="
|
|
1745
|
+
<a id="orgbffc2cf"></a>
|
|
1713
1746
|
|
|
1714
1747
|
### Modifiers
|
|
1715
1748
|
|
|
@@ -1722,7 +1755,7 @@ shift: true
|
|
|
1722
1755
|
```
|
|
1723
1756
|
|
|
1724
1757
|
|
|
1725
|
-
<a id="
|
|
1758
|
+
<a id="org0662dd0"></a>
|
|
1726
1759
|
|
|
1727
1760
|
### Contexts
|
|
1728
1761
|
|
|
@@ -1756,7 +1789,7 @@ The available contexts are:
|
|
|
1756
1789
|
The \`:terminal\` context is the lowest-priority fallback context for terminal-wide commands. It is where Fatty puts bindings that are not specific to text editing, paging, search, or popup selection, such as theme selection, key testing, and quitting. Because \`:terminal\` is searched last, any more specific context can override a terminal-wide binding.
|
|
1757
1790
|
|
|
1758
1791
|
|
|
1759
|
-
<a id="
|
|
1792
|
+
<a id="org55e8a55"></a>
|
|
1760
1793
|
|
|
1761
1794
|
### Actions
|
|
1762
1795
|
|
|
@@ -1784,7 +1817,7 @@ Most movement, deletion, history, completion, paging, and popup-navigation actio
|
|
|
1784
1817
|
Use \`keytest\` to check what action is currently bound to a key. If a key is bound, \`keytest\` reports the matching context, action name, arguments, and the object that handles the action.
|
|
1785
1818
|
|
|
1786
1819
|
|
|
1787
|
-
<a id="
|
|
1820
|
+
<a id="org5c651ab"></a>
|
|
1788
1821
|
|
|
1789
1822
|
#### Input buffer actions
|
|
1790
1823
|
|
|
@@ -1827,7 +1860,7 @@ Terminology notes:
|
|
|
1827
1860
|
| yank\_pop | Yes | Copy next kill ring item and replace prior |
|
|
1828
1861
|
|
|
1829
1862
|
|
|
1830
|
-
<a id="
|
|
1863
|
+
<a id="orga37809c"></a>
|
|
1831
1864
|
|
|
1832
1865
|
#### Input field actions
|
|
1833
1866
|
|
|
@@ -1840,7 +1873,7 @@ Input field actions operate on an editable input field. An input field occurs at
|
|
|
1840
1873
|
| history\_next | No | Insert the next relevant history item in the input field |
|
|
1841
1874
|
|
|
1842
1875
|
|
|
1843
|
-
<a id="
|
|
1876
|
+
<a id="org5bd909b"></a>
|
|
1844
1877
|
|
|
1845
1878
|
#### Shell session actions
|
|
1846
1879
|
|
|
@@ -1861,7 +1894,7 @@ Shell session actions operate at the session level around the main command input
|
|
|
1861
1894
|
| universal\_argument | No | Set the numeric argument to 4 or multiply the current one by 4 |
|
|
1862
1895
|
|
|
1863
1896
|
|
|
1864
|
-
<a id="
|
|
1897
|
+
<a id="orgcba2897"></a>
|
|
1865
1898
|
|
|
1866
1899
|
#### Pager actions
|
|
1867
1900
|
|
|
@@ -1883,7 +1916,7 @@ Pager actions navigate output when the output area is in paging mode. They move
|
|
|
1883
1916
|
| quit\_paging | No | Quit paging and return control to the input line |
|
|
1884
1917
|
|
|
1885
1918
|
|
|
1886
|
-
<a id="
|
|
1919
|
+
<a id="org2e0b296"></a>
|
|
1887
1920
|
|
|
1888
1921
|
#### Pager search actions
|
|
1889
1922
|
|
|
@@ -1912,7 +1945,7 @@ While the search session is active, accepting commits the current match and canc
|
|
|
1912
1945
|
| isearch\_cancel | No | Cancel the active incremental search and restore its starting point |
|
|
1913
1946
|
|
|
1914
1947
|
|
|
1915
|
-
<a id="
|
|
1948
|
+
<a id="org76791bc"></a>
|
|
1916
1949
|
|
|
1917
1950
|
#### Popup actions
|
|
1918
1951
|
|
|
@@ -1932,7 +1965,7 @@ Popup actions control selection and narrowing popups such as choose, menu, compl
|
|
|
1932
1965
|
| popup\_toggle\_selected | No | In multi-select, toggle the selection of the current item |
|
|
1933
1966
|
|
|
1934
1967
|
|
|
1935
|
-
<a id="
|
|
1968
|
+
<a id="org6b1188d"></a>
|
|
1936
1969
|
|
|
1937
1970
|
#### Prompt popup actions
|
|
1938
1971
|
|
|
@@ -1945,7 +1978,7 @@ Prompt popup actions control prompt dialogs that collect a string from the user.
|
|
|
1945
1978
|
| prompt\_cancel\_if\_empty | No | Cancel only if the input buffer is empty |
|
|
1946
1979
|
|
|
1947
1980
|
|
|
1948
|
-
<a id="
|
|
1981
|
+
<a id="orgf63740e"></a>
|
|
1949
1982
|
|
|
1950
1983
|
#### Utility Actions
|
|
1951
1984
|
|
|
@@ -1960,12 +1993,12 @@ Some actions exist to support `Fatty`'s own input machinery and are not normally
|
|
|
1960
1993
|
| paste | str | No | Insert pasted text at point |
|
|
1961
1994
|
|
|
1962
1995
|
|
|
1963
|
-
<a id="
|
|
1996
|
+
<a id="org3856a84"></a>
|
|
1964
1997
|
|
|
1965
1998
|
## Themes `themes/`
|
|
1966
1999
|
|
|
1967
2000
|
|
|
1968
|
-
<a id="
|
|
2001
|
+
<a id="org88b0217"></a>
|
|
1969
2002
|
|
|
1970
2003
|
### Distributed Themes
|
|
1971
2004
|
|
|
@@ -2001,12 +2034,12 @@ Here are the builtin themes:
|
|
|
2001
2034
|
| wordperfect | Nostalgic nod to the good old word processor |
|
|
2002
2035
|
|
|
2003
2036
|
|
|
2004
|
-
<a id="
|
|
2037
|
+
<a id="org8769885"></a>
|
|
2005
2038
|
|
|
2006
2039
|
### Custom Themes
|
|
2007
2040
|
|
|
2008
2041
|
|
|
2009
|
-
<a id="
|
|
2042
|
+
<a id="orgd425d6c"></a>
|
|
2010
2043
|
|
|
2011
2044
|
#### Theme Name
|
|
2012
2045
|
|
|
@@ -2017,7 +2050,7 @@ name: nordic
|
|
|
2017
2050
|
```
|
|
2018
2051
|
|
|
2019
2052
|
|
|
2020
|
-
<a id="
|
|
2053
|
+
<a id="org1e1695f"></a>
|
|
2021
2054
|
|
|
2022
2055
|
#### Inheritance from Another Theme
|
|
2023
2056
|
|
|
@@ -2034,7 +2067,7 @@ fg: "#eeeeee"
|
|
|
2034
2067
|
This means that all the theme setting from the `nordic` theme apply except to the extent changed by the rest of the `my_nordic` theme file.
|
|
2035
2068
|
|
|
2036
2069
|
|
|
2037
|
-
<a id="
|
|
2070
|
+
<a id="org8557acf"></a>
|
|
2038
2071
|
|
|
2039
2072
|
#### Inheritance within a Theme
|
|
2040
2073
|
|
|
@@ -2054,7 +2087,7 @@ output:
|
|
|
2054
2087
|
This means that the input field will have the same coloring and attributes as the output pane.
|
|
2055
2088
|
|
|
2056
2089
|
|
|
2057
|
-
<a id="
|
|
2090
|
+
<a id="org76e4687"></a>
|
|
2058
2091
|
|
|
2059
2092
|
#### Theme Roles
|
|
2060
2093
|
|
|
@@ -2101,7 +2134,7 @@ Here is a listing of what roles act as the parent for each of the roles, their p
|
|
|
2101
2134
|
| `markdown_hrule` | Markdown horizontal rules. | `output` |
|
|
2102
2135
|
|
|
2103
2136
|
|
|
2104
|
-
<a id="
|
|
2137
|
+
<a id="orge738a22"></a>
|
|
2105
2138
|
|
|
2106
2139
|
#### Role Colors and Attributes and Frame Style
|
|
2107
2140
|
|
|
@@ -2222,3 +2255,75 @@ Each role can have assigned to it a foreground color (`fg:`), a background color
|
|
|
2222
2255
|
bg: navy
|
|
2223
2256
|
attrs: [underline]
|
|
2224
2257
|
```
|
|
2258
|
+
|
|
2259
|
+
|
|
2260
|
+
<a id="orgdd1744c"></a>
|
|
2261
|
+
|
|
2262
|
+
### The `themer` helper
|
|
2263
|
+
|
|
2264
|
+
Choosing readable colors for the semantic roles---`good`, `info`, `warn`, and `error`—is not trivial. The `themer` utility can suggest suitable foreground colors based on a theme's output background.
|
|
2265
|
+
|
|
2266
|
+
For an existing theme, `themer` also reports the contrast of the current role colors and flags those that fall below its target contrast.
|
|
2267
|
+
|
|
2268
|
+
Pass it either the name of an existing theme:
|
|
2269
|
+
|
|
2270
|
+
```sh
|
|
2271
|
+
themer nordic
|
|
2272
|
+
```
|
|
2273
|
+
|
|
2274
|
+
```
|
|
2275
|
+
Theme: nordic
|
|
2276
|
+
Output background: #2e3440
|
|
2277
|
+
|
|
2278
|
+
Current semantic roles:
|
|
2279
|
+
|
|
2280
|
+
good #22ee00 contrast 7.91 OK
|
|
2281
|
+
info #33deff contrast 7.75 OK
|
|
2282
|
+
warn #d78700 contrast 4.37 LOW
|
|
2283
|
+
error #d700af contrast 2.68 LOW
|
|
2284
|
+
|
|
2285
|
+
Suggested semantic roles:
|
|
2286
|
+
|
|
2287
|
+
good #28bd41 contrast 5.02
|
|
2288
|
+
info #74abe2 contrast 5.15
|
|
2289
|
+
warn #caa22b contrast 5.18
|
|
2290
|
+
error #e78d8d contrast 5.11
|
|
2291
|
+
```
|
|
2292
|
+
|
|
2293
|
+
or a hexadecimal background color when developing a new theme:
|
|
2294
|
+
|
|
2295
|
+
```sh
|
|
2296
|
+
themer '#2e3440'
|
|
2297
|
+
```
|
|
2298
|
+
|
|
2299
|
+
```
|
|
2300
|
+
Background: #2e3440
|
|
2301
|
+
Output background: #2e3440
|
|
2302
|
+
|
|
2303
|
+
Suggested semantic roles:
|
|
2304
|
+
|
|
2305
|
+
good #28bd41 contrast 5.02
|
|
2306
|
+
info #74abe2 contrast 5.15
|
|
2307
|
+
warn #caa22b contrast 5.18
|
|
2308
|
+
error #e78d8d contrast 5.11
|
|
2309
|
+
```
|
|
2310
|
+
|
|
2311
|
+
You can get the suggestions in YAML form by giving the `--yaml` flag:
|
|
2312
|
+
|
|
2313
|
+
```sh
|
|
2314
|
+
themer --yaml '#2e3440'
|
|
2315
|
+
```
|
|
2316
|
+
|
|
2317
|
+
```
|
|
2318
|
+
good:
|
|
2319
|
+
fg: "#28bd41"
|
|
2320
|
+
|
|
2321
|
+
info:
|
|
2322
|
+
fg: "#74abe2"
|
|
2323
|
+
|
|
2324
|
+
warn:
|
|
2325
|
+
fg: "#caa22b"
|
|
2326
|
+
|
|
2327
|
+
error:
|
|
2328
|
+
fg: "#e78d8d"
|
|
2329
|
+
```
|