fatty 0.99.10.0 → 0.99.12.1
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 +37 -0
- data/README.md +275 -230
- data/README.org +64 -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 +66 -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 +42 -12
- data/lib/fatty/curses/curses_coder.rb +1 -1
- 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 +31 -24
- data/lib/fatty/version.rb +1 -1
- data/lib/fatty.rb +9 -10
- metadata +34 -22
data/README.md
CHANGED
|
@@ -1,116 +1,127 @@
|
|
|
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.1
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
# Table of Contents
|
|
9
|
+
|
|
10
|
+
1. [Introduction](#org30ca437)
|
|
11
|
+
2. [Quick Start](#org203ee8b)
|
|
12
|
+
1. [Installing](#org03526a4)
|
|
13
|
+
2. [Trying it Out with the \`fatty\` Demo](#orge7c9171)
|
|
14
|
+
1. [Builtin commands](#org112f6b3)
|
|
15
|
+
2. [Screenshots](#org5d89a68)
|
|
16
|
+
1. [Command line editing](#org7067fe3)
|
|
17
|
+
2. [Searchable Output](#org6c7e63f)
|
|
18
|
+
3. [Paging Markdown](#orgf5306b3)
|
|
19
|
+
4. [Popup Selection](#orge073cfd)
|
|
20
|
+
3. [Usage](#org9ce8f8e)
|
|
21
|
+
1. [Launching a Fatty Terminal](#orgdebdfc6)
|
|
22
|
+
1. [`on_accept`](#org851f890)
|
|
23
|
+
1. [Parameters to `on_accept`](#orgf5d20f3)
|
|
24
|
+
2. [The `line` parameter to `on_accept`](#org2219135)
|
|
25
|
+
3. [The callback parameter to `on_accept`](#org9486eae)
|
|
26
|
+
4. [Output ordering](#orgebf7942)
|
|
27
|
+
5. [Long-running callbacks and interruption](#orgde8e71e)
|
|
28
|
+
6. [ANSI colors in output](#org8e10038)
|
|
29
|
+
2. [Other parameters to `Terminal.new`](#orgf5eb640)
|
|
30
|
+
2. [The Callback API](#org69e422f)
|
|
31
|
+
1. [`append(text, follow: true, role: nil)`](#orgbe7fdef)
|
|
32
|
+
2. [`append_now(text, follow: true, mode: nil, role: nil)`](#org9058ab1)
|
|
33
|
+
3. [`clear_now`](#org4815f67)
|
|
34
|
+
4. [`markdown(text)`](#orgdf162e3)
|
|
35
|
+
5. [`markdown_now(text)`](#orgaac86e4)
|
|
36
|
+
6. [`status(text, role: :info)`](#org63aceff)
|
|
37
|
+
7. [`good(text, replace: false, render: true)`](#orgcebe6f4)
|
|
38
|
+
8. [`info(text, replace: false, render: true)`](#org853bb4d)
|
|
39
|
+
9. [`warn(text, replace: false, render: true)`](#org80aa109)
|
|
40
|
+
10. [`error(text, replace: false, render: true)`](#org2a8d531)
|
|
41
|
+
11. [`oops(text, replace: false, render: true)`](#org8fce502)
|
|
42
|
+
12. [`alert(text, role: :info)`](#org8a98da2)
|
|
43
|
+
13. [`prompt(prompt, initial: "", cancel_value: nil, history_key: nil, save_history: true)`](#orgfe0ec12)
|
|
44
|
+
14. [`check_interrupt!`](#org3a82e49)
|
|
45
|
+
15. [`add_progress(label:, total: nil, style: :percent, role: :info, width: 40)`](#org957d247)
|
|
46
|
+
1. [Initialization `add_progress(label:, style: :percent, total: nil, role: :info, width: 40)`](#org6755e26)
|
|
47
|
+
2. [Update `update(current: nil, indicator: nil, render: false)`](#org0c188e1)
|
|
48
|
+
3. [Finish](#orgfcfb491)
|
|
49
|
+
4. [Clear](#org345ed2e)
|
|
50
|
+
16. [`choose(prompt, choices:, initial_choice_idx: 0, cancel_value: nil)`](#org6c66151)
|
|
51
|
+
17. [`choose_multi(prompt, choices:, cancel_value: nil)`](#org1e09c5b)
|
|
52
|
+
18. [`confirm(prompt, yes_label: "Yes", no_label: "No", cancel_value: false)`](#orgd30bfaa)
|
|
53
|
+
19. [`menu(prompt, choices:, initial_choice_idx: 0, cancel_value: nil)`](#org6021537)
|
|
54
|
+
20. [`suspend(&block)`](#org73aa941)
|
|
55
|
+
21. [`environment`](#orgab1b7c6)
|
|
56
|
+
3. [Terminal Methods](#org35f5863)
|
|
57
|
+
1. [`Teminal#suspend(&block)`](#org22bda61)
|
|
58
|
+
4. [Default Interaction](#org6a0c0c3)
|
|
59
|
+
1. [Parts of the Screen](#orgae35292)
|
|
60
|
+
1. [Input Field](#org3f4b4cb)
|
|
61
|
+
2. [Output Pane](#org725c52f)
|
|
62
|
+
3. [Status Area](#org1ace7dc)
|
|
63
|
+
4. [Alert Area](#org891ff94)
|
|
64
|
+
2. [Command-line Editing](#orga211e51)
|
|
65
|
+
1. [Input Context](#org3d6eb6f)
|
|
66
|
+
1. [Cursor Motion](#orgdea9a0e)
|
|
67
|
+
2. [Clearing](#org4671935)
|
|
68
|
+
3. [Undo and Redo](#orgc236840)
|
|
69
|
+
4. [Deletion and Killing](#org5281e01)
|
|
70
|
+
5. [Yanking, Mark, and Region](#org06340f0)
|
|
71
|
+
6. [Count Prefix](#org0395f37)
|
|
72
|
+
7. [History Navigation](#org6ba0a8a)
|
|
73
|
+
8. [Completion](#orgeabf75a)
|
|
74
|
+
9. [Accept or Cancel](#org0cf46dd)
|
|
75
|
+
2. [Paging Context](#org87765cd)
|
|
76
|
+
3. [Searching Output](#org6dd6d8f)
|
|
77
|
+
1. [String and Regex Search](#orgca7741b)
|
|
78
|
+
2. [Incremental Search](#org6d5bece)
|
|
79
|
+
5. [Configuration](#orgb982996)
|
|
80
|
+
1. [General Configuration `config.yml`](#org00e721f)
|
|
81
|
+
1. [`word_char_re`](#org7b1f76e)
|
|
82
|
+
2. [`esc_delay`](#org9955dab)
|
|
83
|
+
3. [`history`](#org42b0ad7)
|
|
84
|
+
1. [`file`](#orga1d349c)
|
|
85
|
+
2. [`max`](#org2e98767)
|
|
86
|
+
4. [`theme`](#org4e44e0c)
|
|
87
|
+
5. [`truecolor`](#orgff3f783)
|
|
88
|
+
6. [`log`](#org430b361)
|
|
89
|
+
1. [`file`](#orgcbb9741)
|
|
90
|
+
2. [`level`](#orgd2e3098)
|
|
91
|
+
3. [`tags`](#org9daa7b1)
|
|
92
|
+
2. [Key code definitions `keydefs.yml`](#org4e9b4c3)
|
|
93
|
+
3. [Key bindings `keybindings.yml`](#org136e968)
|
|
94
|
+
1. [Key Names](#orgf9c2f52)
|
|
95
|
+
1. [Printable Keys](#org1df2709)
|
|
96
|
+
2. [Curses and Fatty Named Keys](#org1d057d6)
|
|
97
|
+
3. [Possibly Invisible Keys](#org623d16f)
|
|
98
|
+
4. [Unnamed but Recognized Keys](#org4d09732)
|
|
99
|
+
2. [Mouse Events](#org4d40274)
|
|
100
|
+
3. [Modifiers](#org8f4aeca)
|
|
101
|
+
4. [Contexts](#org9c8686c)
|
|
102
|
+
5. [Actions](#org1ac3b8c)
|
|
103
|
+
1. [Input buffer actions](#org50a6838)
|
|
104
|
+
2. [Input field actions](#org0b97ee4)
|
|
105
|
+
3. [Shell session actions](#org8458c19)
|
|
106
|
+
4. [Pager actions](#org20a2f11)
|
|
107
|
+
5. [Pager search actions](#org339975a)
|
|
108
|
+
6. [Popup actions](#org6c835cf)
|
|
109
|
+
7. [Prompt popup actions](#org70e7b68)
|
|
110
|
+
8. [Utility Actions](#orgd5f390b)
|
|
111
|
+
4. [Themes `themes/`](#org8b39674)
|
|
112
|
+
1. [Distributed Themes](#orgb1fd3a1)
|
|
113
|
+
2. [Custom Themes](#orgba68f00)
|
|
114
|
+
1. [Theme Name](#org80c273a)
|
|
115
|
+
2. [Inheritance from Another Theme](#org8a0bdfa)
|
|
116
|
+
3. [Inheritance within a Theme](#orgce602d4)
|
|
117
|
+
4. [Theme Roles](#org5b8e792)
|
|
118
|
+
5. [Role Colors and Attributes and Frame Style](#org0e24767)
|
|
119
|
+
3. [The `themer` helper](#orgf8e27c5)
|
|
120
|
+
6. [Windows differences](#org31c4001)
|
|
121
|
+
1. [Curses dependency](#org48a1dcb)
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
<a id="org30ca437"></a>
|
|
114
125
|
|
|
115
126
|
# Introduction
|
|
116
127
|
|
|
@@ -138,12 +149,12 @@ In other words, fatty allows you to write a terminal-based REPL of your choosing
|
|
|
138
149
|
`Fatty` is *not* a terminal emulator but runs on top of one.
|
|
139
150
|
|
|
140
151
|
|
|
141
|
-
<a id="
|
|
152
|
+
<a id="org203ee8b"></a>
|
|
142
153
|
|
|
143
154
|
# Quick Start
|
|
144
155
|
|
|
145
156
|
|
|
146
|
-
<a id="
|
|
157
|
+
<a id="org03526a4"></a>
|
|
147
158
|
|
|
148
159
|
## Installing
|
|
149
160
|
|
|
@@ -154,7 +165,7 @@ $ gem install fatty
|
|
|
154
165
|
```
|
|
155
166
|
|
|
156
167
|
|
|
157
|
-
<a id="
|
|
168
|
+
<a id="orge7c9171"></a>
|
|
158
169
|
|
|
159
170
|
## Trying it Out with the \`fatty\` Demo
|
|
160
171
|
|
|
@@ -163,7 +174,7 @@ Once installed, you can try out `fatty` with the included program called `fatty`
|
|
|
163
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.
|
|
164
175
|
|
|
165
176
|
|
|
166
|
-
<a id="
|
|
177
|
+
<a id="org112f6b3"></a>
|
|
167
178
|
|
|
168
179
|
### Builtin commands
|
|
169
180
|
|
|
@@ -197,12 +208,12 @@ Here are the commands builtin to `fatty`
|
|
|
197
208
|
| colors | Display ANSI, 256-color, and X11 color diagnostics |
|
|
198
209
|
|
|
199
210
|
|
|
200
|
-
<a id="
|
|
211
|
+
<a id="org5d89a68"></a>
|
|
201
212
|
|
|
202
213
|
### Screenshots
|
|
203
214
|
|
|
204
215
|
|
|
205
|
-
<a id="
|
|
216
|
+
<a id="org7067fe3"></a>
|
|
206
217
|
|
|
207
218
|
#### Command line editing
|
|
208
219
|
|
|
@@ -211,7 +222,7 @@ Here is the command line, mid-edit showing a region selected and, in dim text to
|
|
|
211
222
|

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

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

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

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