fatty 0.99.10.0 → 0.99.12.0
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/CHANGELOG.org +30 -0
- data/README.md +263 -230
- data/README.org +49 -5
- data/examples/markdown/native-markdown.md +370 -0
- data/examples/markdown/ox-gfm-markdown.md +373 -0
- data/exe/fatty +43 -41
- data/exe/themer +10 -10
- data/help/help.md +1 -0
- data/lib/fatty/alert.rb +1 -1
- data/lib/fatty/ansi/renderer.rb +8 -4
- data/lib/fatty/ansi/windows_console.rb +40 -0
- data/lib/fatty/ansi.rb +0 -5
- data/lib/fatty/api/choose.rb +2 -2
- data/lib/fatty/api/menu.rb +3 -0
- data/lib/fatty/api/output.rb +13 -5
- data/lib/fatty/api/progress.rb +6 -6
- data/lib/fatty/api/prompt.rb +3 -1
- data/lib/fatty/api/status.rb +1 -1
- data/lib/fatty/api.rb +12 -10
- data/lib/fatty/callback_environment.rb +1 -0
- data/lib/fatty/colors/color.rb +7 -30
- data/lib/fatty/config.rb +11 -11
- data/lib/fatty/curses/context.rb +41 -11
- data/lib/fatty/curses/event_source.rb +85 -26
- data/lib/fatty/curses/key_decoder.rb +54 -22
- data/lib/fatty/curses/patch.rb +2 -0
- data/lib/fatty/curses/pdcurses_keys.rb +154 -0
- data/lib/fatty/curses/windows_keyboard.rb +35 -0
- data/lib/fatty/env.rb +14 -12
- data/lib/fatty/help.rb +26 -18
- data/lib/fatty/input_field.rb +55 -17
- data/lib/fatty/key_event.rb +1 -4
- data/lib/fatty/keymaps/emacs.rb +12 -2
- data/lib/fatty/markdown/ansi_renderer.rb +1 -1
- data/lib/fatty/markdown/render.rb +10 -3
- data/lib/fatty/mouse_event.rb +3 -3
- data/lib/fatty/output_buffer.rb +1 -2
- data/lib/fatty/pager.rb +7 -7
- data/lib/fatty/progress.rb +2 -2
- data/lib/fatty/renderer/curses.rb +28 -27
- data/lib/fatty/renderer/truecolor.rb +8 -1
- data/lib/fatty/renderer.rb +6 -6
- data/lib/fatty/session/keytest_session.rb +2 -1
- data/lib/fatty/session/output_session.rb +3 -5
- data/lib/fatty/session/popup_session.rb +24 -24
- data/lib/fatty/session/prompt_session.rb +1 -1
- data/lib/fatty/session/shell_session.rb +11 -5
- data/lib/fatty/session/status_session.rb +2 -2
- data/lib/fatty/shell.rb +60 -0
- data/lib/fatty/terminal.rb +24 -19
- data/lib/fatty/version.rb +1 -1
- data/lib/fatty.rb +9 -10
- metadata +24 -18
data/README.md
CHANGED
|
@@ -1,116 +1,126 @@
|
|
|
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
|
-
|
|
1
|
+
<!-- Generated by gem_docs -->
|
|
2
|
+
|
|
3
|
+
[](https://github.com/ddoherty03/fatty/actions/workflows/main.yml)
|
|
4
|
+
|
|
5
|
+
Version: 0.99.12.0
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
# Table of Contents
|
|
9
|
+
|
|
10
|
+
1. [Introduction](#orgc3aa0f9)
|
|
11
|
+
2. [Quick Start](#org676b52c)
|
|
12
|
+
1. [Installing](#orgb52fd47)
|
|
13
|
+
2. [Trying it Out with the \`fatty\` Demo](#org3dd1f85)
|
|
14
|
+
1. [Builtin commands](#org8f9e7a3)
|
|
15
|
+
2. [Screenshots](#orgf49929b)
|
|
16
|
+
1. [Command line editing](#org668f39f)
|
|
17
|
+
2. [Searchable Output](#org6d73633)
|
|
18
|
+
3. [Paging Markdown](#org125d122)
|
|
19
|
+
4. [Popup Selection](#org40420fe)
|
|
20
|
+
3. [Usage](#org7d0d840)
|
|
21
|
+
1. [Launching a Fatty Terminal](#org978a664)
|
|
22
|
+
1. [`on_accept`](#org86555a8)
|
|
23
|
+
1. [Parameters to `on_accept`](#org5babbbc)
|
|
24
|
+
2. [The `line` parameter to `on_accept`](#org104ea23)
|
|
25
|
+
3. [The callback parameter to `on_accept`](#org8e4e0e9)
|
|
26
|
+
4. [Output ordering](#orgf43b37d)
|
|
27
|
+
5. [Long-running callbacks and interruption](#org438a355)
|
|
28
|
+
6. [ANSI colors in output](#org55a8cfb)
|
|
29
|
+
2. [Other parameters to `Terminal.new`](#orgf0e598e)
|
|
30
|
+
2. [The Callback API](#org6b81172)
|
|
31
|
+
1. [`append(text, follow: true, role: nil)`](#orgf27876a)
|
|
32
|
+
2. [`append_now(text, follow: true, mode: nil, role: nil)`](#org1e2bf8f)
|
|
33
|
+
3. [`clear_now`](#org914f5a2)
|
|
34
|
+
4. [`markdown(text)`](#orgc0fd55e)
|
|
35
|
+
5. [`markdown_now(text)`](#org72d60c5)
|
|
36
|
+
6. [`status(text, role: :info)`](#org447a0fa)
|
|
37
|
+
7. [`good(text, replace: false, render: true)`](#org81f32e8)
|
|
38
|
+
8. [`info(text, replace: false, render: true)`](#org7586431)
|
|
39
|
+
9. [`warn(text, replace: false, render: true)`](#orgaab47c1)
|
|
40
|
+
10. [`error(text, replace: false, render: true)`](#orgef3009c)
|
|
41
|
+
11. [`oops(text, replace: false, render: true)`](#org54f5ba4)
|
|
42
|
+
12. [`alert(text, role: :info)`](#org80b9a18)
|
|
43
|
+
13. [`prompt(prompt, initial: "", cancel_value: nil, history_key: nil, save_history: true)`](#org52a7608)
|
|
44
|
+
14. [`check_interrupt!`](#orge9b05bf)
|
|
45
|
+
15. [`add_progress(label:, total: nil, style: :percent, role: :info, width: 40)`](#org93f66ce)
|
|
46
|
+
1. [Initialization `add_progress(label:, style: :percent, total: nil, role: :info, width: 40)`](#org6f2be89)
|
|
47
|
+
2. [Update `update(current: nil, indicator: nil, render: false)`](#org33cb33a)
|
|
48
|
+
3. [Finish](#orge88de5c)
|
|
49
|
+
4. [Clear](#org3fd90e5)
|
|
50
|
+
16. [`choose(prompt, choices:, initial_choice_idx: 0, cancel_value: nil)`](#orgf089254)
|
|
51
|
+
17. [`choose_multi(prompt, choices:, cancel_value: nil)`](#orgc2d01d9)
|
|
52
|
+
18. [`confirm(prompt, yes_label: "Yes", no_label: "No", cancel_value: false)`](#orgee35a81)
|
|
53
|
+
19. [`menu(prompt, choices:, initial_choice_idx: 0, cancel_value: nil)`](#orgfe82492)
|
|
54
|
+
20. [`suspend(&block)`](#org354327e)
|
|
55
|
+
21. [`environment`](#org4996805)
|
|
56
|
+
3. [Terminal Methods](#org782b8f3)
|
|
57
|
+
1. [`Teminal#suspend(&block)`](#orgf7d4c43)
|
|
58
|
+
4. [Default Interaction](#org60cbab9)
|
|
59
|
+
1. [Parts of the Screen](#orgd79ef28)
|
|
60
|
+
1. [Input Field](#orgb97faa5)
|
|
61
|
+
2. [Output Pane](#orgb3661a5)
|
|
62
|
+
3. [Status Area](#orged87a45)
|
|
63
|
+
4. [Alert Area](#orgbffb778)
|
|
64
|
+
2. [Command-line Editing](#org22ebdf4)
|
|
65
|
+
1. [Input Context](#orgfa042f9)
|
|
66
|
+
1. [Cursor Motion](#orgac9f6ad)
|
|
67
|
+
2. [Clearing](#org1f733ab)
|
|
68
|
+
3. [Undo and Redo](#orgb539044)
|
|
69
|
+
4. [Deletion and Killing](#org456c7ce)
|
|
70
|
+
5. [Yanking, Mark, and Region](#org06eaa01)
|
|
71
|
+
6. [Count Prefix](#orgf042d14)
|
|
72
|
+
7. [History Navigation](#orgfa66361)
|
|
73
|
+
8. [Completion](#org6d2c123)
|
|
74
|
+
9. [Accept or Cancel](#orgbd4d7aa)
|
|
75
|
+
2. [Paging Context](#orgf020b69)
|
|
76
|
+
3. [Searching Output](#orgd10d710)
|
|
77
|
+
1. [String and Regex Search](#orgcf5d36b)
|
|
78
|
+
2. [Incremental Search](#org8df91d8)
|
|
79
|
+
5. [Configuration](#org908ef31)
|
|
80
|
+
1. [General Configuration `config.yml`](#orgf0b9c12)
|
|
81
|
+
1. [`word_char_re`](#org8b91da4)
|
|
82
|
+
2. [`esc_delay`](#orge7fbe16)
|
|
83
|
+
3. [`history`](#org1aae1a6)
|
|
84
|
+
1. [`file`](#orgc890e24)
|
|
85
|
+
2. [`max`](#org74a3f8b)
|
|
86
|
+
4. [`theme`](#org7ad1e2d)
|
|
87
|
+
5. [`truecolor`](#orgb7cde90)
|
|
88
|
+
6. [`log`](#org4ff8b74)
|
|
89
|
+
1. [`file`](#org0546fd0)
|
|
90
|
+
2. [`level`](#org3a3aa45)
|
|
91
|
+
3. [`tags`](#org8b9e724)
|
|
92
|
+
2. [Key code definitions `keydefs.yml`](#org313b0bc)
|
|
93
|
+
3. [Key bindings `keybindings.yml`](#org7f8d7ea)
|
|
94
|
+
1. [Key Names](#orga85f683)
|
|
95
|
+
1. [Printable Keys](#org3e506c8)
|
|
96
|
+
2. [Curses and Fatty Named Keys](#org44ba177)
|
|
97
|
+
3. [Possibly Invisible Keys](#org3db400d)
|
|
98
|
+
4. [Unnamed but Recognized Keys](#orgf7e0ebc)
|
|
99
|
+
2. [Mouse Events](#org1575d5d)
|
|
100
|
+
3. [Modifiers](#org4d74a75)
|
|
101
|
+
4. [Contexts](#org483f85f)
|
|
102
|
+
5. [Actions](#orgca715e9)
|
|
103
|
+
1. [Input buffer actions](#org4864882)
|
|
104
|
+
2. [Input field actions](#org15a723a)
|
|
105
|
+
3. [Shell session actions](#org2de54ae)
|
|
106
|
+
4. [Pager actions](#orgb787709)
|
|
107
|
+
5. [Pager search actions](#orgdaa4dc0)
|
|
108
|
+
6. [Popup actions](#orgda04712)
|
|
109
|
+
7. [Prompt popup actions](#org0c5eb9b)
|
|
110
|
+
8. [Utility Actions](#orge030d24)
|
|
111
|
+
4. [Themes `themes/`](#org175d4e2)
|
|
112
|
+
1. [Distributed Themes](#orge0afc4c)
|
|
113
|
+
2. [Custom Themes](#org4246032)
|
|
114
|
+
1. [Theme Name](#org0eb5caf)
|
|
115
|
+
2. [Inheritance from Another Theme](#org842a280)
|
|
116
|
+
3. [Inheritance within a Theme](#org1195a62)
|
|
117
|
+
4. [Theme Roles](#org6ef566f)
|
|
118
|
+
5. [Role Colors and Attributes and Frame Style](#orgdb38f78)
|
|
119
|
+
3. [The `themer` helper](#orgde2facb)
|
|
120
|
+
6. [Windows differences](#orgf6a8fbb)
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
<a id="orgc3aa0f9"></a>
|
|
114
124
|
|
|
115
125
|
# Introduction
|
|
116
126
|
|
|
@@ -138,12 +148,12 @@ In other words, fatty allows you to write a terminal-based REPL of your choosing
|
|
|
138
148
|
`Fatty` is *not* a terminal emulator but runs on top of one.
|
|
139
149
|
|
|
140
150
|
|
|
141
|
-
<a id="
|
|
151
|
+
<a id="org676b52c"></a>
|
|
142
152
|
|
|
143
153
|
# Quick Start
|
|
144
154
|
|
|
145
155
|
|
|
146
|
-
<a id="
|
|
156
|
+
<a id="orgb52fd47"></a>
|
|
147
157
|
|
|
148
158
|
## Installing
|
|
149
159
|
|
|
@@ -154,7 +164,7 @@ $ gem install fatty
|
|
|
154
164
|
```
|
|
155
165
|
|
|
156
166
|
|
|
157
|
-
<a id="
|
|
167
|
+
<a id="org3dd1f85"></a>
|
|
158
168
|
|
|
159
169
|
## Trying it Out with the \`fatty\` Demo
|
|
160
170
|
|
|
@@ -163,7 +173,7 @@ Once installed, you can try out `fatty` with the included program called `fatty`
|
|
|
163
173
|
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.
|
|
164
174
|
|
|
165
175
|
|
|
166
|
-
<a id="
|
|
176
|
+
<a id="org8f9e7a3"></a>
|
|
167
177
|
|
|
168
178
|
### Builtin commands
|
|
169
179
|
|
|
@@ -197,12 +207,12 @@ Here are the commands builtin to `fatty`
|
|
|
197
207
|
| colors | Display ANSI, 256-color, and X11 color diagnostics |
|
|
198
208
|
|
|
199
209
|
|
|
200
|
-
<a id="
|
|
210
|
+
<a id="orgf49929b"></a>
|
|
201
211
|
|
|
202
212
|
### Screenshots
|
|
203
213
|
|
|
204
214
|
|
|
205
|
-
<a id="
|
|
215
|
+
<a id="org668f39f"></a>
|
|
206
216
|
|
|
207
217
|
#### Command line editing
|
|
208
218
|
|
|
@@ -211,7 +221,7 @@ Here is the command line, mid-edit showing a region selected and, in dim text to
|
|
|
211
221
|

|
|
212
222
|
|
|
213
223
|
|
|
214
|
-
<a id="
|
|
224
|
+
<a id="org6d73633"></a>
|
|
215
225
|
|
|
216
226
|
#### Searchable Output
|
|
217
227
|
|
|
@@ -220,7 +230,7 @@ While paging output, you can search for words, as here the user searches for the
|
|
|
220
230
|

|
|
221
231
|
|
|
222
232
|
|
|
223
|
-
<a id="
|
|
233
|
+
<a id="org125d122"></a>
|
|
224
234
|
|
|
225
235
|
#### Paging Markdown
|
|
226
236
|
|
|
@@ -229,7 +239,7 @@ The `fatty` demo running the `markdown` command and paging the output. It shows
|
|
|
229
239
|

|
|
230
240
|
|
|
231
241
|
|
|
232
|
-
<a id="
|
|
242
|
+
<a id="org40420fe"></a>
|
|
233
243
|
|
|
234
244
|
#### Popup Selection
|
|
235
245
|
|
|
@@ -238,17 +248,17 @@ One of the many "widgets" available through `fatty` is the ability to present th
|
|
|
238
248
|

|
|
239
249
|
|
|
240
250
|
|
|
241
|
-
<a id="
|
|
251
|
+
<a id="org7d0d840"></a>
|
|
242
252
|
|
|
243
253
|
# Usage
|
|
244
254
|
|
|
245
255
|
|
|
246
|
-
<a id="
|
|
256
|
+
<a id="org978a664"></a>
|
|
247
257
|
|
|
248
258
|
## Launching a Fatty Terminal
|
|
249
259
|
|
|
250
260
|
|
|
251
|
-
<a id="
|
|
261
|
+
<a id="org86555a8"></a>
|
|
252
262
|
|
|
253
263
|
### `on_accept`
|
|
254
264
|
|
|
@@ -281,14 +291,14 @@ When a `fatty` application runs, `fatty` installs a few files if they do not exi
|
|
|
281
291
|
- `themes`, a directory of pre-defined theme definitions that you can choose from and add to by adding your own themes.
|
|
282
292
|
|
|
283
293
|
|
|
284
|
-
<a id="
|
|
294
|
+
<a id="org5babbbc"></a>
|
|
285
295
|
|
|
286
296
|
#### Parameters to `on_accept`
|
|
287
297
|
|
|
288
298
|
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`.
|
|
289
299
|
|
|
290
300
|
|
|
291
|
-
<a id="
|
|
301
|
+
<a id="org104ea23"></a>
|
|
292
302
|
|
|
293
303
|
#### The `line` parameter to `on_accept`
|
|
294
304
|
|
|
@@ -329,7 +339,7 @@ Fatty::Terminal.new(
|
|
|
329
339
|
```
|
|
330
340
|
|
|
331
341
|
|
|
332
|
-
<a id="
|
|
342
|
+
<a id="org8e4e0e9"></a>
|
|
333
343
|
|
|
334
344
|
#### The callback parameter to `on_accept`
|
|
335
345
|
|
|
@@ -354,7 +364,7 @@ Fatty::Terminal.new(
|
|
|
354
364
|
The callback parameter responds to several methods that allow your application to interact with the user. They are documented below.
|
|
355
365
|
|
|
356
366
|
|
|
357
|
-
<a id="
|
|
367
|
+
<a id="orgf43b37d"></a>
|
|
358
368
|
|
|
359
369
|
#### Output ordering
|
|
360
370
|
|
|
@@ -362,7 +372,7 @@ The `on_accept` callback can send text to the output pane in three ways:
|
|
|
362
372
|
|
|
363
373
|
1. by returning a value from the callback;
|
|
364
374
|
2. by calling `append` or `markdown` on the callback environment; or
|
|
365
|
-
3. by calling `append_now` on the callback environment.
|
|
375
|
+
3. by calling `append_now` or `markdown_now` on the callback environment.
|
|
366
376
|
|
|
367
377
|
A returned `String` is the simplest output mechanism. It is displayed after the callback finishes:
|
|
368
378
|
|
|
@@ -374,12 +384,12 @@ Fatty::Terminal.new(
|
|
|
374
384
|
|
|
375
385
|
Calls to `append` and `markdown` also queue output until the callback finishes. If a callback both calls `append` or `markdown` and returns a `String`, the queued output is displayed first and the returned string is displayed after it.
|
|
376
386
|
|
|
377
|
-
Calls to `append_now` are different. They append text and immediately render a frame, so the user can see output while the callback is still running. Use `append_now` for long-running callbacks that should stream progress to the output pane.
|
|
387
|
+
Calls to `append_now` and `markdown_now` are different. They append text and immediately render a frame, so the user can see output while the callback is still running. Use `append_now` for long-running callbacks that should stream progress to the output pane.
|
|
378
388
|
|
|
379
|
-
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.
|
|
389
|
+
At the end of the callback, `Fatty` finishes the command and updates the pager state. Output produced with `append_now` or `markdown_now` may therefore appear during the callback, while output from `append`, `markdown`, and the callback's return value appears after the callback returns.
|
|
380
390
|
|
|
381
391
|
|
|
382
|
-
<a id="
|
|
392
|
+
<a id="org438a355"></a>
|
|
383
393
|
|
|
384
394
|
#### Long-running callbacks and interruption
|
|
385
395
|
|
|
@@ -418,14 +428,14 @@ end
|
|
|
418
428
|
```
|
|
419
429
|
|
|
420
430
|
|
|
421
|
-
<a id="
|
|
431
|
+
<a id="org55a8cfb"></a>
|
|
422
432
|
|
|
423
433
|
#### ANSI colors in output
|
|
424
434
|
|
|
425
435
|
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.
|
|
426
436
|
|
|
427
437
|
|
|
428
|
-
<a id="
|
|
438
|
+
<a id="orgf0e598e"></a>
|
|
429
439
|
|
|
430
440
|
### Other parameters to `Terminal.new`
|
|
431
441
|
|
|
@@ -452,14 +462,14 @@ Fatty::Terminal.new(
|
|
|
452
462
|
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.
|
|
453
463
|
|
|
454
464
|
|
|
455
|
-
<a id="
|
|
465
|
+
<a id="org6b81172"></a>
|
|
456
466
|
|
|
457
467
|
## The Callback API
|
|
458
468
|
|
|
459
469
|
Here are the details on the messages that you can send to the callback parameter to the `on_accept` proc.
|
|
460
470
|
|
|
461
471
|
|
|
462
|
-
<a id="
|
|
472
|
+
<a id="orgf27876a"></a>
|
|
463
473
|
|
|
464
474
|
### `append(text, follow: true, role: nil)`
|
|
465
475
|
|
|
@@ -468,7 +478,7 @@ Add the given text to the output pane. After a full page of output is produced,
|
|
|
468
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.
|
|
469
479
|
|
|
470
480
|
|
|
471
|
-
<a id="
|
|
481
|
+
<a id="org1e2bf8f"></a>
|
|
472
482
|
|
|
473
483
|
### `append_now(text, follow: true, mode: nil, role: nil)`
|
|
474
484
|
|
|
@@ -479,14 +489,14 @@ Setting the mode to `:scrolling` or `:paging` determines whether the output is s
|
|
|
479
489
|
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.
|
|
480
490
|
|
|
481
491
|
|
|
482
|
-
<a id="
|
|
492
|
+
<a id="org914f5a2"></a>
|
|
483
493
|
|
|
484
494
|
### `clear_now`
|
|
485
495
|
|
|
486
496
|
Clear the callback's output pane and redraw immediately. Use this before displaying a fresh report or starting the next step of a guided workflow. This affects output already displayed; queued `append` commands remain queued, just as they do when calling `append_now`.
|
|
487
497
|
|
|
488
498
|
|
|
489
|
-
<a id="
|
|
499
|
+
<a id="orgc0fd55e"></a>
|
|
490
500
|
|
|
491
501
|
### `markdown(text)`
|
|
492
502
|
|
|
@@ -506,7 +516,14 @@ and this should appear on the next line.
|
|
|
506
516
|
```
|
|
507
517
|
|
|
508
518
|
|
|
509
|
-
<a id="
|
|
519
|
+
<a id="org72d60c5"></a>
|
|
520
|
+
|
|
521
|
+
### `markdown_now(text)`
|
|
522
|
+
|
|
523
|
+
Render Markdown using the current theme, then call `append_now` to display it immediately. Like `markdown`, this returns `nil`. Previously queued output remains queued. Use this when Markdown should be visible before a prompt or while a callback is still running.
|
|
524
|
+
|
|
525
|
+
|
|
526
|
+
<a id="org447a0fa"></a>
|
|
510
527
|
|
|
511
528
|
### `status(text, role: :info)`
|
|
512
529
|
|
|
@@ -518,49 +535,49 @@ Display the text in the "status" area, the lines immediately above the input fie
|
|
|
518
535
|
- **:error:** colored something to suggest danger, usually some tone of red.
|
|
519
536
|
|
|
520
537
|
|
|
521
|
-
<a id="
|
|
538
|
+
<a id="org81f32e8"></a>
|
|
522
539
|
|
|
523
540
|
### `good(text, replace: false, render: true)`
|
|
524
541
|
|
|
525
542
|
Display the text in the status area with the role :good.
|
|
526
543
|
|
|
527
544
|
|
|
528
|
-
<a id="
|
|
545
|
+
<a id="org7586431"></a>
|
|
529
546
|
|
|
530
547
|
### `info(text, replace: false, render: true)`
|
|
531
548
|
|
|
532
549
|
Display the text in the status area with the role :info.
|
|
533
550
|
|
|
534
551
|
|
|
535
|
-
<a id="
|
|
552
|
+
<a id="orgaab47c1"></a>
|
|
536
553
|
|
|
537
554
|
### `warn(text, replace: false, render: true)`
|
|
538
555
|
|
|
539
556
|
Display the text in the status area with the role :warn.
|
|
540
557
|
|
|
541
558
|
|
|
542
|
-
<a id="
|
|
559
|
+
<a id="orgef3009c"></a>
|
|
543
560
|
|
|
544
561
|
### `error(text, replace: false, render: true)`
|
|
545
562
|
|
|
546
563
|
Display the text in the status area with the role :error.
|
|
547
564
|
|
|
548
565
|
|
|
549
|
-
<a id="
|
|
566
|
+
<a id="org54f5ba4"></a>
|
|
550
567
|
|
|
551
568
|
### `oops(text, replace: false, render: true)`
|
|
552
569
|
|
|
553
570
|
An alias for `error(text)`
|
|
554
571
|
|
|
555
572
|
|
|
556
|
-
<a id="
|
|
573
|
+
<a id="org80b9a18"></a>
|
|
557
574
|
|
|
558
575
|
### `alert(text, role: :info)`
|
|
559
576
|
|
|
560
577
|
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.
|
|
561
578
|
|
|
562
579
|
|
|
563
|
-
<a id="
|
|
580
|
+
<a id="org52a7608"></a>
|
|
564
581
|
|
|
565
582
|
### `prompt(prompt, initial: "", cancel_value: nil, history_key: nil, save_history: true)`
|
|
566
583
|
|
|
@@ -590,7 +607,7 @@ The `prompt` input has its own history facility separate from the history in the
|
|
|
590
607
|
`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`.
|
|
591
608
|
|
|
592
609
|
|
|
593
|
-
<a id="
|
|
610
|
+
<a id="orge9b05bf"></a>
|
|
594
611
|
|
|
595
612
|
### `check_interrupt!`
|
|
596
613
|
|
|
@@ -601,7 +618,7 @@ The polling is throttled, so `check_interrupt!` may be called frequently. It sho
|
|
|
601
618
|
Fatty catches `Fatty::Interrupt` at the callback boundary, finishes the current command, restores the terminal state, and resumes the normal input loop.
|
|
602
619
|
|
|
603
620
|
|
|
604
|
-
<a id="
|
|
621
|
+
<a id="org93f66ce"></a>
|
|
605
622
|
|
|
606
623
|
### `add_progress(label:, total: nil, style: :percent, role: :info, width: 40)`
|
|
607
624
|
|
|
@@ -617,7 +634,7 @@ Display a progress widget in the status area to show the user that the system is
|
|
|
617
634
|
- **:trail:** display an "indicator" on each call of `update(indicator: <string>)`
|
|
618
635
|
|
|
619
636
|
|
|
620
|
-
<a id="
|
|
637
|
+
<a id="org6f2be89"></a>
|
|
621
638
|
|
|
622
639
|
#### Initialization `add_progress(label:, style: :percent, total: nil, role: :info, width: 40)`
|
|
623
640
|
|
|
@@ -628,7 +645,7 @@ Display a progress widget in the status area to show the user that the system is
|
|
|
628
645
|
- **`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.
|
|
629
646
|
|
|
630
647
|
|
|
631
|
-
<a id="
|
|
648
|
+
<a id="org33cb33a"></a>
|
|
632
649
|
|
|
633
650
|
#### Update `update(current: nil, indicator: nil, render: false)`
|
|
634
651
|
|
|
@@ -734,21 +751,21 @@ Fatty::Terminal.new(
|
|
|
734
751
|
```
|
|
735
752
|
|
|
736
753
|
|
|
737
|
-
<a id="
|
|
754
|
+
<a id="orge88de5c"></a>
|
|
738
755
|
|
|
739
756
|
#### Finish
|
|
740
757
|
|
|
741
758
|
As the prior examples illustrate, you can issue an ending message at the end of the process by calling `#finish` on the Progress object.
|
|
742
759
|
|
|
743
760
|
|
|
744
|
-
<a id="
|
|
761
|
+
<a id="org3fd90e5"></a>
|
|
745
762
|
|
|
746
763
|
#### Clear
|
|
747
764
|
|
|
748
765
|
And, if you have occasion, you can clear the Progress by calling `#clear` on the Progress object.
|
|
749
766
|
|
|
750
767
|
|
|
751
|
-
<a id="
|
|
768
|
+
<a id="orgf089254"></a>
|
|
752
769
|
|
|
753
770
|
### `choose(prompt, choices:, initial_choice_idx: 0, cancel_value: nil)`
|
|
754
771
|
|
|
@@ -814,7 +831,7 @@ Fatty::Terminal.new(
|
|
|
814
831
|
```
|
|
815
832
|
|
|
816
833
|
|
|
817
|
-
<a id="
|
|
834
|
+
<a id="orgc2d01d9"></a>
|
|
818
835
|
|
|
819
836
|
### `choose_multi(prompt, choices:, cancel_value: nil)`
|
|
820
837
|
|
|
@@ -832,7 +849,7 @@ Present a set of `choices:`, which can either be
|
|
|
832
849
|
The `prompt` String (by default "Choose Many") can guide the user about the purpose of the choices.
|
|
833
850
|
|
|
834
851
|
|
|
835
|
-
<a id="
|
|
852
|
+
<a id="orgee35a81"></a>
|
|
836
853
|
|
|
837
854
|
### `confirm(prompt, yes_label: "Yes", no_label: "No", cancel_value: false)`
|
|
838
855
|
|
|
@@ -843,7 +860,7 @@ Present the user with a simple Yes/No choice using your choice of ways to expres
|
|
|
843
860
|
`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.
|
|
844
861
|
|
|
845
862
|
|
|
846
|
-
<a id="
|
|
863
|
+
<a id="orgfe82492"></a>
|
|
847
864
|
|
|
848
865
|
### `menu(prompt, choices:, initial_choice_idx: 0, cancel_value: nil)`
|
|
849
866
|
|
|
@@ -890,7 +907,7 @@ If you want to set one of the choices as the initial choice, set `initial_choice
|
|
|
890
907
|
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.
|
|
891
908
|
|
|
892
909
|
|
|
893
|
-
<a id="
|
|
910
|
+
<a id="org354327e"></a>
|
|
894
911
|
|
|
895
912
|
### `suspend(&block)`
|
|
896
913
|
|
|
@@ -907,7 +924,7 @@ end
|
|
|
907
924
|
The value of the block is returned by `suspend`. Terminal state is restored even if the block exits by raising an exception.
|
|
908
925
|
|
|
909
926
|
|
|
910
|
-
<a id="
|
|
927
|
+
<a id="org4996805"></a>
|
|
911
928
|
|
|
912
929
|
### `environment`
|
|
913
930
|
|
|
@@ -944,76 +961,73 @@ The environment report also includes a nested `:curses` hash:
|
|
|
944
961
|
| `:can_change_color` | Whether curses can redefine color values |
|
|
945
962
|
|
|
946
963
|
|
|
947
|
-
<a id="
|
|
964
|
+
<a id="org782b8f3"></a>
|
|
948
965
|
|
|
949
966
|
## Terminal Methods
|
|
950
967
|
|
|
951
968
|
|
|
952
|
-
<a id="
|
|
969
|
+
<a id="orgf7d4c43"></a>
|
|
953
970
|
|
|
954
971
|
### `Teminal#suspend(&block)`
|
|
955
972
|
|
|
956
973
|
Return control to the launching terminal, execute the given block, and return.
|
|
957
974
|
|
|
958
975
|
|
|
959
|
-
<a id="
|
|
976
|
+
<a id="org60cbab9"></a>
|
|
960
977
|
|
|
961
978
|
# Default Interaction
|
|
962
979
|
|
|
963
980
|
|
|
964
|
-
<a id="
|
|
981
|
+
<a id="orgd79ef28"></a>
|
|
965
982
|
|
|
966
983
|
## Parts of the Screen
|
|
967
984
|
|
|
968
985
|
|
|
969
|
-
<a id="
|
|
986
|
+
<a id="orgb97faa5"></a>
|
|
970
987
|
|
|
971
988
|
### Input Field
|
|
972
989
|
|
|
973
990
|
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.
|
|
974
991
|
|
|
975
992
|
|
|
976
|
-
<a id="
|
|
993
|
+
<a id="orgb3661a5"></a>
|
|
977
994
|
|
|
978
995
|
### Output Pane
|
|
979
996
|
|
|
980
997
|
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.
|
|
981
998
|
|
|
982
999
|
|
|
983
|
-
<a id="
|
|
1000
|
+
<a id="orged87a45"></a>
|
|
984
1001
|
|
|
985
1002
|
### Status Area
|
|
986
1003
|
|
|
987
1004
|
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.
|
|
988
1005
|
|
|
989
1006
|
|
|
990
|
-
<a id="
|
|
1007
|
+
<a id="orgbffb778"></a>
|
|
991
1008
|
|
|
992
1009
|
### Alert Area
|
|
993
1010
|
|
|
994
1011
|
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.
|
|
995
1012
|
|
|
996
1013
|
|
|
997
|
-
<a id="
|
|
1014
|
+
<a id="org22ebdf4"></a>
|
|
998
1015
|
|
|
999
1016
|
## Command-line Editing
|
|
1000
1017
|
|
|
1001
|
-
Press `M-?` (Alt-?, or Escape followed by ?) to browse the current
|
|
1002
|
-
keybindings, including user overrides and action descriptions. The help
|
|
1003
|
-
uses the usual pager controls, including search. Press `q` to return to
|
|
1004
|
-
the previous output, pager position, and unfinished command line.
|
|
1018
|
+
Press `M-?` (Alt-?, or Escape followed by ?) to browse the current keybindings, including user overrides and action descriptions. The help uses the usual pager controls, including search. Press `q` to return to the previous output, pager position, and unfinished command line.
|
|
1005
1019
|
|
|
1006
|
-
`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
|
|
1020
|
+
`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.
|
|
1007
1021
|
|
|
1008
1022
|
|
|
1009
|
-
<a id="
|
|
1023
|
+
<a id="orgfa042f9"></a>
|
|
1010
1024
|
|
|
1011
1025
|
### Input Context
|
|
1012
1026
|
|
|
1013
1027
|
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.
|
|
1014
1028
|
|
|
1015
1029
|
|
|
1016
|
-
<a id="
|
|
1030
|
+
<a id="orgac9f6ad"></a>
|
|
1017
1031
|
|
|
1018
1032
|
#### Cursor Motion
|
|
1019
1033
|
|
|
@@ -1037,7 +1051,7 @@ When editing the input line or text input for widgets like the \`prompt\`, \`fat
|
|
|
1037
1051
|
| C-:left | move cursor left one word |
|
|
1038
1052
|
|
|
1039
1053
|
|
|
1040
|
-
<a id="
|
|
1054
|
+
<a id="org1f733ab"></a>
|
|
1041
1055
|
|
|
1042
1056
|
#### Clearing
|
|
1043
1057
|
|
|
@@ -1048,7 +1062,7 @@ This is one action that does not affect the input buffer but the output pane. It
|
|
|
1048
1062
|
| C-l | clear the output pane |
|
|
1049
1063
|
|
|
1050
1064
|
|
|
1051
|
-
<a id="
|
|
1065
|
+
<a id="orgb539044"></a>
|
|
1052
1066
|
|
|
1053
1067
|
#### Undo and Redo
|
|
1054
1068
|
|
|
@@ -1062,7 +1076,7 @@ This is one action that does not affect the input buffer but the output pane. It
|
|
|
1062
1076
|
| M-/ | redo |
|
|
1063
1077
|
|
|
1064
1078
|
|
|
1065
|
-
<a id="
|
|
1079
|
+
<a id="org456c7ce"></a>
|
|
1066
1080
|
|
|
1067
1081
|
#### Deletion and Killing
|
|
1068
1082
|
|
|
@@ -1082,7 +1096,7 @@ When the region is active, destructive editing commands kill the region rather t
|
|
|
1082
1096
|
| M-t | transpose words |
|
|
1083
1097
|
|
|
1084
1098
|
|
|
1085
|
-
<a id="
|
|
1099
|
+
<a id="org06eaa01"></a>
|
|
1086
1100
|
|
|
1087
1101
|
#### Yanking, Mark, and Region
|
|
1088
1102
|
|
|
@@ -1110,7 +1124,7 @@ Notice that commands that normally delete characters or words, kill the region i
|
|
|
1110
1124
|
| M-w | copy the region |
|
|
1111
1125
|
|
|
1112
1126
|
|
|
1113
|
-
<a id="
|
|
1127
|
+
<a id="orgf042d14"></a>
|
|
1114
1128
|
|
|
1115
1129
|
#### Count Prefix
|
|
1116
1130
|
|
|
@@ -1126,7 +1140,7 @@ Fatty follows the emacs convention of making `C-u` multiply the count prefix by
|
|
|
1126
1140
|
| M-<digit> | accumulate a count argument |
|
|
1127
1141
|
|
|
1128
1142
|
|
|
1129
|
-
<a id="
|
|
1143
|
+
<a id="orgfa66361"></a>
|
|
1130
1144
|
|
|
1131
1145
|
#### History Navigation
|
|
1132
1146
|
|
|
@@ -1149,7 +1163,7 @@ You can navigate history items with the `up` and `down` keys as you would expect
|
|
|
1149
1163
|
| C-r | search the history in a popup |
|
|
1150
1164
|
|
|
1151
1165
|
|
|
1152
|
-
<a id="
|
|
1166
|
+
<a id="org6d2c123"></a>
|
|
1153
1167
|
|
|
1154
1168
|
#### Completion
|
|
1155
1169
|
|
|
@@ -1195,7 +1209,7 @@ You can navigate history items with the `up` and `down` keys as you would expect
|
|
|
1195
1209
|
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.
|
|
1196
1210
|
|
|
1197
1211
|
|
|
1198
|
-
<a id="
|
|
1212
|
+
<a id="orgbd4d7aa"></a>
|
|
1199
1213
|
|
|
1200
1214
|
#### Accept or Cancel
|
|
1201
1215
|
|
|
@@ -1211,7 +1225,7 @@ You can end a `fatty` session with `C-c` at the command line, or (only if the bu
|
|
|
1211
1225
|
| C-d | quit \`fatty\` only if the input line is empty |
|
|
1212
1226
|
|
|
1213
1227
|
|
|
1214
|
-
<a id="
|
|
1228
|
+
<a id="orgf020b69"></a>
|
|
1215
1229
|
|
|
1216
1230
|
### Paging Context
|
|
1217
1231
|
|
|
@@ -1268,7 +1282,7 @@ You can add line numbers to the display while paging by using the `=` key.
|
|
|
1268
1282
|
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 `>`.
|
|
1269
1283
|
|
|
1270
1284
|
|
|
1271
|
-
<a id="
|
|
1285
|
+
<a id="orgd10d710"></a>
|
|
1272
1286
|
|
|
1273
1287
|
### Searching Output
|
|
1274
1288
|
|
|
@@ -1277,21 +1291,21 @@ While paging, you can initiate a search of the output as indicated in the above
|
|
|
1277
1291
|
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.
|
|
1278
1292
|
|
|
1279
1293
|
|
|
1280
|
-
<a id="
|
|
1294
|
+
<a id="orgcf5d36b"></a>
|
|
1281
1295
|
|
|
1282
1296
|
#### String and Regex Search
|
|
1283
1297
|
|
|
1284
1298
|
`/` 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`.
|
|
1285
1299
|
|
|
1286
1300
|
|
|
1287
|
-
<a id="
|
|
1301
|
+
<a id="org8df91d8"></a>
|
|
1288
1302
|
|
|
1289
1303
|
#### Incremental Search
|
|
1290
1304
|
|
|
1291
1305
|
`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.
|
|
1292
1306
|
|
|
1293
1307
|
|
|
1294
|
-
<a id="
|
|
1308
|
+
<a id="org908ef31"></a>
|
|
1295
1309
|
|
|
1296
1310
|
# Configuration
|
|
1297
1311
|
|
|
@@ -1309,7 +1323,7 @@ The default user-specific configuration directory follows `XDG_CONFIG_HOME` if i
|
|
|
1309
1323
|
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.
|
|
1310
1324
|
|
|
1311
1325
|
|
|
1312
|
-
<a id="
|
|
1326
|
+
<a id="orgf0b9c12"></a>
|
|
1313
1327
|
|
|
1314
1328
|
## General Configuration `config.yml`
|
|
1315
1329
|
|
|
@@ -1332,7 +1346,7 @@ truecolor: auto
|
|
|
1332
1346
|
```
|
|
1333
1347
|
|
|
1334
1348
|
|
|
1335
|
-
<a id="
|
|
1349
|
+
<a id="org8b91da4"></a>
|
|
1336
1350
|
|
|
1337
1351
|
### `word_char_re`
|
|
1338
1352
|
|
|
@@ -1355,7 +1369,7 @@ word_char_re: "[[:alnum:]_.:-]"
|
|
|
1355
1369
|
```
|
|
1356
1370
|
|
|
1357
1371
|
|
|
1358
|
-
<a id="
|
|
1372
|
+
<a id="orge7fbe16"></a>
|
|
1359
1373
|
|
|
1360
1374
|
### `esc_delay`
|
|
1361
1375
|
|
|
@@ -1366,26 +1380,26 @@ esc_delay: 0
|
|
|
1366
1380
|
```
|
|
1367
1381
|
|
|
1368
1382
|
|
|
1369
|
-
<a id="
|
|
1383
|
+
<a id="org1aae1a6"></a>
|
|
1370
1384
|
|
|
1371
1385
|
### `history`
|
|
1372
1386
|
|
|
1373
1387
|
|
|
1374
|
-
<a id="
|
|
1388
|
+
<a id="orgc890e24"></a>
|
|
1375
1389
|
|
|
1376
1390
|
#### `file`
|
|
1377
1391
|
|
|
1378
1392
|
The path to the history file to use, by default `~/.fatty_history`
|
|
1379
1393
|
|
|
1380
1394
|
|
|
1381
|
-
<a id="
|
|
1395
|
+
<a id="org74a3f8b"></a>
|
|
1382
1396
|
|
|
1383
1397
|
#### `max`
|
|
1384
1398
|
|
|
1385
1399
|
The maximum number of lines of history retained, by default 10,000.
|
|
1386
1400
|
|
|
1387
1401
|
|
|
1388
|
-
<a id="
|
|
1402
|
+
<a id="org7ad1e2d"></a>
|
|
1389
1403
|
|
|
1390
1404
|
### `theme`
|
|
1391
1405
|
|
|
@@ -1396,7 +1410,7 @@ theme: nordic
|
|
|
1396
1410
|
```
|
|
1397
1411
|
|
|
1398
1412
|
|
|
1399
|
-
<a id="
|
|
1413
|
+
<a id="orgb7cde90"></a>
|
|
1400
1414
|
|
|
1401
1415
|
### `truecolor`
|
|
1402
1416
|
|
|
@@ -1407,7 +1421,7 @@ truecolor: auto
|
|
|
1407
1421
|
```
|
|
1408
1422
|
|
|
1409
1423
|
|
|
1410
|
-
<a id="
|
|
1424
|
+
<a id="org4ff8b74"></a>
|
|
1411
1425
|
|
|
1412
1426
|
### `log`
|
|
1413
1427
|
|
|
@@ -1429,14 +1443,14 @@ tags:
|
|
|
1429
1443
|
```
|
|
1430
1444
|
|
|
1431
1445
|
|
|
1432
|
-
<a id="
|
|
1446
|
+
<a id="org0546fd0"></a>
|
|
1433
1447
|
|
|
1434
1448
|
#### `file`
|
|
1435
1449
|
|
|
1436
1450
|
The path to the log file to use.
|
|
1437
1451
|
|
|
1438
1452
|
|
|
1439
|
-
<a id="
|
|
1453
|
+
<a id="org3a3aa45"></a>
|
|
1440
1454
|
|
|
1441
1455
|
#### `level`
|
|
1442
1456
|
|
|
@@ -1448,7 +1462,7 @@ Can be one of the following
|
|
|
1448
1462
|
- **`debug`:** detailed messages to assist debugging `fatty` plus all of the above.
|
|
1449
1463
|
|
|
1450
1464
|
|
|
1451
|
-
<a id="
|
|
1465
|
+
<a id="org8b9e724"></a>
|
|
1452
1466
|
|
|
1453
1467
|
#### `tags`
|
|
1454
1468
|
|
|
@@ -1466,7 +1480,7 @@ tags:
|
|
|
1466
1480
|
```
|
|
1467
1481
|
|
|
1468
1482
|
|
|
1469
|
-
<a id="
|
|
1483
|
+
<a id="org313b0bc"></a>
|
|
1470
1484
|
|
|
1471
1485
|
## Key code definitions `keydefs.yml`
|
|
1472
1486
|
|
|
@@ -1628,7 +1642,7 @@ konsole:
|
|
|
1628
1642
|
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`!).
|
|
1629
1643
|
|
|
1630
1644
|
|
|
1631
|
-
<a id="
|
|
1645
|
+
<a id="org7f8d7ea"></a>
|
|
1632
1646
|
|
|
1633
1647
|
## Key bindings `keybindings.yml`
|
|
1634
1648
|
|
|
@@ -1655,7 +1669,7 @@ A keybinding names a key chord, the context in which it applies, and the Fatty a
|
|
|
1655
1669
|
```
|
|
1656
1670
|
|
|
1657
1671
|
|
|
1658
|
-
<a id="
|
|
1672
|
+
<a id="orga85f683"></a>
|
|
1659
1673
|
|
|
1660
1674
|
### Key Names
|
|
1661
1675
|
|
|
@@ -1669,7 +1683,7 @@ A keybinding uses the unmodified key name under the `key` field:
|
|
|
1669
1683
|
```
|
|
1670
1684
|
|
|
1671
1685
|
|
|
1672
|
-
<a id="
|
|
1686
|
+
<a id="org3e506c8"></a>
|
|
1673
1687
|
|
|
1674
1688
|
#### Printable Keys
|
|
1675
1689
|
|
|
@@ -1685,7 +1699,7 @@ Most printable keys can be written as the character itself. Quote keys that YAML
|
|
|
1685
1699
|
```
|
|
1686
1700
|
|
|
1687
1701
|
|
|
1688
|
-
<a id="
|
|
1702
|
+
<a id="org44ba177"></a>
|
|
1689
1703
|
|
|
1690
1704
|
#### Curses and Fatty Named Keys
|
|
1691
1705
|
|
|
@@ -1710,7 +1724,7 @@ Some terminals can report application-keypad sequences such as `keypad_divide`,
|
|
|
1710
1724
|
- `space`
|
|
1711
1725
|
|
|
1712
1726
|
|
|
1713
|
-
<a id="
|
|
1727
|
+
<a id="org3db400d"></a>
|
|
1714
1728
|
|
|
1715
1729
|
#### Possibly Invisible Keys
|
|
1716
1730
|
|
|
@@ -1719,7 +1733,7 @@ Some physical keys may never reach Fatty at all. They may be handled by the keyb
|
|
|
1719
1733
|
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.
|
|
1720
1734
|
|
|
1721
1735
|
|
|
1722
|
-
<a id="
|
|
1736
|
+
<a id="orgf7e0ebc"></a>
|
|
1723
1737
|
|
|
1724
1738
|
#### Unnamed but Recognized Keys
|
|
1725
1739
|
|
|
@@ -1744,7 +1758,7 @@ Then bind it in `keybindings.yml`:
|
|
|
1744
1758
|
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`.
|
|
1745
1759
|
|
|
1746
1760
|
|
|
1747
|
-
<a id="
|
|
1761
|
+
<a id="org1575d5d"></a>
|
|
1748
1762
|
|
|
1749
1763
|
### Mouse Events
|
|
1750
1764
|
|
|
@@ -1779,7 +1793,7 @@ scroll_down
|
|
|
1779
1793
|
```
|
|
1780
1794
|
|
|
1781
1795
|
|
|
1782
|
-
<a id="
|
|
1796
|
+
<a id="org4d74a75"></a>
|
|
1783
1797
|
|
|
1784
1798
|
### Modifiers
|
|
1785
1799
|
|
|
@@ -1792,7 +1806,7 @@ shift: true
|
|
|
1792
1806
|
```
|
|
1793
1807
|
|
|
1794
1808
|
|
|
1795
|
-
<a id="
|
|
1809
|
+
<a id="org483f85f"></a>
|
|
1796
1810
|
|
|
1797
1811
|
### Contexts
|
|
1798
1812
|
|
|
@@ -1826,7 +1840,7 @@ The available contexts are:
|
|
|
1826
1840
|
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.
|
|
1827
1841
|
|
|
1828
1842
|
|
|
1829
|
-
<a id="
|
|
1843
|
+
<a id="orgca715e9"></a>
|
|
1830
1844
|
|
|
1831
1845
|
### Actions
|
|
1832
1846
|
|
|
@@ -1854,7 +1868,7 @@ Most movement, deletion, history, completion, paging, and popup-navigation actio
|
|
|
1854
1868
|
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.
|
|
1855
1869
|
|
|
1856
1870
|
|
|
1857
|
-
<a id="
|
|
1871
|
+
<a id="org4864882"></a>
|
|
1858
1872
|
|
|
1859
1873
|
#### Input buffer actions
|
|
1860
1874
|
|
|
@@ -1897,7 +1911,7 @@ Terminology notes:
|
|
|
1897
1911
|
| yank\_pop | Yes | Copy next kill ring item and replace prior |
|
|
1898
1912
|
|
|
1899
1913
|
|
|
1900
|
-
<a id="
|
|
1914
|
+
<a id="org15a723a"></a>
|
|
1901
1915
|
|
|
1902
1916
|
#### Input field actions
|
|
1903
1917
|
|
|
@@ -1910,7 +1924,7 @@ Input field actions operate on an editable input field. An input field occurs at
|
|
|
1910
1924
|
| history\_next | No | Insert the next relevant history item in the input field |
|
|
1911
1925
|
|
|
1912
1926
|
|
|
1913
|
-
<a id="
|
|
1927
|
+
<a id="org2de54ae"></a>
|
|
1914
1928
|
|
|
1915
1929
|
#### Shell session actions
|
|
1916
1930
|
|
|
@@ -1931,7 +1945,7 @@ Shell session actions operate at the session level around the main command input
|
|
|
1931
1945
|
| universal\_argument | No | Set the numeric argument to 4 or multiply the current one by 4 |
|
|
1932
1946
|
|
|
1933
1947
|
|
|
1934
|
-
<a id="
|
|
1948
|
+
<a id="orgb787709"></a>
|
|
1935
1949
|
|
|
1936
1950
|
#### Pager actions
|
|
1937
1951
|
|
|
@@ -1953,7 +1967,7 @@ Pager actions navigate output when the output area is in paging mode. They move
|
|
|
1953
1967
|
| quit\_paging | No | Quit paging and return control to the input line |
|
|
1954
1968
|
|
|
1955
1969
|
|
|
1956
|
-
<a id="
|
|
1970
|
+
<a id="orgdaa4dc0"></a>
|
|
1957
1971
|
|
|
1958
1972
|
#### Pager search actions
|
|
1959
1973
|
|
|
@@ -1982,7 +1996,7 @@ While the search session is active, accepting commits the current match and canc
|
|
|
1982
1996
|
| isearch\_cancel | No | Cancel the active incremental search and restore its starting point |
|
|
1983
1997
|
|
|
1984
1998
|
|
|
1985
|
-
<a id="
|
|
1999
|
+
<a id="orgda04712"></a>
|
|
1986
2000
|
|
|
1987
2001
|
#### Popup actions
|
|
1988
2002
|
|
|
@@ -2002,7 +2016,7 @@ Popup actions control selection and narrowing popups such as choose, menu, compl
|
|
|
2002
2016
|
| popup\_toggle\_selected | No | In multi-select, toggle the selection of the current item |
|
|
2003
2017
|
|
|
2004
2018
|
|
|
2005
|
-
<a id="
|
|
2019
|
+
<a id="org0c5eb9b"></a>
|
|
2006
2020
|
|
|
2007
2021
|
#### Prompt popup actions
|
|
2008
2022
|
|
|
@@ -2015,7 +2029,7 @@ Prompt popup actions control prompt dialogs that collect a string from the user.
|
|
|
2015
2029
|
| prompt\_cancel\_if\_empty | No | Cancel only if the input buffer is empty |
|
|
2016
2030
|
|
|
2017
2031
|
|
|
2018
|
-
<a id="
|
|
2032
|
+
<a id="orge030d24"></a>
|
|
2019
2033
|
|
|
2020
2034
|
#### Utility Actions
|
|
2021
2035
|
|
|
@@ -2030,12 +2044,12 @@ Some actions exist to support `Fatty`'s own input machinery and are not normally
|
|
|
2030
2044
|
| paste | str | No | Insert pasted text at point |
|
|
2031
2045
|
|
|
2032
2046
|
|
|
2033
|
-
<a id="
|
|
2047
|
+
<a id="org175d4e2"></a>
|
|
2034
2048
|
|
|
2035
2049
|
## Themes `themes/`
|
|
2036
2050
|
|
|
2037
2051
|
|
|
2038
|
-
<a id="
|
|
2052
|
+
<a id="orge0afc4c"></a>
|
|
2039
2053
|
|
|
2040
2054
|
### Distributed Themes
|
|
2041
2055
|
|
|
@@ -2071,12 +2085,12 @@ Here are the builtin themes:
|
|
|
2071
2085
|
| wordperfect | Nostalgic nod to the good old word processor |
|
|
2072
2086
|
|
|
2073
2087
|
|
|
2074
|
-
<a id="
|
|
2088
|
+
<a id="org4246032"></a>
|
|
2075
2089
|
|
|
2076
2090
|
### Custom Themes
|
|
2077
2091
|
|
|
2078
2092
|
|
|
2079
|
-
<a id="
|
|
2093
|
+
<a id="org0eb5caf"></a>
|
|
2080
2094
|
|
|
2081
2095
|
#### Theme Name
|
|
2082
2096
|
|
|
@@ -2087,7 +2101,7 @@ name: nordic
|
|
|
2087
2101
|
```
|
|
2088
2102
|
|
|
2089
2103
|
|
|
2090
|
-
<a id="
|
|
2104
|
+
<a id="org842a280"></a>
|
|
2091
2105
|
|
|
2092
2106
|
#### Inheritance from Another Theme
|
|
2093
2107
|
|
|
@@ -2104,7 +2118,7 @@ fg: "#eeeeee"
|
|
|
2104
2118
|
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.
|
|
2105
2119
|
|
|
2106
2120
|
|
|
2107
|
-
<a id="
|
|
2121
|
+
<a id="org1195a62"></a>
|
|
2108
2122
|
|
|
2109
2123
|
#### Inheritance within a Theme
|
|
2110
2124
|
|
|
@@ -2124,7 +2138,7 @@ output:
|
|
|
2124
2138
|
This means that the input field will have the same coloring and attributes as the output pane.
|
|
2125
2139
|
|
|
2126
2140
|
|
|
2127
|
-
<a id="
|
|
2141
|
+
<a id="org6ef566f"></a>
|
|
2128
2142
|
|
|
2129
2143
|
#### Theme Roles
|
|
2130
2144
|
|
|
@@ -2171,7 +2185,7 @@ Here is a listing of what roles act as the parent for each of the roles, their p
|
|
|
2171
2185
|
| `markdown_hrule` | Markdown horizontal rules. | `output` |
|
|
2172
2186
|
|
|
2173
2187
|
|
|
2174
|
-
<a id="
|
|
2188
|
+
<a id="orgdb38f78"></a>
|
|
2175
2189
|
|
|
2176
2190
|
#### Role Colors and Attributes and Frame Style
|
|
2177
2191
|
|
|
@@ -2294,11 +2308,11 @@ Each role can have assigned to it a foreground color (`fg:`), a background color
|
|
|
2294
2308
|
```
|
|
2295
2309
|
|
|
2296
2310
|
|
|
2297
|
-
<a id="
|
|
2311
|
+
<a id="orgde2facb"></a>
|
|
2298
2312
|
|
|
2299
2313
|
### The `themer` helper
|
|
2300
2314
|
|
|
2301
|
-
Choosing readable colors for the semantic roles---`good`, `info`, `warn`, and `error
|
|
2315
|
+
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.
|
|
2302
2316
|
|
|
2303
2317
|
For an existing theme, `themer` also reports the contrast of the current role colors and flags those that fall below its target contrast.
|
|
2304
2318
|
|
|
@@ -2364,3 +2378,22 @@ warn:
|
|
|
2364
2378
|
error:
|
|
2365
2379
|
fg: "#e78d8d"
|
|
2366
2380
|
```
|
|
2381
|
+
|
|
2382
|
+
|
|
2383
|
+
<a id="orgf6a8fbb"></a>
|
|
2384
|
+
|
|
2385
|
+
# Windows differences
|
|
2386
|
+
|
|
2387
|
+
All demo commands have been tested on Windows 11 with RubyInstaller 3.4. Compared with Linux, the following differences apply:
|
|
2388
|
+
|
|
2389
|
+
- Windows currently requires a patched curses build for temporarily handing the terminal to external commands and interactive programs. The patch is available at: <https://github.com/ddoherty03/curses/tree/preserve-screen-suspension>
|
|
2390
|
+
|
|
2391
|
+
- Mouse input is unavailable with the Windows curses build tested.
|
|
2392
|
+
|
|
2393
|
+
- Alt is displayed as Meta (`M-`). Windows may intercept some shortcuts before Fatty receives them. Alt+numpad retains Windows character-entry behavior; for example, Alt+keypad-7 produces Ctrl-G, which closes `keytest`. Some hardware-specific keys may be unavailable.
|
|
2394
|
+
|
|
2395
|
+
- Windows intercepts some key chords, including M-TAB, so F2 has been provided as an alternative for popup completions.
|
|
2396
|
+
|
|
2397
|
+
- External commands use Windows command syntax, including `cmd.exe` built-ins such as `dir`, rather than PowerShell aliases. Path completion uses Windows backslash separators.
|
|
2398
|
+
|
|
2399
|
+
- Exiting Fatty does not restore a saved copy of the screen that was visible before startup.
|