fatty 0.99.12.0 → 0.99.12.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/CHANGELOG.org +10 -0
- data/README.md +238 -226
- data/README.org +20 -5
- data/lib/fatty/ansi/windows_console.rb +26 -0
- data/lib/fatty/curses/context.rb +10 -5
- data/lib/fatty/curses/curses_coder.rb +1 -1
- data/lib/fatty/terminal.rb +7 -5
- data/lib/fatty/version.rb +1 -1
- metadata +16 -10
data/README.md
CHANGED
|
@@ -2,125 +2,126 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://github.com/ddoherty03/fatty/actions/workflows/main.yml)
|
|
4
4
|
|
|
5
|
-
Version: 0.99.12.
|
|
5
|
+
Version: 0.99.12.2
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
# Table of Contents
|
|
9
9
|
|
|
10
|
-
1. [Introduction](#
|
|
11
|
-
2. [Quick Start](#
|
|
12
|
-
1. [Installing](#
|
|
13
|
-
2. [Trying it Out with the \`fatty\` Demo](#
|
|
14
|
-
1. [Builtin commands](#
|
|
15
|
-
2. [Screenshots](#
|
|
16
|
-
1. [Command line editing](#
|
|
17
|
-
2. [Searchable Output](#
|
|
18
|
-
3. [Paging Markdown](#
|
|
19
|
-
4. [Popup Selection](#
|
|
20
|
-
3. [Usage](#
|
|
21
|
-
1. [Launching a Fatty Terminal](#
|
|
22
|
-
1. [`on_accept`](#
|
|
23
|
-
1. [Parameters to `on_accept`](#
|
|
24
|
-
2. [The `line` parameter to `on_accept`](#
|
|
25
|
-
3. [The callback parameter to `on_accept`](#
|
|
26
|
-
4. [Output ordering](#
|
|
27
|
-
5. [Long-running callbacks and interruption](#
|
|
28
|
-
6. [ANSI colors in output](#
|
|
29
|
-
2. [Other parameters to `Terminal.new`](#
|
|
30
|
-
2. [The Callback API](#
|
|
31
|
-
1. [`append(text, follow: true, role: nil)`](#
|
|
32
|
-
2. [`append_now(text, follow: true, mode: nil, role: nil)`](#
|
|
33
|
-
3. [`clear_now`](#
|
|
34
|
-
4. [`markdown(text)`](#
|
|
35
|
-
5. [`markdown_now(text)`](#
|
|
36
|
-
6. [`status(text, role: :info)`](#
|
|
37
|
-
7. [`good(text, replace: false, render: true)`](#
|
|
38
|
-
8. [`info(text, replace: false, render: true)`](#
|
|
39
|
-
9. [`warn(text, replace: false, render: true)`](#
|
|
40
|
-
10. [`error(text, replace: false, render: true)`](#
|
|
41
|
-
11. [`oops(text, replace: false, render: true)`](#
|
|
42
|
-
12. [`alert(text, role: :info)`](#
|
|
43
|
-
13. [`prompt(prompt, initial: "", cancel_value: nil, history_key: nil, save_history: true)`](#
|
|
44
|
-
14. [`check_interrupt!`](#
|
|
45
|
-
15. [`add_progress(label:, total: nil, style: :percent, role: :info, width: 40)`](#
|
|
46
|
-
1. [Initialization `add_progress(label:, style: :percent, total: nil, role: :info, width: 40)`](#
|
|
47
|
-
2. [Update `update(current: nil, indicator: nil, render: false)`](#
|
|
48
|
-
3. [Finish](#
|
|
49
|
-
4. [Clear](#
|
|
50
|
-
16. [`choose(prompt, choices:, initial_choice_idx: 0, cancel_value: nil)`](#
|
|
51
|
-
17. [`choose_multi(prompt, choices:, cancel_value: nil)`](#
|
|
52
|
-
18. [`confirm(prompt, yes_label: "Yes", no_label: "No", cancel_value: false)`](#
|
|
53
|
-
19. [`menu(prompt, choices:, initial_choice_idx: 0, cancel_value: nil)`](#
|
|
54
|
-
20. [`suspend(&block)`](#
|
|
55
|
-
21. [`environment`](#
|
|
56
|
-
3. [Terminal Methods](#
|
|
57
|
-
1. [`Teminal#suspend(&block)`](#
|
|
58
|
-
4. [Default Interaction](#
|
|
59
|
-
1. [Parts of the Screen](#
|
|
60
|
-
1. [Input Field](#
|
|
61
|
-
2. [Output Pane](#
|
|
62
|
-
3. [Status Area](#
|
|
63
|
-
4. [Alert Area](#
|
|
64
|
-
2. [Command-line Editing](#
|
|
65
|
-
1. [Input Context](#
|
|
66
|
-
1. [Cursor Motion](#
|
|
67
|
-
2. [Clearing](#
|
|
68
|
-
3. [Undo and Redo](#
|
|
69
|
-
4. [Deletion and Killing](#
|
|
70
|
-
5. [Yanking, Mark, and Region](#
|
|
71
|
-
6. [Count Prefix](#
|
|
72
|
-
7. [History Navigation](#
|
|
73
|
-
8. [Completion](#
|
|
74
|
-
9. [Accept or Cancel](#
|
|
75
|
-
2. [Paging Context](#
|
|
76
|
-
3. [Searching Output](#
|
|
77
|
-
1. [String and Regex Search](#
|
|
78
|
-
2. [Incremental Search](#
|
|
79
|
-
5. [Configuration](#
|
|
80
|
-
1. [General Configuration `config.yml`](#
|
|
81
|
-
1. [`word_char_re`](#
|
|
82
|
-
2. [`esc_delay`](#
|
|
83
|
-
3. [`history`](#
|
|
84
|
-
1. [`file`](#
|
|
85
|
-
2. [`max`](#
|
|
86
|
-
4. [`theme`](#
|
|
87
|
-
5. [`truecolor`](#
|
|
88
|
-
6. [`log`](#
|
|
89
|
-
1. [`file`](#
|
|
90
|
-
2. [`level`](#
|
|
91
|
-
3. [`tags`](#
|
|
92
|
-
2. [Key code definitions `keydefs.yml`](#
|
|
93
|
-
3. [Key bindings `keybindings.yml`](#
|
|
94
|
-
1. [Key Names](#
|
|
95
|
-
1. [Printable Keys](#
|
|
96
|
-
2. [Curses and Fatty Named Keys](#
|
|
97
|
-
3. [Possibly Invisible Keys](#
|
|
98
|
-
4. [Unnamed but Recognized Keys](#
|
|
99
|
-
2. [Mouse Events](#
|
|
100
|
-
3. [Modifiers](#
|
|
101
|
-
4. [Contexts](#
|
|
102
|
-
5. [Actions](#
|
|
103
|
-
1. [Input buffer actions](#
|
|
104
|
-
2. [Input field actions](#
|
|
105
|
-
3. [Shell session actions](#
|
|
106
|
-
4. [Pager actions](#
|
|
107
|
-
5. [Pager search actions](#
|
|
108
|
-
6. [Popup actions](#
|
|
109
|
-
7. [Prompt popup actions](#
|
|
110
|
-
8. [Utility Actions](#
|
|
111
|
-
4. [Themes `themes/`](#
|
|
112
|
-
1. [Distributed Themes](#
|
|
113
|
-
2. [Custom Themes](#
|
|
114
|
-
1. [Theme Name](#
|
|
115
|
-
2. [Inheritance from Another Theme](#
|
|
116
|
-
3. [Inheritance within a Theme](#
|
|
117
|
-
4. [Theme Roles](#
|
|
118
|
-
5. [Role Colors and Attributes and Frame Style](#
|
|
119
|
-
3. [The `themer` helper](#
|
|
120
|
-
6. [Windows differences](#
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
10
|
+
1. [Introduction](#orgb76309e)
|
|
11
|
+
2. [Quick Start](#orge444572)
|
|
12
|
+
1. [Installing](#org47f1ddb)
|
|
13
|
+
2. [Trying it Out with the \`fatty\` Demo](#org67da4ca)
|
|
14
|
+
1. [Builtin commands](#org4e39f0c)
|
|
15
|
+
2. [Screenshots](#orgbe59d63)
|
|
16
|
+
1. [Command line editing](#org2c07690)
|
|
17
|
+
2. [Searchable Output](#org7daa2cd)
|
|
18
|
+
3. [Paging Markdown](#orgeff7ba6)
|
|
19
|
+
4. [Popup Selection](#orgdeefea7)
|
|
20
|
+
3. [Usage](#org2be5229)
|
|
21
|
+
1. [Launching a Fatty Terminal](#org0698234)
|
|
22
|
+
1. [`on_accept`](#orgb2cdbd2)
|
|
23
|
+
1. [Parameters to `on_accept`](#org6f6d82c)
|
|
24
|
+
2. [The `line` parameter to `on_accept`](#orgc515b69)
|
|
25
|
+
3. [The callback parameter to `on_accept`](#org1a08e22)
|
|
26
|
+
4. [Output ordering](#org421e659)
|
|
27
|
+
5. [Long-running callbacks and interruption](#org78d9633)
|
|
28
|
+
6. [ANSI colors in output](#org3cc77fb)
|
|
29
|
+
2. [Other parameters to `Terminal.new`](#orgff19494)
|
|
30
|
+
2. [The Callback API](#org6604149)
|
|
31
|
+
1. [`append(text, follow: true, role: nil)`](#org588aba4)
|
|
32
|
+
2. [`append_now(text, follow: true, mode: nil, role: nil)`](#org86011d7)
|
|
33
|
+
3. [`clear_now`](#orgeda1b12)
|
|
34
|
+
4. [`markdown(text)`](#org6267f45)
|
|
35
|
+
5. [`markdown_now(text)`](#orgf193e25)
|
|
36
|
+
6. [`status(text, role: :info)`](#orgf4caa1d)
|
|
37
|
+
7. [`good(text, replace: false, render: true)`](#org6cf7a05)
|
|
38
|
+
8. [`info(text, replace: false, render: true)`](#org18e0eea)
|
|
39
|
+
9. [`warn(text, replace: false, render: true)`](#org27a4f9a)
|
|
40
|
+
10. [`error(text, replace: false, render: true)`](#org01971fe)
|
|
41
|
+
11. [`oops(text, replace: false, render: true)`](#org2aaae45)
|
|
42
|
+
12. [`alert(text, role: :info)`](#orgf7f0d3b)
|
|
43
|
+
13. [`prompt(prompt, initial: "", cancel_value: nil, history_key: nil, save_history: true)`](#orgdd188a0)
|
|
44
|
+
14. [`check_interrupt!`](#orgae13de8)
|
|
45
|
+
15. [`add_progress(label:, total: nil, style: :percent, role: :info, width: 40)`](#orgf45deaf)
|
|
46
|
+
1. [Initialization `add_progress(label:, style: :percent, total: nil, role: :info, width: 40)`](#org1cc075a)
|
|
47
|
+
2. [Update `update(current: nil, indicator: nil, render: false)`](#org4e70b17)
|
|
48
|
+
3. [Finish](#org40dea6d)
|
|
49
|
+
4. [Clear](#org63f30a3)
|
|
50
|
+
16. [`choose(prompt, choices:, initial_choice_idx: 0, cancel_value: nil)`](#org92f4395)
|
|
51
|
+
17. [`choose_multi(prompt, choices:, cancel_value: nil)`](#org3416926)
|
|
52
|
+
18. [`confirm(prompt, yes_label: "Yes", no_label: "No", cancel_value: false)`](#org1900358)
|
|
53
|
+
19. [`menu(prompt, choices:, initial_choice_idx: 0, cancel_value: nil)`](#org09e4152)
|
|
54
|
+
20. [`suspend(&block)`](#org419471c)
|
|
55
|
+
21. [`environment`](#org27d259c)
|
|
56
|
+
3. [Terminal Methods](#orgc4a4e47)
|
|
57
|
+
1. [`Teminal#suspend(&block)`](#org039bdf8)
|
|
58
|
+
4. [Default Interaction](#org0a68d06)
|
|
59
|
+
1. [Parts of the Screen](#org15c0c8b)
|
|
60
|
+
1. [Input Field](#orgc0e33d7)
|
|
61
|
+
2. [Output Pane](#org8049a3c)
|
|
62
|
+
3. [Status Area](#orge5c7b15)
|
|
63
|
+
4. [Alert Area](#orgdf21777)
|
|
64
|
+
2. [Command-line Editing](#orgc25f1f3)
|
|
65
|
+
1. [Input Context](#orgcbfd169)
|
|
66
|
+
1. [Cursor Motion](#org5eb8653)
|
|
67
|
+
2. [Clearing](#orgbe6be4a)
|
|
68
|
+
3. [Undo and Redo](#orgbc27d60)
|
|
69
|
+
4. [Deletion and Killing](#org3c3b204)
|
|
70
|
+
5. [Yanking, Mark, and Region](#orga2c496c)
|
|
71
|
+
6. [Count Prefix](#org1196a57)
|
|
72
|
+
7. [History Navigation](#org94a7f60)
|
|
73
|
+
8. [Completion](#org0b95a5c)
|
|
74
|
+
9. [Accept or Cancel](#org68947a2)
|
|
75
|
+
2. [Paging Context](#org2e0e2ff)
|
|
76
|
+
3. [Searching Output](#org1449ca3)
|
|
77
|
+
1. [String and Regex Search](#org6c11860)
|
|
78
|
+
2. [Incremental Search](#org7fadf11)
|
|
79
|
+
5. [Configuration](#org1df70eb)
|
|
80
|
+
1. [General Configuration `config.yml`](#org4bc57ab)
|
|
81
|
+
1. [`word_char_re`](#orga7dbf20)
|
|
82
|
+
2. [`esc_delay`](#org91239f0)
|
|
83
|
+
3. [`history`](#orga756f0f)
|
|
84
|
+
1. [`file`](#orgccf7cc3)
|
|
85
|
+
2. [`max`](#orgcdc856c)
|
|
86
|
+
4. [`theme`](#org07f3abe)
|
|
87
|
+
5. [`truecolor`](#org4d88d76)
|
|
88
|
+
6. [`log`](#orgaebebba)
|
|
89
|
+
1. [`file`](#org73031d6)
|
|
90
|
+
2. [`level`](#org2bde7f7)
|
|
91
|
+
3. [`tags`](#orge6e3f35)
|
|
92
|
+
2. [Key code definitions `keydefs.yml`](#org43c3865)
|
|
93
|
+
3. [Key bindings `keybindings.yml`](#orgbafd5a7)
|
|
94
|
+
1. [Key Names](#orgeae574e)
|
|
95
|
+
1. [Printable Keys](#org7eceb90)
|
|
96
|
+
2. [Curses and Fatty Named Keys](#org4aeae18)
|
|
97
|
+
3. [Possibly Invisible Keys](#orgcbe12c6)
|
|
98
|
+
4. [Unnamed but Recognized Keys](#orgcf42b89)
|
|
99
|
+
2. [Mouse Events](#orge870fa8)
|
|
100
|
+
3. [Modifiers](#org20e4a4c)
|
|
101
|
+
4. [Contexts](#orgc65dbd7)
|
|
102
|
+
5. [Actions](#orgd4fef10)
|
|
103
|
+
1. [Input buffer actions](#orgb1a5342)
|
|
104
|
+
2. [Input field actions](#org27d9a87)
|
|
105
|
+
3. [Shell session actions](#org990ef43)
|
|
106
|
+
4. [Pager actions](#org6ced59d)
|
|
107
|
+
5. [Pager search actions](#orga3ad483)
|
|
108
|
+
6. [Popup actions](#org3a59778)
|
|
109
|
+
7. [Prompt popup actions](#org9abbc3d)
|
|
110
|
+
8. [Utility Actions](#org3c5a22f)
|
|
111
|
+
4. [Themes `themes/`](#org8c56eee)
|
|
112
|
+
1. [Distributed Themes](#org1acaa2b)
|
|
113
|
+
2. [Custom Themes](#orgc0a7e6f)
|
|
114
|
+
1. [Theme Name](#orge23e6ef)
|
|
115
|
+
2. [Inheritance from Another Theme](#org294cd34)
|
|
116
|
+
3. [Inheritance within a Theme](#orgbe45631)
|
|
117
|
+
4. [Theme Roles](#org63328ce)
|
|
118
|
+
5. [Role Colors and Attributes and Frame Style](#org56fd868)
|
|
119
|
+
3. [The `themer` helper](#orgbc48f3f)
|
|
120
|
+
6. [Windows differences](#org737d104)
|
|
121
|
+
1. [Curses dependency](#org38c0a61)
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
<a id="orgb76309e"></a>
|
|
124
125
|
|
|
125
126
|
# Introduction
|
|
126
127
|
|
|
@@ -148,12 +149,12 @@ In other words, fatty allows you to write a terminal-based REPL of your choosing
|
|
|
148
149
|
`Fatty` is *not* a terminal emulator but runs on top of one.
|
|
149
150
|
|
|
150
151
|
|
|
151
|
-
<a id="
|
|
152
|
+
<a id="orge444572"></a>
|
|
152
153
|
|
|
153
154
|
# Quick Start
|
|
154
155
|
|
|
155
156
|
|
|
156
|
-
<a id="
|
|
157
|
+
<a id="org47f1ddb"></a>
|
|
157
158
|
|
|
158
159
|
## Installing
|
|
159
160
|
|
|
@@ -164,7 +165,7 @@ $ gem install fatty
|
|
|
164
165
|
```
|
|
165
166
|
|
|
166
167
|
|
|
167
|
-
<a id="
|
|
168
|
+
<a id="org67da4ca"></a>
|
|
168
169
|
|
|
169
170
|
## Trying it Out with the \`fatty\` Demo
|
|
170
171
|
|
|
@@ -173,7 +174,7 @@ Once installed, you can try out `fatty` with the included program called `fatty`
|
|
|
173
174
|
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.
|
|
174
175
|
|
|
175
176
|
|
|
176
|
-
<a id="
|
|
177
|
+
<a id="org4e39f0c"></a>
|
|
177
178
|
|
|
178
179
|
### Builtin commands
|
|
179
180
|
|
|
@@ -207,12 +208,12 @@ Here are the commands builtin to `fatty`
|
|
|
207
208
|
| colors | Display ANSI, 256-color, and X11 color diagnostics |
|
|
208
209
|
|
|
209
210
|
|
|
210
|
-
<a id="
|
|
211
|
+
<a id="orgbe59d63"></a>
|
|
211
212
|
|
|
212
213
|
### Screenshots
|
|
213
214
|
|
|
214
215
|
|
|
215
|
-
<a id="
|
|
216
|
+
<a id="org2c07690"></a>
|
|
216
217
|
|
|
217
218
|
#### Command line editing
|
|
218
219
|
|
|
@@ -221,7 +222,7 @@ Here is the command line, mid-edit showing a region selected and, in dim text to
|
|
|
221
222
|

|
|
222
223
|
|
|
223
224
|
|
|
224
|
-
<a id="
|
|
225
|
+
<a id="org7daa2cd"></a>
|
|
225
226
|
|
|
226
227
|
#### Searchable Output
|
|
227
228
|
|
|
@@ -230,7 +231,7 @@ While paging output, you can search for words, as here the user searches for the
|
|
|
230
231
|

|
|
231
232
|
|
|
232
233
|
|
|
233
|
-
<a id="
|
|
234
|
+
<a id="orgeff7ba6"></a>
|
|
234
235
|
|
|
235
236
|
#### Paging Markdown
|
|
236
237
|
|
|
@@ -239,7 +240,7 @@ The `fatty` demo running the `markdown` command and paging the output. It shows
|
|
|
239
240
|

|
|
240
241
|
|
|
241
242
|
|
|
242
|
-
<a id="
|
|
243
|
+
<a id="orgdeefea7"></a>
|
|
243
244
|
|
|
244
245
|
#### Popup Selection
|
|
245
246
|
|
|
@@ -248,17 +249,17 @@ One of the many "widgets" available through `fatty` is the ability to present th
|
|
|
248
249
|

|
|
249
250
|
|
|
250
251
|
|
|
251
|
-
<a id="
|
|
252
|
+
<a id="org2be5229"></a>
|
|
252
253
|
|
|
253
254
|
# Usage
|
|
254
255
|
|
|
255
256
|
|
|
256
|
-
<a id="
|
|
257
|
+
<a id="org0698234"></a>
|
|
257
258
|
|
|
258
259
|
## Launching a Fatty Terminal
|
|
259
260
|
|
|
260
261
|
|
|
261
|
-
<a id="
|
|
262
|
+
<a id="orgb2cdbd2"></a>
|
|
262
263
|
|
|
263
264
|
### `on_accept`
|
|
264
265
|
|
|
@@ -291,14 +292,14 @@ When a `fatty` application runs, `fatty` installs a few files if they do not exi
|
|
|
291
292
|
- `themes`, a directory of pre-defined theme definitions that you can choose from and add to by adding your own themes.
|
|
292
293
|
|
|
293
294
|
|
|
294
|
-
<a id="
|
|
295
|
+
<a id="org6f6d82c"></a>
|
|
295
296
|
|
|
296
297
|
#### Parameters to `on_accept`
|
|
297
298
|
|
|
298
299
|
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`.
|
|
299
300
|
|
|
300
301
|
|
|
301
|
-
<a id="
|
|
302
|
+
<a id="orgc515b69"></a>
|
|
302
303
|
|
|
303
304
|
#### The `line` parameter to `on_accept`
|
|
304
305
|
|
|
@@ -339,7 +340,7 @@ Fatty::Terminal.new(
|
|
|
339
340
|
```
|
|
340
341
|
|
|
341
342
|
|
|
342
|
-
<a id="
|
|
343
|
+
<a id="org1a08e22"></a>
|
|
343
344
|
|
|
344
345
|
#### The callback parameter to `on_accept`
|
|
345
346
|
|
|
@@ -364,7 +365,7 @@ Fatty::Terminal.new(
|
|
|
364
365
|
The callback parameter responds to several methods that allow your application to interact with the user. They are documented below.
|
|
365
366
|
|
|
366
367
|
|
|
367
|
-
<a id="
|
|
368
|
+
<a id="org421e659"></a>
|
|
368
369
|
|
|
369
370
|
#### Output ordering
|
|
370
371
|
|
|
@@ -389,7 +390,7 @@ Calls to `append_now` and `markdown_now` are different. They append text and imm
|
|
|
389
390
|
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.
|
|
390
391
|
|
|
391
392
|
|
|
392
|
-
<a id="
|
|
393
|
+
<a id="org78d9633"></a>
|
|
393
394
|
|
|
394
395
|
#### Long-running callbacks and interruption
|
|
395
396
|
|
|
@@ -428,14 +429,14 @@ end
|
|
|
428
429
|
```
|
|
429
430
|
|
|
430
431
|
|
|
431
|
-
<a id="
|
|
432
|
+
<a id="org3cc77fb"></a>
|
|
432
433
|
|
|
433
434
|
#### ANSI colors in output
|
|
434
435
|
|
|
435
436
|
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.
|
|
436
437
|
|
|
437
438
|
|
|
438
|
-
<a id="
|
|
439
|
+
<a id="orgff19494"></a>
|
|
439
440
|
|
|
440
441
|
### Other parameters to `Terminal.new`
|
|
441
442
|
|
|
@@ -462,14 +463,14 @@ Fatty::Terminal.new(
|
|
|
462
463
|
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.
|
|
463
464
|
|
|
464
465
|
|
|
465
|
-
<a id="
|
|
466
|
+
<a id="org6604149"></a>
|
|
466
467
|
|
|
467
468
|
## The Callback API
|
|
468
469
|
|
|
469
470
|
Here are the details on the messages that you can send to the callback parameter to the `on_accept` proc.
|
|
470
471
|
|
|
471
472
|
|
|
472
|
-
<a id="
|
|
473
|
+
<a id="org588aba4"></a>
|
|
473
474
|
|
|
474
475
|
### `append(text, follow: true, role: nil)`
|
|
475
476
|
|
|
@@ -478,7 +479,7 @@ Add the given text to the output pane. After a full page of output is produced,
|
|
|
478
479
|
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.
|
|
479
480
|
|
|
480
481
|
|
|
481
|
-
<a id="
|
|
482
|
+
<a id="org86011d7"></a>
|
|
482
483
|
|
|
483
484
|
### `append_now(text, follow: true, mode: nil, role: nil)`
|
|
484
485
|
|
|
@@ -489,14 +490,14 @@ Setting the mode to `:scrolling` or `:paging` determines whether the output is s
|
|
|
489
490
|
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.
|
|
490
491
|
|
|
491
492
|
|
|
492
|
-
<a id="
|
|
493
|
+
<a id="orgeda1b12"></a>
|
|
493
494
|
|
|
494
495
|
### `clear_now`
|
|
495
496
|
|
|
496
497
|
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`.
|
|
497
498
|
|
|
498
499
|
|
|
499
|
-
<a id="
|
|
500
|
+
<a id="org6267f45"></a>
|
|
500
501
|
|
|
501
502
|
### `markdown(text)`
|
|
502
503
|
|
|
@@ -516,14 +517,14 @@ and this should appear on the next line.
|
|
|
516
517
|
```
|
|
517
518
|
|
|
518
519
|
|
|
519
|
-
<a id="
|
|
520
|
+
<a id="orgf193e25"></a>
|
|
520
521
|
|
|
521
522
|
### `markdown_now(text)`
|
|
522
523
|
|
|
523
524
|
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
|
|
|
525
526
|
|
|
526
|
-
<a id="
|
|
527
|
+
<a id="orgf4caa1d"></a>
|
|
527
528
|
|
|
528
529
|
### `status(text, role: :info)`
|
|
529
530
|
|
|
@@ -535,49 +536,49 @@ Display the text in the "status" area, the lines immediately above the input fie
|
|
|
535
536
|
- **:error:** colored something to suggest danger, usually some tone of red.
|
|
536
537
|
|
|
537
538
|
|
|
538
|
-
<a id="
|
|
539
|
+
<a id="org6cf7a05"></a>
|
|
539
540
|
|
|
540
541
|
### `good(text, replace: false, render: true)`
|
|
541
542
|
|
|
542
543
|
Display the text in the status area with the role :good.
|
|
543
544
|
|
|
544
545
|
|
|
545
|
-
<a id="
|
|
546
|
+
<a id="org18e0eea"></a>
|
|
546
547
|
|
|
547
548
|
### `info(text, replace: false, render: true)`
|
|
548
549
|
|
|
549
550
|
Display the text in the status area with the role :info.
|
|
550
551
|
|
|
551
552
|
|
|
552
|
-
<a id="
|
|
553
|
+
<a id="org27a4f9a"></a>
|
|
553
554
|
|
|
554
555
|
### `warn(text, replace: false, render: true)`
|
|
555
556
|
|
|
556
557
|
Display the text in the status area with the role :warn.
|
|
557
558
|
|
|
558
559
|
|
|
559
|
-
<a id="
|
|
560
|
+
<a id="org01971fe"></a>
|
|
560
561
|
|
|
561
562
|
### `error(text, replace: false, render: true)`
|
|
562
563
|
|
|
563
564
|
Display the text in the status area with the role :error.
|
|
564
565
|
|
|
565
566
|
|
|
566
|
-
<a id="
|
|
567
|
+
<a id="org2aaae45"></a>
|
|
567
568
|
|
|
568
569
|
### `oops(text, replace: false, render: true)`
|
|
569
570
|
|
|
570
571
|
An alias for `error(text)`
|
|
571
572
|
|
|
572
573
|
|
|
573
|
-
<a id="
|
|
574
|
+
<a id="orgf7f0d3b"></a>
|
|
574
575
|
|
|
575
576
|
### `alert(text, role: :info)`
|
|
576
577
|
|
|
577
578
|
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.
|
|
578
579
|
|
|
579
580
|
|
|
580
|
-
<a id="
|
|
581
|
+
<a id="orgdd188a0"></a>
|
|
581
582
|
|
|
582
583
|
### `prompt(prompt, initial: "", cancel_value: nil, history_key: nil, save_history: true)`
|
|
583
584
|
|
|
@@ -607,7 +608,7 @@ The `prompt` input has its own history facility separate from the history in the
|
|
|
607
608
|
`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`.
|
|
608
609
|
|
|
609
610
|
|
|
610
|
-
<a id="
|
|
611
|
+
<a id="orgae13de8"></a>
|
|
611
612
|
|
|
612
613
|
### `check_interrupt!`
|
|
613
614
|
|
|
@@ -618,7 +619,7 @@ The polling is throttled, so `check_interrupt!` may be called frequently. It sho
|
|
|
618
619
|
Fatty catches `Fatty::Interrupt` at the callback boundary, finishes the current command, restores the terminal state, and resumes the normal input loop.
|
|
619
620
|
|
|
620
621
|
|
|
621
|
-
<a id="
|
|
622
|
+
<a id="orgf45deaf"></a>
|
|
622
623
|
|
|
623
624
|
### `add_progress(label:, total: nil, style: :percent, role: :info, width: 40)`
|
|
624
625
|
|
|
@@ -634,7 +635,7 @@ Display a progress widget in the status area to show the user that the system is
|
|
|
634
635
|
- **:trail:** display an "indicator" on each call of `update(indicator: <string>)`
|
|
635
636
|
|
|
636
637
|
|
|
637
|
-
<a id="
|
|
638
|
+
<a id="org1cc075a"></a>
|
|
638
639
|
|
|
639
640
|
#### Initialization `add_progress(label:, style: :percent, total: nil, role: :info, width: 40)`
|
|
640
641
|
|
|
@@ -645,7 +646,7 @@ Display a progress widget in the status area to show the user that the system is
|
|
|
645
646
|
- **`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.
|
|
646
647
|
|
|
647
648
|
|
|
648
|
-
<a id="
|
|
649
|
+
<a id="org4e70b17"></a>
|
|
649
650
|
|
|
650
651
|
#### Update `update(current: nil, indicator: nil, render: false)`
|
|
651
652
|
|
|
@@ -751,21 +752,21 @@ Fatty::Terminal.new(
|
|
|
751
752
|
```
|
|
752
753
|
|
|
753
754
|
|
|
754
|
-
<a id="
|
|
755
|
+
<a id="org40dea6d"></a>
|
|
755
756
|
|
|
756
757
|
#### Finish
|
|
757
758
|
|
|
758
759
|
As the prior examples illustrate, you can issue an ending message at the end of the process by calling `#finish` on the Progress object.
|
|
759
760
|
|
|
760
761
|
|
|
761
|
-
<a id="
|
|
762
|
+
<a id="org63f30a3"></a>
|
|
762
763
|
|
|
763
764
|
#### Clear
|
|
764
765
|
|
|
765
766
|
And, if you have occasion, you can clear the Progress by calling `#clear` on the Progress object.
|
|
766
767
|
|
|
767
768
|
|
|
768
|
-
<a id="
|
|
769
|
+
<a id="org92f4395"></a>
|
|
769
770
|
|
|
770
771
|
### `choose(prompt, choices:, initial_choice_idx: 0, cancel_value: nil)`
|
|
771
772
|
|
|
@@ -831,7 +832,7 @@ Fatty::Terminal.new(
|
|
|
831
832
|
```
|
|
832
833
|
|
|
833
834
|
|
|
834
|
-
<a id="
|
|
835
|
+
<a id="org3416926"></a>
|
|
835
836
|
|
|
836
837
|
### `choose_multi(prompt, choices:, cancel_value: nil)`
|
|
837
838
|
|
|
@@ -849,7 +850,7 @@ Present a set of `choices:`, which can either be
|
|
|
849
850
|
The `prompt` String (by default "Choose Many") can guide the user about the purpose of the choices.
|
|
850
851
|
|
|
851
852
|
|
|
852
|
-
<a id="
|
|
853
|
+
<a id="org1900358"></a>
|
|
853
854
|
|
|
854
855
|
### `confirm(prompt, yes_label: "Yes", no_label: "No", cancel_value: false)`
|
|
855
856
|
|
|
@@ -860,7 +861,7 @@ Present the user with a simple Yes/No choice using your choice of ways to expres
|
|
|
860
861
|
`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.
|
|
861
862
|
|
|
862
863
|
|
|
863
|
-
<a id="
|
|
864
|
+
<a id="org09e4152"></a>
|
|
864
865
|
|
|
865
866
|
### `menu(prompt, choices:, initial_choice_idx: 0, cancel_value: nil)`
|
|
866
867
|
|
|
@@ -907,7 +908,7 @@ If you want to set one of the choices as the initial choice, set `initial_choice
|
|
|
907
908
|
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.
|
|
908
909
|
|
|
909
910
|
|
|
910
|
-
<a id="
|
|
911
|
+
<a id="org419471c"></a>
|
|
911
912
|
|
|
912
913
|
### `suspend(&block)`
|
|
913
914
|
|
|
@@ -924,7 +925,7 @@ end
|
|
|
924
925
|
The value of the block is returned by `suspend`. Terminal state is restored even if the block exits by raising an exception.
|
|
925
926
|
|
|
926
927
|
|
|
927
|
-
<a id="
|
|
928
|
+
<a id="org27d259c"></a>
|
|
928
929
|
|
|
929
930
|
### `environment`
|
|
930
931
|
|
|
@@ -961,57 +962,57 @@ The environment report also includes a nested `:curses` hash:
|
|
|
961
962
|
| `:can_change_color` | Whether curses can redefine color values |
|
|
962
963
|
|
|
963
964
|
|
|
964
|
-
<a id="
|
|
965
|
+
<a id="orgc4a4e47"></a>
|
|
965
966
|
|
|
966
967
|
## Terminal Methods
|
|
967
968
|
|
|
968
969
|
|
|
969
|
-
<a id="
|
|
970
|
+
<a id="org039bdf8"></a>
|
|
970
971
|
|
|
971
972
|
### `Teminal#suspend(&block)`
|
|
972
973
|
|
|
973
974
|
Return control to the launching terminal, execute the given block, and return.
|
|
974
975
|
|
|
975
976
|
|
|
976
|
-
<a id="
|
|
977
|
+
<a id="org0a68d06"></a>
|
|
977
978
|
|
|
978
979
|
# Default Interaction
|
|
979
980
|
|
|
980
981
|
|
|
981
|
-
<a id="
|
|
982
|
+
<a id="org15c0c8b"></a>
|
|
982
983
|
|
|
983
984
|
## Parts of the Screen
|
|
984
985
|
|
|
985
986
|
|
|
986
|
-
<a id="
|
|
987
|
+
<a id="orgc0e33d7"></a>
|
|
987
988
|
|
|
988
989
|
### Input Field
|
|
989
990
|
|
|
990
991
|
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.
|
|
991
992
|
|
|
992
993
|
|
|
993
|
-
<a id="
|
|
994
|
+
<a id="org8049a3c"></a>
|
|
994
995
|
|
|
995
996
|
### Output Pane
|
|
996
997
|
|
|
997
998
|
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.
|
|
998
999
|
|
|
999
1000
|
|
|
1000
|
-
<a id="
|
|
1001
|
+
<a id="orge5c7b15"></a>
|
|
1001
1002
|
|
|
1002
1003
|
### Status Area
|
|
1003
1004
|
|
|
1004
1005
|
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.
|
|
1005
1006
|
|
|
1006
1007
|
|
|
1007
|
-
<a id="
|
|
1008
|
+
<a id="orgdf21777"></a>
|
|
1008
1009
|
|
|
1009
1010
|
### Alert Area
|
|
1010
1011
|
|
|
1011
1012
|
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.
|
|
1012
1013
|
|
|
1013
1014
|
|
|
1014
|
-
<a id="
|
|
1015
|
+
<a id="orgc25f1f3"></a>
|
|
1015
1016
|
|
|
1016
1017
|
## Command-line Editing
|
|
1017
1018
|
|
|
@@ -1020,14 +1021,14 @@ Press `M-?` (Alt-?, or Escape followed by ?) to browse the current keybindings,
|
|
|
1020
1021
|
`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.
|
|
1021
1022
|
|
|
1022
1023
|
|
|
1023
|
-
<a id="
|
|
1024
|
+
<a id="orgcbfd169"></a>
|
|
1024
1025
|
|
|
1025
1026
|
### Input Context
|
|
1026
1027
|
|
|
1027
1028
|
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.
|
|
1028
1029
|
|
|
1029
1030
|
|
|
1030
|
-
<a id="
|
|
1031
|
+
<a id="org5eb8653"></a>
|
|
1031
1032
|
|
|
1032
1033
|
#### Cursor Motion
|
|
1033
1034
|
|
|
@@ -1051,7 +1052,7 @@ When editing the input line or text input for widgets like the \`prompt\`, \`fat
|
|
|
1051
1052
|
| C-:left | move cursor left one word |
|
|
1052
1053
|
|
|
1053
1054
|
|
|
1054
|
-
<a id="
|
|
1055
|
+
<a id="orgbe6be4a"></a>
|
|
1055
1056
|
|
|
1056
1057
|
#### Clearing
|
|
1057
1058
|
|
|
@@ -1062,7 +1063,7 @@ This is one action that does not affect the input buffer but the output pane. It
|
|
|
1062
1063
|
| C-l | clear the output pane |
|
|
1063
1064
|
|
|
1064
1065
|
|
|
1065
|
-
<a id="
|
|
1066
|
+
<a id="orgbc27d60"></a>
|
|
1066
1067
|
|
|
1067
1068
|
#### Undo and Redo
|
|
1068
1069
|
|
|
@@ -1076,7 +1077,7 @@ This is one action that does not affect the input buffer but the output pane. It
|
|
|
1076
1077
|
| M-/ | redo |
|
|
1077
1078
|
|
|
1078
1079
|
|
|
1079
|
-
<a id="
|
|
1080
|
+
<a id="org3c3b204"></a>
|
|
1080
1081
|
|
|
1081
1082
|
#### Deletion and Killing
|
|
1082
1083
|
|
|
@@ -1096,7 +1097,7 @@ When the region is active, destructive editing commands kill the region rather t
|
|
|
1096
1097
|
| M-t | transpose words |
|
|
1097
1098
|
|
|
1098
1099
|
|
|
1099
|
-
<a id="
|
|
1100
|
+
<a id="orga2c496c"></a>
|
|
1100
1101
|
|
|
1101
1102
|
#### Yanking, Mark, and Region
|
|
1102
1103
|
|
|
@@ -1124,7 +1125,7 @@ Notice that commands that normally delete characters or words, kill the region i
|
|
|
1124
1125
|
| M-w | copy the region |
|
|
1125
1126
|
|
|
1126
1127
|
|
|
1127
|
-
<a id="
|
|
1128
|
+
<a id="org1196a57"></a>
|
|
1128
1129
|
|
|
1129
1130
|
#### Count Prefix
|
|
1130
1131
|
|
|
@@ -1140,7 +1141,7 @@ Fatty follows the emacs convention of making `C-u` multiply the count prefix by
|
|
|
1140
1141
|
| M-<digit> | accumulate a count argument |
|
|
1141
1142
|
|
|
1142
1143
|
|
|
1143
|
-
<a id="
|
|
1144
|
+
<a id="org94a7f60"></a>
|
|
1144
1145
|
|
|
1145
1146
|
#### History Navigation
|
|
1146
1147
|
|
|
@@ -1163,7 +1164,7 @@ You can navigate history items with the `up` and `down` keys as you would expect
|
|
|
1163
1164
|
| C-r | search the history in a popup |
|
|
1164
1165
|
|
|
1165
1166
|
|
|
1166
|
-
<a id="
|
|
1167
|
+
<a id="org0b95a5c"></a>
|
|
1167
1168
|
|
|
1168
1169
|
#### Completion
|
|
1169
1170
|
|
|
@@ -1209,7 +1210,7 @@ You can navigate history items with the `up` and `down` keys as you would expect
|
|
|
1209
1210
|
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.
|
|
1210
1211
|
|
|
1211
1212
|
|
|
1212
|
-
<a id="
|
|
1213
|
+
<a id="org68947a2"></a>
|
|
1213
1214
|
|
|
1214
1215
|
#### Accept or Cancel
|
|
1215
1216
|
|
|
@@ -1225,7 +1226,7 @@ You can end a `fatty` session with `C-c` at the command line, or (only if the bu
|
|
|
1225
1226
|
| C-d | quit \`fatty\` only if the input line is empty |
|
|
1226
1227
|
|
|
1227
1228
|
|
|
1228
|
-
<a id="
|
|
1229
|
+
<a id="org2e0e2ff"></a>
|
|
1229
1230
|
|
|
1230
1231
|
### Paging Context
|
|
1231
1232
|
|
|
@@ -1282,7 +1283,7 @@ You can add line numbers to the display while paging by using the `=` key.
|
|
|
1282
1283
|
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 `>`.
|
|
1283
1284
|
|
|
1284
1285
|
|
|
1285
|
-
<a id="
|
|
1286
|
+
<a id="org1449ca3"></a>
|
|
1286
1287
|
|
|
1287
1288
|
### Searching Output
|
|
1288
1289
|
|
|
@@ -1291,21 +1292,21 @@ While paging, you can initiate a search of the output as indicated in the above
|
|
|
1291
1292
|
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.
|
|
1292
1293
|
|
|
1293
1294
|
|
|
1294
|
-
<a id="
|
|
1295
|
+
<a id="org6c11860"></a>
|
|
1295
1296
|
|
|
1296
1297
|
#### String and Regex Search
|
|
1297
1298
|
|
|
1298
1299
|
`/` 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`.
|
|
1299
1300
|
|
|
1300
1301
|
|
|
1301
|
-
<a id="
|
|
1302
|
+
<a id="org7fadf11"></a>
|
|
1302
1303
|
|
|
1303
1304
|
#### Incremental Search
|
|
1304
1305
|
|
|
1305
1306
|
`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.
|
|
1306
1307
|
|
|
1307
1308
|
|
|
1308
|
-
<a id="
|
|
1309
|
+
<a id="org1df70eb"></a>
|
|
1309
1310
|
|
|
1310
1311
|
# Configuration
|
|
1311
1312
|
|
|
@@ -1323,7 +1324,7 @@ The default user-specific configuration directory follows `XDG_CONFIG_HOME` if i
|
|
|
1323
1324
|
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.
|
|
1324
1325
|
|
|
1325
1326
|
|
|
1326
|
-
<a id="
|
|
1327
|
+
<a id="org4bc57ab"></a>
|
|
1327
1328
|
|
|
1328
1329
|
## General Configuration `config.yml`
|
|
1329
1330
|
|
|
@@ -1346,7 +1347,7 @@ truecolor: auto
|
|
|
1346
1347
|
```
|
|
1347
1348
|
|
|
1348
1349
|
|
|
1349
|
-
<a id="
|
|
1350
|
+
<a id="orga7dbf20"></a>
|
|
1350
1351
|
|
|
1351
1352
|
### `word_char_re`
|
|
1352
1353
|
|
|
@@ -1369,7 +1370,7 @@ word_char_re: "[[:alnum:]_.:-]"
|
|
|
1369
1370
|
```
|
|
1370
1371
|
|
|
1371
1372
|
|
|
1372
|
-
<a id="
|
|
1373
|
+
<a id="org91239f0"></a>
|
|
1373
1374
|
|
|
1374
1375
|
### `esc_delay`
|
|
1375
1376
|
|
|
@@ -1380,26 +1381,26 @@ esc_delay: 0
|
|
|
1380
1381
|
```
|
|
1381
1382
|
|
|
1382
1383
|
|
|
1383
|
-
<a id="
|
|
1384
|
+
<a id="orga756f0f"></a>
|
|
1384
1385
|
|
|
1385
1386
|
### `history`
|
|
1386
1387
|
|
|
1387
1388
|
|
|
1388
|
-
<a id="
|
|
1389
|
+
<a id="orgccf7cc3"></a>
|
|
1389
1390
|
|
|
1390
1391
|
#### `file`
|
|
1391
1392
|
|
|
1392
1393
|
The path to the history file to use, by default `~/.fatty_history`
|
|
1393
1394
|
|
|
1394
1395
|
|
|
1395
|
-
<a id="
|
|
1396
|
+
<a id="orgcdc856c"></a>
|
|
1396
1397
|
|
|
1397
1398
|
#### `max`
|
|
1398
1399
|
|
|
1399
1400
|
The maximum number of lines of history retained, by default 10,000.
|
|
1400
1401
|
|
|
1401
1402
|
|
|
1402
|
-
<a id="
|
|
1403
|
+
<a id="org07f3abe"></a>
|
|
1403
1404
|
|
|
1404
1405
|
### `theme`
|
|
1405
1406
|
|
|
@@ -1410,7 +1411,7 @@ theme: nordic
|
|
|
1410
1411
|
```
|
|
1411
1412
|
|
|
1412
1413
|
|
|
1413
|
-
<a id="
|
|
1414
|
+
<a id="org4d88d76"></a>
|
|
1414
1415
|
|
|
1415
1416
|
### `truecolor`
|
|
1416
1417
|
|
|
@@ -1421,7 +1422,7 @@ truecolor: auto
|
|
|
1421
1422
|
```
|
|
1422
1423
|
|
|
1423
1424
|
|
|
1424
|
-
<a id="
|
|
1425
|
+
<a id="orgaebebba"></a>
|
|
1425
1426
|
|
|
1426
1427
|
### `log`
|
|
1427
1428
|
|
|
@@ -1443,14 +1444,14 @@ tags:
|
|
|
1443
1444
|
```
|
|
1444
1445
|
|
|
1445
1446
|
|
|
1446
|
-
<a id="
|
|
1447
|
+
<a id="org73031d6"></a>
|
|
1447
1448
|
|
|
1448
1449
|
#### `file`
|
|
1449
1450
|
|
|
1450
1451
|
The path to the log file to use.
|
|
1451
1452
|
|
|
1452
1453
|
|
|
1453
|
-
<a id="
|
|
1454
|
+
<a id="org2bde7f7"></a>
|
|
1454
1455
|
|
|
1455
1456
|
#### `level`
|
|
1456
1457
|
|
|
@@ -1462,7 +1463,7 @@ Can be one of the following
|
|
|
1462
1463
|
- **`debug`:** detailed messages to assist debugging `fatty` plus all of the above.
|
|
1463
1464
|
|
|
1464
1465
|
|
|
1465
|
-
<a id="
|
|
1466
|
+
<a id="orge6e3f35"></a>
|
|
1466
1467
|
|
|
1467
1468
|
#### `tags`
|
|
1468
1469
|
|
|
@@ -1480,7 +1481,7 @@ tags:
|
|
|
1480
1481
|
```
|
|
1481
1482
|
|
|
1482
1483
|
|
|
1483
|
-
<a id="
|
|
1484
|
+
<a id="org43c3865"></a>
|
|
1484
1485
|
|
|
1485
1486
|
## Key code definitions `keydefs.yml`
|
|
1486
1487
|
|
|
@@ -1642,7 +1643,7 @@ konsole:
|
|
|
1642
1643
|
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`!).
|
|
1643
1644
|
|
|
1644
1645
|
|
|
1645
|
-
<a id="
|
|
1646
|
+
<a id="orgbafd5a7"></a>
|
|
1646
1647
|
|
|
1647
1648
|
## Key bindings `keybindings.yml`
|
|
1648
1649
|
|
|
@@ -1669,7 +1670,7 @@ A keybinding names a key chord, the context in which it applies, and the Fatty a
|
|
|
1669
1670
|
```
|
|
1670
1671
|
|
|
1671
1672
|
|
|
1672
|
-
<a id="
|
|
1673
|
+
<a id="orgeae574e"></a>
|
|
1673
1674
|
|
|
1674
1675
|
### Key Names
|
|
1675
1676
|
|
|
@@ -1683,7 +1684,7 @@ A keybinding uses the unmodified key name under the `key` field:
|
|
|
1683
1684
|
```
|
|
1684
1685
|
|
|
1685
1686
|
|
|
1686
|
-
<a id="
|
|
1687
|
+
<a id="org7eceb90"></a>
|
|
1687
1688
|
|
|
1688
1689
|
#### Printable Keys
|
|
1689
1690
|
|
|
@@ -1699,7 +1700,7 @@ Most printable keys can be written as the character itself. Quote keys that YAML
|
|
|
1699
1700
|
```
|
|
1700
1701
|
|
|
1701
1702
|
|
|
1702
|
-
<a id="
|
|
1703
|
+
<a id="org4aeae18"></a>
|
|
1703
1704
|
|
|
1704
1705
|
#### Curses and Fatty Named Keys
|
|
1705
1706
|
|
|
@@ -1724,7 +1725,7 @@ Some terminals can report application-keypad sequences such as `keypad_divide`,
|
|
|
1724
1725
|
- `space`
|
|
1725
1726
|
|
|
1726
1727
|
|
|
1727
|
-
<a id="
|
|
1728
|
+
<a id="orgcbe12c6"></a>
|
|
1728
1729
|
|
|
1729
1730
|
#### Possibly Invisible Keys
|
|
1730
1731
|
|
|
@@ -1733,7 +1734,7 @@ Some physical keys may never reach Fatty at all. They may be handled by the keyb
|
|
|
1733
1734
|
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.
|
|
1734
1735
|
|
|
1735
1736
|
|
|
1736
|
-
<a id="
|
|
1737
|
+
<a id="orgcf42b89"></a>
|
|
1737
1738
|
|
|
1738
1739
|
#### Unnamed but Recognized Keys
|
|
1739
1740
|
|
|
@@ -1758,7 +1759,7 @@ Then bind it in `keybindings.yml`:
|
|
|
1758
1759
|
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`.
|
|
1759
1760
|
|
|
1760
1761
|
|
|
1761
|
-
<a id="
|
|
1762
|
+
<a id="orge870fa8"></a>
|
|
1762
1763
|
|
|
1763
1764
|
### Mouse Events
|
|
1764
1765
|
|
|
@@ -1793,7 +1794,7 @@ scroll_down
|
|
|
1793
1794
|
```
|
|
1794
1795
|
|
|
1795
1796
|
|
|
1796
|
-
<a id="
|
|
1797
|
+
<a id="org20e4a4c"></a>
|
|
1797
1798
|
|
|
1798
1799
|
### Modifiers
|
|
1799
1800
|
|
|
@@ -1806,7 +1807,7 @@ shift: true
|
|
|
1806
1807
|
```
|
|
1807
1808
|
|
|
1808
1809
|
|
|
1809
|
-
<a id="
|
|
1810
|
+
<a id="orgc65dbd7"></a>
|
|
1810
1811
|
|
|
1811
1812
|
### Contexts
|
|
1812
1813
|
|
|
@@ -1840,7 +1841,7 @@ The available contexts are:
|
|
|
1840
1841
|
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.
|
|
1841
1842
|
|
|
1842
1843
|
|
|
1843
|
-
<a id="
|
|
1844
|
+
<a id="orgd4fef10"></a>
|
|
1844
1845
|
|
|
1845
1846
|
### Actions
|
|
1846
1847
|
|
|
@@ -1868,7 +1869,7 @@ Most movement, deletion, history, completion, paging, and popup-navigation actio
|
|
|
1868
1869
|
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.
|
|
1869
1870
|
|
|
1870
1871
|
|
|
1871
|
-
<a id="
|
|
1872
|
+
<a id="orgb1a5342"></a>
|
|
1872
1873
|
|
|
1873
1874
|
#### Input buffer actions
|
|
1874
1875
|
|
|
@@ -1911,7 +1912,7 @@ Terminology notes:
|
|
|
1911
1912
|
| yank\_pop | Yes | Copy next kill ring item and replace prior |
|
|
1912
1913
|
|
|
1913
1914
|
|
|
1914
|
-
<a id="
|
|
1915
|
+
<a id="org27d9a87"></a>
|
|
1915
1916
|
|
|
1916
1917
|
#### Input field actions
|
|
1917
1918
|
|
|
@@ -1924,7 +1925,7 @@ Input field actions operate on an editable input field. An input field occurs at
|
|
|
1924
1925
|
| history\_next | No | Insert the next relevant history item in the input field |
|
|
1925
1926
|
|
|
1926
1927
|
|
|
1927
|
-
<a id="
|
|
1928
|
+
<a id="org990ef43"></a>
|
|
1928
1929
|
|
|
1929
1930
|
#### Shell session actions
|
|
1930
1931
|
|
|
@@ -1945,7 +1946,7 @@ Shell session actions operate at the session level around the main command input
|
|
|
1945
1946
|
| universal\_argument | No | Set the numeric argument to 4 or multiply the current one by 4 |
|
|
1946
1947
|
|
|
1947
1948
|
|
|
1948
|
-
<a id="
|
|
1949
|
+
<a id="org6ced59d"></a>
|
|
1949
1950
|
|
|
1950
1951
|
#### Pager actions
|
|
1951
1952
|
|
|
@@ -1967,7 +1968,7 @@ Pager actions navigate output when the output area is in paging mode. They move
|
|
|
1967
1968
|
| quit\_paging | No | Quit paging and return control to the input line |
|
|
1968
1969
|
|
|
1969
1970
|
|
|
1970
|
-
<a id="
|
|
1971
|
+
<a id="orga3ad483"></a>
|
|
1971
1972
|
|
|
1972
1973
|
#### Pager search actions
|
|
1973
1974
|
|
|
@@ -1996,7 +1997,7 @@ While the search session is active, accepting commits the current match and canc
|
|
|
1996
1997
|
| isearch\_cancel | No | Cancel the active incremental search and restore its starting point |
|
|
1997
1998
|
|
|
1998
1999
|
|
|
1999
|
-
<a id="
|
|
2000
|
+
<a id="org3a59778"></a>
|
|
2000
2001
|
|
|
2001
2002
|
#### Popup actions
|
|
2002
2003
|
|
|
@@ -2016,7 +2017,7 @@ Popup actions control selection and narrowing popups such as choose, menu, compl
|
|
|
2016
2017
|
| popup\_toggle\_selected | No | In multi-select, toggle the selection of the current item |
|
|
2017
2018
|
|
|
2018
2019
|
|
|
2019
|
-
<a id="
|
|
2020
|
+
<a id="org9abbc3d"></a>
|
|
2020
2021
|
|
|
2021
2022
|
#### Prompt popup actions
|
|
2022
2023
|
|
|
@@ -2029,7 +2030,7 @@ Prompt popup actions control prompt dialogs that collect a string from the user.
|
|
|
2029
2030
|
| prompt\_cancel\_if\_empty | No | Cancel only if the input buffer is empty |
|
|
2030
2031
|
|
|
2031
2032
|
|
|
2032
|
-
<a id="
|
|
2033
|
+
<a id="org3c5a22f"></a>
|
|
2033
2034
|
|
|
2034
2035
|
#### Utility Actions
|
|
2035
2036
|
|
|
@@ -2044,12 +2045,12 @@ Some actions exist to support `Fatty`'s own input machinery and are not normally
|
|
|
2044
2045
|
| paste | str | No | Insert pasted text at point |
|
|
2045
2046
|
|
|
2046
2047
|
|
|
2047
|
-
<a id="
|
|
2048
|
+
<a id="org8c56eee"></a>
|
|
2048
2049
|
|
|
2049
2050
|
## Themes `themes/`
|
|
2050
2051
|
|
|
2051
2052
|
|
|
2052
|
-
<a id="
|
|
2053
|
+
<a id="org1acaa2b"></a>
|
|
2053
2054
|
|
|
2054
2055
|
### Distributed Themes
|
|
2055
2056
|
|
|
@@ -2085,12 +2086,12 @@ Here are the builtin themes:
|
|
|
2085
2086
|
| wordperfect | Nostalgic nod to the good old word processor |
|
|
2086
2087
|
|
|
2087
2088
|
|
|
2088
|
-
<a id="
|
|
2089
|
+
<a id="orgc0a7e6f"></a>
|
|
2089
2090
|
|
|
2090
2091
|
### Custom Themes
|
|
2091
2092
|
|
|
2092
2093
|
|
|
2093
|
-
<a id="
|
|
2094
|
+
<a id="orge23e6ef"></a>
|
|
2094
2095
|
|
|
2095
2096
|
#### Theme Name
|
|
2096
2097
|
|
|
@@ -2101,7 +2102,7 @@ name: nordic
|
|
|
2101
2102
|
```
|
|
2102
2103
|
|
|
2103
2104
|
|
|
2104
|
-
<a id="
|
|
2105
|
+
<a id="org294cd34"></a>
|
|
2105
2106
|
|
|
2106
2107
|
#### Inheritance from Another Theme
|
|
2107
2108
|
|
|
@@ -2118,7 +2119,7 @@ fg: "#eeeeee"
|
|
|
2118
2119
|
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.
|
|
2119
2120
|
|
|
2120
2121
|
|
|
2121
|
-
<a id="
|
|
2122
|
+
<a id="orgbe45631"></a>
|
|
2122
2123
|
|
|
2123
2124
|
#### Inheritance within a Theme
|
|
2124
2125
|
|
|
@@ -2138,7 +2139,7 @@ output:
|
|
|
2138
2139
|
This means that the input field will have the same coloring and attributes as the output pane.
|
|
2139
2140
|
|
|
2140
2141
|
|
|
2141
|
-
<a id="
|
|
2142
|
+
<a id="org63328ce"></a>
|
|
2142
2143
|
|
|
2143
2144
|
#### Theme Roles
|
|
2144
2145
|
|
|
@@ -2185,7 +2186,7 @@ Here is a listing of what roles act as the parent for each of the roles, their p
|
|
|
2185
2186
|
| `markdown_hrule` | Markdown horizontal rules. | `output` |
|
|
2186
2187
|
|
|
2187
2188
|
|
|
2188
|
-
<a id="
|
|
2189
|
+
<a id="org56fd868"></a>
|
|
2189
2190
|
|
|
2190
2191
|
#### Role Colors and Attributes and Frame Style
|
|
2191
2192
|
|
|
@@ -2308,7 +2309,7 @@ Each role can have assigned to it a foreground color (`fg:`), a background color
|
|
|
2308
2309
|
```
|
|
2309
2310
|
|
|
2310
2311
|
|
|
2311
|
-
<a id="
|
|
2312
|
+
<a id="orgbc48f3f"></a>
|
|
2312
2313
|
|
|
2313
2314
|
### The `themer` helper
|
|
2314
2315
|
|
|
@@ -2380,13 +2381,13 @@ error:
|
|
|
2380
2381
|
```
|
|
2381
2382
|
|
|
2382
2383
|
|
|
2383
|
-
<a id="
|
|
2384
|
+
<a id="org737d104"></a>
|
|
2384
2385
|
|
|
2385
2386
|
# Windows differences
|
|
2386
2387
|
|
|
2387
2388
|
All demo commands have been tested on Windows 11 with RubyInstaller 3.4. Compared with Linux, the following differences apply:
|
|
2388
2389
|
|
|
2389
|
-
- Windows
|
|
2390
|
+
- Windows uses the automatically installed `fatty-curses` dependency for temporarily handing the terminal to external commands and interactive programs.
|
|
2390
2391
|
|
|
2391
2392
|
- Mouse input is unavailable with the Windows curses build tested.
|
|
2392
2393
|
|
|
@@ -2397,3 +2398,14 @@ All demo commands have been tested on Windows 11 with RubyInstaller 3.4. Compare
|
|
|
2397
2398
|
- 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
|
|
|
2399
2400
|
- Exiting Fatty does not restore a saved copy of the screen that was visible before startup.
|
|
2401
|
+
|
|
2402
|
+
|
|
2403
|
+
<a id="org38c0a61"></a>
|
|
2404
|
+
|
|
2405
|
+
## Curses dependency
|
|
2406
|
+
|
|
2407
|
+
Fatty depends on `fatty-curses`, our fork of ruby/curses with the `Curses.endwin` API needed for temporary terminal suspension. RubyGems installs it automatically with Fatty or a Byr release that requires Fatty 0.99.12.1 or later. No separate curses installation or Git checkout is needed.
|
|
2408
|
+
|
|
2409
|
+
Windows requires RubyInstaller with DevKit to build the bundled PDCursesMod extension. Unix systems need their usual curses development libraries. The fork keeps the `Curses` Ruby API; applications can explicitly load it with `require "fatty-curses"`. Stock `curses` may remain installed for other applications, but should not be loaded alongside the fork in one process.
|
|
2410
|
+
|
|
2411
|
+
Source and upstream patch information: <https://github.com/ddoherty03/fatty-curses>
|