fatty 0.99.12.4 → 0.99.12.6
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 +8 -0
- data/README.md +227 -227
- data/README.org +1 -1
- data/lib/fatty/curses/event_source.rb +9 -2
- data/lib/fatty/terminal.rb +17 -1
- data/lib/fatty/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 48985eb60144f7730bdc2601557ae7a65d7b4aebc895926b9e7b7f0a23a20d1c
|
|
4
|
+
data.tar.gz: a4afb2e0af259566788addb13d35a5aae4dfcaf8b3c49edf75f1ed1cb94a6078
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 742576cf388807aa7ca161a216e445b25d92d58388a71665b1e223daa030a3091fd8b45293530e0c2cb34231bae301ae0c3a1ba2fff013325014c6450ebb2043
|
|
7
|
+
data.tar.gz: 2c76d20cb616796f26e13c9700d5d7fe8cb021f9f95bbf3563751dd2f2bbb4e95787d34146b38dc2f4056cc451a431c74d8e6d41e5e932770f84424162a6a57c
|
data/CHANGELOG.org
CHANGED
|
@@ -6,6 +6,14 @@
|
|
|
6
6
|
user would find useful.
|
|
7
7
|
5. Give each heading a version number and an inactive date (C-c ! is useful here).
|
|
8
8
|
|
|
9
|
+
* Version 0.99.12.6 [2026-11-27 Fri]
|
|
10
|
+
- Keybindings help---and several other modal screens---don’t own a popup
|
|
11
|
+
window. The fix now falls back to the normal input window for those
|
|
12
|
+
screens
|
|
13
|
+
|
|
14
|
+
* Version 0.99.12.5 [2026-11-26 Thu]
|
|
15
|
+
- fix losing of cursor in popups during scrolling.
|
|
16
|
+
|
|
9
17
|
* Version 0.99.12.4 [2026-11-26 Thu]
|
|
10
18
|
- further tweaks to terminal background restore manifested in Windows terminal
|
|
11
19
|
|
data/README.md
CHANGED
|
@@ -2,126 +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.6
|
|
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
|
-
1. [Curses dependency](#
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
<a id="
|
|
10
|
+
1. [Introduction](#org15c0477)
|
|
11
|
+
2. [Quick Start](#org2fb2dd7)
|
|
12
|
+
1. [Installing](#orgb81c5e8)
|
|
13
|
+
2. [Trying it Out with the \`fatty\` Demo](#org9053320)
|
|
14
|
+
1. [Builtin commands](#orgef5b24b)
|
|
15
|
+
2. [Screenshots](#orgdb1ce61)
|
|
16
|
+
1. [Command line editing](#org4914dfe)
|
|
17
|
+
2. [Searchable Output](#org943189a)
|
|
18
|
+
3. [Paging Markdown](#org7113e79)
|
|
19
|
+
4. [Popup Selection](#orgb7eeacd)
|
|
20
|
+
3. [Usage](#org6b878c0)
|
|
21
|
+
1. [Launching a Fatty Terminal](#org4f0f16b)
|
|
22
|
+
1. [`on_accept`](#org58078e3)
|
|
23
|
+
1. [Parameters to `on_accept`](#org081a9d1)
|
|
24
|
+
2. [The `line` parameter to `on_accept`](#org0f8b075)
|
|
25
|
+
3. [The callback parameter to `on_accept`](#org0079495)
|
|
26
|
+
4. [Output ordering](#orgf0c639d)
|
|
27
|
+
5. [Long-running callbacks and interruption](#orgf8d597d)
|
|
28
|
+
6. [ANSI colors in output](#org54d5bed)
|
|
29
|
+
2. [Other parameters to `Terminal.new`](#orgfc839b3)
|
|
30
|
+
2. [The Callback API](#orgb4af91b)
|
|
31
|
+
1. [`append(text, follow: true, role: nil)`](#orge3521fc)
|
|
32
|
+
2. [`append_now(text, follow: true, mode: nil, role: nil)`](#org008bbfe)
|
|
33
|
+
3. [`clear_now`](#orgc8b633c)
|
|
34
|
+
4. [`markdown(text)`](#orge14bd2f)
|
|
35
|
+
5. [`markdown_now(text)`](#org1a5b452)
|
|
36
|
+
6. [`status(text, role: :info)`](#orgac061b0)
|
|
37
|
+
7. [`good(text, replace: false, render: true)`](#orgf62fa11)
|
|
38
|
+
8. [`info(text, replace: false, render: true)`](#org23fde07)
|
|
39
|
+
9. [`warn(text, replace: false, render: true)`](#org7f584eb)
|
|
40
|
+
10. [`error(text, replace: false, render: true)`](#org804e04d)
|
|
41
|
+
11. [`oops(text, replace: false, render: true)`](#orgce3131c)
|
|
42
|
+
12. [`alert(text, role: :info)`](#orgfa983e9)
|
|
43
|
+
13. [`prompt(prompt, initial: "", cancel_value: nil, history_key: nil, save_history: true)`](#orgb972199)
|
|
44
|
+
14. [`check_interrupt!`](#orgccc9e2d)
|
|
45
|
+
15. [`add_progress(label:, total: nil, style: :percent, role: :info, width: 40)`](#org9164f7b)
|
|
46
|
+
1. [Initialization `add_progress(label:, style: :percent, total: nil, role: :info, width: 40)`](#org9b63038)
|
|
47
|
+
2. [Update `update(current: nil, indicator: nil, render: false)`](#orga6bed74)
|
|
48
|
+
3. [Finish](#orgeb5255f)
|
|
49
|
+
4. [Clear](#orgddaf189)
|
|
50
|
+
16. [`choose(prompt, choices:, initial_choice_idx: 0, cancel_value: nil)`](#orge541412)
|
|
51
|
+
17. [`choose_multi(prompt, choices:, cancel_value: nil)`](#org3b5cdc2)
|
|
52
|
+
18. [`confirm(prompt, yes_label: "Yes", no_label: "No", cancel_value: false)`](#orgd804ac7)
|
|
53
|
+
19. [`menu(prompt, choices:, initial_choice_idx: 0, cancel_value: nil)`](#orgb548793)
|
|
54
|
+
20. [`suspend(&block)`](#orgdb1cfdc)
|
|
55
|
+
21. [`environment`](#orgafb5dae)
|
|
56
|
+
3. [Terminal Methods](#org49302df)
|
|
57
|
+
1. [`Teminal#suspend(&block)`](#org2847b95)
|
|
58
|
+
4. [Default Interaction](#orgd1fc18a)
|
|
59
|
+
1. [Parts of the Screen](#org81bcf51)
|
|
60
|
+
1. [Input Field](#org54e8473)
|
|
61
|
+
2. [Output Pane](#orgbc67af6)
|
|
62
|
+
3. [Status Area](#org022ec4f)
|
|
63
|
+
4. [Alert Area](#orge29530d)
|
|
64
|
+
2. [Command-line Editing](#orgdbe0323)
|
|
65
|
+
1. [Input Context](#orgf75fb22)
|
|
66
|
+
1. [Cursor Motion](#org03e80f2)
|
|
67
|
+
2. [Clearing](#org22a1633)
|
|
68
|
+
3. [Undo and Redo](#org7aaa9da)
|
|
69
|
+
4. [Deletion and Killing](#org57f62b6)
|
|
70
|
+
5. [Yanking, Mark, and Region](#orgcd08f25)
|
|
71
|
+
6. [Count Prefix](#org0da0dc4)
|
|
72
|
+
7. [History Navigation](#orgc6b43bc)
|
|
73
|
+
8. [Completion](#org9ac0865)
|
|
74
|
+
9. [Accept or Cancel](#org5fec347)
|
|
75
|
+
2. [Paging Context](#org631d4fc)
|
|
76
|
+
3. [Searching Output](#org1955da8)
|
|
77
|
+
1. [String and Regex Search](#org515f6c1)
|
|
78
|
+
2. [Incremental Search](#org95c3d6d)
|
|
79
|
+
5. [Configuration](#org6f95ba4)
|
|
80
|
+
1. [General Configuration `config.yml`](#org527a730)
|
|
81
|
+
1. [`word_char_re`](#orga7437eb)
|
|
82
|
+
2. [`esc_delay`](#orgbc44962)
|
|
83
|
+
3. [`history`](#org98167b2)
|
|
84
|
+
1. [`file`](#orgbb482e5)
|
|
85
|
+
2. [`max`](#orgf0bf225)
|
|
86
|
+
4. [`theme`](#org418fc0e)
|
|
87
|
+
5. [`truecolor`](#org64a8fae)
|
|
88
|
+
6. [`log`](#orga395022)
|
|
89
|
+
1. [`file`](#orgaccae98)
|
|
90
|
+
2. [`level`](#org7393b5b)
|
|
91
|
+
3. [`tags`](#org9f2527d)
|
|
92
|
+
2. [Key code definitions `keydefs.yml`](#orgca2818e)
|
|
93
|
+
3. [Key bindings `keybindings.yml`](#org237063c)
|
|
94
|
+
1. [Key Names](#orgbae3eeb)
|
|
95
|
+
1. [Printable Keys](#orgf8dac7c)
|
|
96
|
+
2. [Curses and Fatty Named Keys](#orgd9c441a)
|
|
97
|
+
3. [Possibly Invisible Keys](#org2bda549)
|
|
98
|
+
4. [Unnamed but Recognized Keys](#org4f3759a)
|
|
99
|
+
2. [Mouse Events](#org9cddd93)
|
|
100
|
+
3. [Modifiers](#org46a0d38)
|
|
101
|
+
4. [Contexts](#orga4b4c40)
|
|
102
|
+
5. [Actions](#orga9fd42d)
|
|
103
|
+
1. [Input buffer actions](#org9661d90)
|
|
104
|
+
2. [Input field actions](#org2c1d151)
|
|
105
|
+
3. [Shell session actions](#orgdab317e)
|
|
106
|
+
4. [Pager actions](#org79f8625)
|
|
107
|
+
5. [Pager search actions](#org781ce4c)
|
|
108
|
+
6. [Popup actions](#orgad5cec2)
|
|
109
|
+
7. [Prompt popup actions](#orgf23b2b8)
|
|
110
|
+
8. [Utility Actions](#orgae819a8)
|
|
111
|
+
4. [Themes `themes/`](#org59eb5c3)
|
|
112
|
+
1. [Distributed Themes](#org4005bd7)
|
|
113
|
+
2. [Custom Themes](#org3ac59e9)
|
|
114
|
+
1. [Theme Name](#org5ee688b)
|
|
115
|
+
2. [Inheritance from Another Theme](#org630eba6)
|
|
116
|
+
3. [Inheritance within a Theme](#org70a1774)
|
|
117
|
+
4. [Theme Roles](#org8618ea1)
|
|
118
|
+
5. [Role Colors and Attributes and Frame Style](#org004fbd0)
|
|
119
|
+
3. [The `themer` helper](#org83394c1)
|
|
120
|
+
6. [Windows differences](#org53b18ca)
|
|
121
|
+
1. [Curses dependency](#orgd6e15b8)
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
<a id="org15c0477"></a>
|
|
125
125
|
|
|
126
126
|
# Introduction
|
|
127
127
|
|
|
@@ -149,12 +149,12 @@ In other words, fatty allows you to write a terminal-based REPL of your choosing
|
|
|
149
149
|
`Fatty` is *not* a terminal emulator but runs on top of one.
|
|
150
150
|
|
|
151
151
|
|
|
152
|
-
<a id="
|
|
152
|
+
<a id="org2fb2dd7"></a>
|
|
153
153
|
|
|
154
154
|
# Quick Start
|
|
155
155
|
|
|
156
156
|
|
|
157
|
-
<a id="
|
|
157
|
+
<a id="orgb81c5e8"></a>
|
|
158
158
|
|
|
159
159
|
## Installing
|
|
160
160
|
|
|
@@ -165,7 +165,7 @@ $ gem install fatty
|
|
|
165
165
|
```
|
|
166
166
|
|
|
167
167
|
|
|
168
|
-
<a id="
|
|
168
|
+
<a id="org9053320"></a>
|
|
169
169
|
|
|
170
170
|
## Trying it Out with the \`fatty\` Demo
|
|
171
171
|
|
|
@@ -174,7 +174,7 @@ Once installed, you can try out `fatty` with the included program called `fatty`
|
|
|
174
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.
|
|
175
175
|
|
|
176
176
|
|
|
177
|
-
<a id="
|
|
177
|
+
<a id="orgef5b24b"></a>
|
|
178
178
|
|
|
179
179
|
### Builtin commands
|
|
180
180
|
|
|
@@ -208,12 +208,12 @@ Here are the commands builtin to `fatty`
|
|
|
208
208
|
| colors | Display ANSI, 256-color, and X11 color diagnostics |
|
|
209
209
|
|
|
210
210
|
|
|
211
|
-
<a id="
|
|
211
|
+
<a id="orgdb1ce61"></a>
|
|
212
212
|
|
|
213
213
|
### Screenshots
|
|
214
214
|
|
|
215
215
|
|
|
216
|
-
<a id="
|
|
216
|
+
<a id="org4914dfe"></a>
|
|
217
217
|
|
|
218
218
|
#### Command line editing
|
|
219
219
|
|
|
@@ -222,7 +222,7 @@ Here is the command line, mid-edit showing a region selected and, in dim text to
|
|
|
222
222
|

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

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

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

|
|
250
250
|
|
|
251
251
|
|
|
252
|
-
<a id="
|
|
252
|
+
<a id="org6b878c0"></a>
|
|
253
253
|
|
|
254
254
|
# Usage
|
|
255
255
|
|
|
256
256
|
|
|
257
|
-
<a id="
|
|
257
|
+
<a id="org4f0f16b"></a>
|
|
258
258
|
|
|
259
259
|
## Launching a Fatty Terminal
|
|
260
260
|
|
|
261
261
|
|
|
262
|
-
<a id="
|
|
262
|
+
<a id="org58078e3"></a>
|
|
263
263
|
|
|
264
264
|
### `on_accept`
|
|
265
265
|
|
|
@@ -292,14 +292,14 @@ When a `fatty` application runs, `fatty` installs a few files if they do not exi
|
|
|
292
292
|
- `themes`, a directory of pre-defined theme definitions that you can choose from and add to by adding your own themes.
|
|
293
293
|
|
|
294
294
|
|
|
295
|
-
<a id="
|
|
295
|
+
<a id="org081a9d1"></a>
|
|
296
296
|
|
|
297
297
|
#### Parameters to `on_accept`
|
|
298
298
|
|
|
299
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`.
|
|
300
300
|
|
|
301
301
|
|
|
302
|
-
<a id="
|
|
302
|
+
<a id="org0f8b075"></a>
|
|
303
303
|
|
|
304
304
|
#### The `line` parameter to `on_accept`
|
|
305
305
|
|
|
@@ -340,7 +340,7 @@ Fatty::Terminal.new(
|
|
|
340
340
|
```
|
|
341
341
|
|
|
342
342
|
|
|
343
|
-
<a id="
|
|
343
|
+
<a id="org0079495"></a>
|
|
344
344
|
|
|
345
345
|
#### The callback parameter to `on_accept`
|
|
346
346
|
|
|
@@ -365,7 +365,7 @@ Fatty::Terminal.new(
|
|
|
365
365
|
The callback parameter responds to several methods that allow your application to interact with the user. They are documented below.
|
|
366
366
|
|
|
367
367
|
|
|
368
|
-
<a id="
|
|
368
|
+
<a id="orgf0c639d"></a>
|
|
369
369
|
|
|
370
370
|
#### Output ordering
|
|
371
371
|
|
|
@@ -390,7 +390,7 @@ Calls to `append_now` and `markdown_now` are different. They append text and imm
|
|
|
390
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.
|
|
391
391
|
|
|
392
392
|
|
|
393
|
-
<a id="
|
|
393
|
+
<a id="orgf8d597d"></a>
|
|
394
394
|
|
|
395
395
|
#### Long-running callbacks and interruption
|
|
396
396
|
|
|
@@ -429,14 +429,14 @@ end
|
|
|
429
429
|
```
|
|
430
430
|
|
|
431
431
|
|
|
432
|
-
<a id="
|
|
432
|
+
<a id="org54d5bed"></a>
|
|
433
433
|
|
|
434
434
|
#### ANSI colors in output
|
|
435
435
|
|
|
436
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.
|
|
437
437
|
|
|
438
438
|
|
|
439
|
-
<a id="
|
|
439
|
+
<a id="orgfc839b3"></a>
|
|
440
440
|
|
|
441
441
|
### Other parameters to `Terminal.new`
|
|
442
442
|
|
|
@@ -463,14 +463,14 @@ Fatty::Terminal.new(
|
|
|
463
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.
|
|
464
464
|
|
|
465
465
|
|
|
466
|
-
<a id="
|
|
466
|
+
<a id="orgb4af91b"></a>
|
|
467
467
|
|
|
468
468
|
## The Callback API
|
|
469
469
|
|
|
470
470
|
Here are the details on the messages that you can send to the callback parameter to the `on_accept` proc.
|
|
471
471
|
|
|
472
472
|
|
|
473
|
-
<a id="
|
|
473
|
+
<a id="orge3521fc"></a>
|
|
474
474
|
|
|
475
475
|
### `append(text, follow: true, role: nil)`
|
|
476
476
|
|
|
@@ -479,7 +479,7 @@ Add the given text to the output pane. After a full page of output is produced,
|
|
|
479
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.
|
|
480
480
|
|
|
481
481
|
|
|
482
|
-
<a id="
|
|
482
|
+
<a id="org008bbfe"></a>
|
|
483
483
|
|
|
484
484
|
### `append_now(text, follow: true, mode: nil, role: nil)`
|
|
485
485
|
|
|
@@ -490,14 +490,14 @@ Setting the mode to `:scrolling` or `:paging` determines whether the output is s
|
|
|
490
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.
|
|
491
491
|
|
|
492
492
|
|
|
493
|
-
<a id="
|
|
493
|
+
<a id="orgc8b633c"></a>
|
|
494
494
|
|
|
495
495
|
### `clear_now`
|
|
496
496
|
|
|
497
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`.
|
|
498
498
|
|
|
499
499
|
|
|
500
|
-
<a id="
|
|
500
|
+
<a id="orge14bd2f"></a>
|
|
501
501
|
|
|
502
502
|
### `markdown(text)`
|
|
503
503
|
|
|
@@ -517,14 +517,14 @@ and this should appear on the next line.
|
|
|
517
517
|
```
|
|
518
518
|
|
|
519
519
|
|
|
520
|
-
<a id="
|
|
520
|
+
<a id="org1a5b452"></a>
|
|
521
521
|
|
|
522
522
|
### `markdown_now(text)`
|
|
523
523
|
|
|
524
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
525
|
|
|
526
526
|
|
|
527
|
-
<a id="
|
|
527
|
+
<a id="orgac061b0"></a>
|
|
528
528
|
|
|
529
529
|
### `status(text, role: :info)`
|
|
530
530
|
|
|
@@ -536,49 +536,49 @@ Display the text in the "status" area, the lines immediately above the input fie
|
|
|
536
536
|
- **:error:** colored something to suggest danger, usually some tone of red.
|
|
537
537
|
|
|
538
538
|
|
|
539
|
-
<a id="
|
|
539
|
+
<a id="orgf62fa11"></a>
|
|
540
540
|
|
|
541
541
|
### `good(text, replace: false, render: true)`
|
|
542
542
|
|
|
543
543
|
Display the text in the status area with the role :good.
|
|
544
544
|
|
|
545
545
|
|
|
546
|
-
<a id="
|
|
546
|
+
<a id="org23fde07"></a>
|
|
547
547
|
|
|
548
548
|
### `info(text, replace: false, render: true)`
|
|
549
549
|
|
|
550
550
|
Display the text in the status area with the role :info.
|
|
551
551
|
|
|
552
552
|
|
|
553
|
-
<a id="
|
|
553
|
+
<a id="org7f584eb"></a>
|
|
554
554
|
|
|
555
555
|
### `warn(text, replace: false, render: true)`
|
|
556
556
|
|
|
557
557
|
Display the text in the status area with the role :warn.
|
|
558
558
|
|
|
559
559
|
|
|
560
|
-
<a id="
|
|
560
|
+
<a id="org804e04d"></a>
|
|
561
561
|
|
|
562
562
|
### `error(text, replace: false, render: true)`
|
|
563
563
|
|
|
564
564
|
Display the text in the status area with the role :error.
|
|
565
565
|
|
|
566
566
|
|
|
567
|
-
<a id="
|
|
567
|
+
<a id="orgce3131c"></a>
|
|
568
568
|
|
|
569
569
|
### `oops(text, replace: false, render: true)`
|
|
570
570
|
|
|
571
571
|
An alias for `error(text)`
|
|
572
572
|
|
|
573
573
|
|
|
574
|
-
<a id="
|
|
574
|
+
<a id="orgfa983e9"></a>
|
|
575
575
|
|
|
576
576
|
### `alert(text, role: :info)`
|
|
577
577
|
|
|
578
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.
|
|
579
579
|
|
|
580
580
|
|
|
581
|
-
<a id="
|
|
581
|
+
<a id="orgb972199"></a>
|
|
582
582
|
|
|
583
583
|
### `prompt(prompt, initial: "", cancel_value: nil, history_key: nil, save_history: true)`
|
|
584
584
|
|
|
@@ -608,7 +608,7 @@ The `prompt` input has its own history facility separate from the history in the
|
|
|
608
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`.
|
|
609
609
|
|
|
610
610
|
|
|
611
|
-
<a id="
|
|
611
|
+
<a id="orgccc9e2d"></a>
|
|
612
612
|
|
|
613
613
|
### `check_interrupt!`
|
|
614
614
|
|
|
@@ -619,7 +619,7 @@ The polling is throttled, so `check_interrupt!` may be called frequently. It sho
|
|
|
619
619
|
Fatty catches `Fatty::Interrupt` at the callback boundary, finishes the current command, restores the terminal state, and resumes the normal input loop.
|
|
620
620
|
|
|
621
621
|
|
|
622
|
-
<a id="
|
|
622
|
+
<a id="org9164f7b"></a>
|
|
623
623
|
|
|
624
624
|
### `add_progress(label:, total: nil, style: :percent, role: :info, width: 40)`
|
|
625
625
|
|
|
@@ -635,7 +635,7 @@ Display a progress widget in the status area to show the user that the system is
|
|
|
635
635
|
- **:trail:** display an "indicator" on each call of `update(indicator: <string>)`
|
|
636
636
|
|
|
637
637
|
|
|
638
|
-
<a id="
|
|
638
|
+
<a id="org9b63038"></a>
|
|
639
639
|
|
|
640
640
|
#### Initialization `add_progress(label:, style: :percent, total: nil, role: :info, width: 40)`
|
|
641
641
|
|
|
@@ -646,7 +646,7 @@ Display a progress widget in the status area to show the user that the system is
|
|
|
646
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.
|
|
647
647
|
|
|
648
648
|
|
|
649
|
-
<a id="
|
|
649
|
+
<a id="orga6bed74"></a>
|
|
650
650
|
|
|
651
651
|
#### Update `update(current: nil, indicator: nil, render: false)`
|
|
652
652
|
|
|
@@ -752,21 +752,21 @@ Fatty::Terminal.new(
|
|
|
752
752
|
```
|
|
753
753
|
|
|
754
754
|
|
|
755
|
-
<a id="
|
|
755
|
+
<a id="orgeb5255f"></a>
|
|
756
756
|
|
|
757
757
|
#### Finish
|
|
758
758
|
|
|
759
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.
|
|
760
760
|
|
|
761
761
|
|
|
762
|
-
<a id="
|
|
762
|
+
<a id="orgddaf189"></a>
|
|
763
763
|
|
|
764
764
|
#### Clear
|
|
765
765
|
|
|
766
766
|
And, if you have occasion, you can clear the Progress by calling `#clear` on the Progress object.
|
|
767
767
|
|
|
768
768
|
|
|
769
|
-
<a id="
|
|
769
|
+
<a id="orge541412"></a>
|
|
770
770
|
|
|
771
771
|
### `choose(prompt, choices:, initial_choice_idx: 0, cancel_value: nil)`
|
|
772
772
|
|
|
@@ -832,7 +832,7 @@ Fatty::Terminal.new(
|
|
|
832
832
|
```
|
|
833
833
|
|
|
834
834
|
|
|
835
|
-
<a id="
|
|
835
|
+
<a id="org3b5cdc2"></a>
|
|
836
836
|
|
|
837
837
|
### `choose_multi(prompt, choices:, cancel_value: nil)`
|
|
838
838
|
|
|
@@ -850,7 +850,7 @@ Present a set of `choices:`, which can either be
|
|
|
850
850
|
The `prompt` String (by default "Choose Many") can guide the user about the purpose of the choices.
|
|
851
851
|
|
|
852
852
|
|
|
853
|
-
<a id="
|
|
853
|
+
<a id="orgd804ac7"></a>
|
|
854
854
|
|
|
855
855
|
### `confirm(prompt, yes_label: "Yes", no_label: "No", cancel_value: false)`
|
|
856
856
|
|
|
@@ -861,7 +861,7 @@ Present the user with a simple Yes/No choice using your choice of ways to expres
|
|
|
861
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.
|
|
862
862
|
|
|
863
863
|
|
|
864
|
-
<a id="
|
|
864
|
+
<a id="orgb548793"></a>
|
|
865
865
|
|
|
866
866
|
### `menu(prompt, choices:, initial_choice_idx: 0, cancel_value: nil)`
|
|
867
867
|
|
|
@@ -908,7 +908,7 @@ If you want to set one of the choices as the initial choice, set `initial_choice
|
|
|
908
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.
|
|
909
909
|
|
|
910
910
|
|
|
911
|
-
<a id="
|
|
911
|
+
<a id="orgdb1cfdc"></a>
|
|
912
912
|
|
|
913
913
|
### `suspend(&block)`
|
|
914
914
|
|
|
@@ -925,7 +925,7 @@ end
|
|
|
925
925
|
The value of the block is returned by `suspend`. Terminal state is restored even if the block exits by raising an exception.
|
|
926
926
|
|
|
927
927
|
|
|
928
|
-
<a id="
|
|
928
|
+
<a id="orgafb5dae"></a>
|
|
929
929
|
|
|
930
930
|
### `environment`
|
|
931
931
|
|
|
@@ -962,57 +962,57 @@ The environment report also includes a nested `:curses` hash:
|
|
|
962
962
|
| `:can_change_color` | Whether curses can redefine color values |
|
|
963
963
|
|
|
964
964
|
|
|
965
|
-
<a id="
|
|
965
|
+
<a id="org49302df"></a>
|
|
966
966
|
|
|
967
967
|
## Terminal Methods
|
|
968
968
|
|
|
969
969
|
|
|
970
|
-
<a id="
|
|
970
|
+
<a id="org2847b95"></a>
|
|
971
971
|
|
|
972
972
|
### `Teminal#suspend(&block)`
|
|
973
973
|
|
|
974
974
|
Return control to the launching terminal, execute the given block, and return.
|
|
975
975
|
|
|
976
976
|
|
|
977
|
-
<a id="
|
|
977
|
+
<a id="orgd1fc18a"></a>
|
|
978
978
|
|
|
979
979
|
# Default Interaction
|
|
980
980
|
|
|
981
981
|
|
|
982
|
-
<a id="
|
|
982
|
+
<a id="org81bcf51"></a>
|
|
983
983
|
|
|
984
984
|
## Parts of the Screen
|
|
985
985
|
|
|
986
986
|
|
|
987
|
-
<a id="
|
|
987
|
+
<a id="org54e8473"></a>
|
|
988
988
|
|
|
989
989
|
### Input Field
|
|
990
990
|
|
|
991
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.
|
|
992
992
|
|
|
993
993
|
|
|
994
|
-
<a id="
|
|
994
|
+
<a id="orgbc67af6"></a>
|
|
995
995
|
|
|
996
996
|
### Output Pane
|
|
997
997
|
|
|
998
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.
|
|
999
999
|
|
|
1000
1000
|
|
|
1001
|
-
<a id="
|
|
1001
|
+
<a id="org022ec4f"></a>
|
|
1002
1002
|
|
|
1003
1003
|
### Status Area
|
|
1004
1004
|
|
|
1005
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.
|
|
1006
1006
|
|
|
1007
1007
|
|
|
1008
|
-
<a id="
|
|
1008
|
+
<a id="orge29530d"></a>
|
|
1009
1009
|
|
|
1010
1010
|
### Alert Area
|
|
1011
1011
|
|
|
1012
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.
|
|
1013
1013
|
|
|
1014
1014
|
|
|
1015
|
-
<a id="
|
|
1015
|
+
<a id="orgdbe0323"></a>
|
|
1016
1016
|
|
|
1017
1017
|
## Command-line Editing
|
|
1018
1018
|
|
|
@@ -1021,14 +1021,14 @@ Press `M-?` (Alt-?, or Escape followed by ?) to browse the current keybindings,
|
|
|
1021
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.
|
|
1022
1022
|
|
|
1023
1023
|
|
|
1024
|
-
<a id="
|
|
1024
|
+
<a id="orgf75fb22"></a>
|
|
1025
1025
|
|
|
1026
1026
|
### Input Context
|
|
1027
1027
|
|
|
1028
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.
|
|
1029
1029
|
|
|
1030
1030
|
|
|
1031
|
-
<a id="
|
|
1031
|
+
<a id="org03e80f2"></a>
|
|
1032
1032
|
|
|
1033
1033
|
#### Cursor Motion
|
|
1034
1034
|
|
|
@@ -1052,7 +1052,7 @@ When editing the input line or text input for widgets like the \`prompt\`, \`fat
|
|
|
1052
1052
|
| C-:left | move cursor left one word |
|
|
1053
1053
|
|
|
1054
1054
|
|
|
1055
|
-
<a id="
|
|
1055
|
+
<a id="org22a1633"></a>
|
|
1056
1056
|
|
|
1057
1057
|
#### Clearing
|
|
1058
1058
|
|
|
@@ -1063,7 +1063,7 @@ This is one action that does not affect the input buffer but the output pane. It
|
|
|
1063
1063
|
| C-l | clear the output pane |
|
|
1064
1064
|
|
|
1065
1065
|
|
|
1066
|
-
<a id="
|
|
1066
|
+
<a id="org7aaa9da"></a>
|
|
1067
1067
|
|
|
1068
1068
|
#### Undo and Redo
|
|
1069
1069
|
|
|
@@ -1077,7 +1077,7 @@ This is one action that does not affect the input buffer but the output pane. It
|
|
|
1077
1077
|
| M-/ | redo |
|
|
1078
1078
|
|
|
1079
1079
|
|
|
1080
|
-
<a id="
|
|
1080
|
+
<a id="org57f62b6"></a>
|
|
1081
1081
|
|
|
1082
1082
|
#### Deletion and Killing
|
|
1083
1083
|
|
|
@@ -1097,7 +1097,7 @@ When the region is active, destructive editing commands kill the region rather t
|
|
|
1097
1097
|
| M-t | transpose words |
|
|
1098
1098
|
|
|
1099
1099
|
|
|
1100
|
-
<a id="
|
|
1100
|
+
<a id="orgcd08f25"></a>
|
|
1101
1101
|
|
|
1102
1102
|
#### Yanking, Mark, and Region
|
|
1103
1103
|
|
|
@@ -1125,7 +1125,7 @@ Notice that commands that normally delete characters or words, kill the region i
|
|
|
1125
1125
|
| M-w | copy the region |
|
|
1126
1126
|
|
|
1127
1127
|
|
|
1128
|
-
<a id="
|
|
1128
|
+
<a id="org0da0dc4"></a>
|
|
1129
1129
|
|
|
1130
1130
|
#### Count Prefix
|
|
1131
1131
|
|
|
@@ -1141,7 +1141,7 @@ Fatty follows the emacs convention of making `C-u` multiply the count prefix by
|
|
|
1141
1141
|
| M-<digit> | accumulate a count argument |
|
|
1142
1142
|
|
|
1143
1143
|
|
|
1144
|
-
<a id="
|
|
1144
|
+
<a id="orgc6b43bc"></a>
|
|
1145
1145
|
|
|
1146
1146
|
#### History Navigation
|
|
1147
1147
|
|
|
@@ -1164,7 +1164,7 @@ You can navigate history items with the `up` and `down` keys as you would expect
|
|
|
1164
1164
|
| C-r | search the history in a popup |
|
|
1165
1165
|
|
|
1166
1166
|
|
|
1167
|
-
<a id="
|
|
1167
|
+
<a id="org9ac0865"></a>
|
|
1168
1168
|
|
|
1169
1169
|
#### Completion
|
|
1170
1170
|
|
|
@@ -1210,7 +1210,7 @@ You can navigate history items with the `up` and `down` keys as you would expect
|
|
|
1210
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.
|
|
1211
1211
|
|
|
1212
1212
|
|
|
1213
|
-
<a id="
|
|
1213
|
+
<a id="org5fec347"></a>
|
|
1214
1214
|
|
|
1215
1215
|
#### Accept or Cancel
|
|
1216
1216
|
|
|
@@ -1226,7 +1226,7 @@ You can end a `fatty` session with `C-c` at the command line, or (only if the bu
|
|
|
1226
1226
|
| C-d | quit \`fatty\` only if the input line is empty |
|
|
1227
1227
|
|
|
1228
1228
|
|
|
1229
|
-
<a id="
|
|
1229
|
+
<a id="org631d4fc"></a>
|
|
1230
1230
|
|
|
1231
1231
|
### Paging Context
|
|
1232
1232
|
|
|
@@ -1283,7 +1283,7 @@ You can add line numbers to the display while paging by using the `=` key.
|
|
|
1283
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 `>`.
|
|
1284
1284
|
|
|
1285
1285
|
|
|
1286
|
-
<a id="
|
|
1286
|
+
<a id="org1955da8"></a>
|
|
1287
1287
|
|
|
1288
1288
|
### Searching Output
|
|
1289
1289
|
|
|
@@ -1292,21 +1292,21 @@ While paging, you can initiate a search of the output as indicated in the above
|
|
|
1292
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.
|
|
1293
1293
|
|
|
1294
1294
|
|
|
1295
|
-
<a id="
|
|
1295
|
+
<a id="org515f6c1"></a>
|
|
1296
1296
|
|
|
1297
1297
|
#### String and Regex Search
|
|
1298
1298
|
|
|
1299
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`.
|
|
1300
1300
|
|
|
1301
1301
|
|
|
1302
|
-
<a id="
|
|
1302
|
+
<a id="org95c3d6d"></a>
|
|
1303
1303
|
|
|
1304
1304
|
#### Incremental Search
|
|
1305
1305
|
|
|
1306
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.
|
|
1307
1307
|
|
|
1308
1308
|
|
|
1309
|
-
<a id="
|
|
1309
|
+
<a id="org6f95ba4"></a>
|
|
1310
1310
|
|
|
1311
1311
|
# Configuration
|
|
1312
1312
|
|
|
@@ -1324,7 +1324,7 @@ The default user-specific configuration directory follows `XDG_CONFIG_HOME` if i
|
|
|
1324
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.
|
|
1325
1325
|
|
|
1326
1326
|
|
|
1327
|
-
<a id="
|
|
1327
|
+
<a id="org527a730"></a>
|
|
1328
1328
|
|
|
1329
1329
|
## General Configuration `config.yml`
|
|
1330
1330
|
|
|
@@ -1347,7 +1347,7 @@ truecolor: auto
|
|
|
1347
1347
|
```
|
|
1348
1348
|
|
|
1349
1349
|
|
|
1350
|
-
<a id="
|
|
1350
|
+
<a id="orga7437eb"></a>
|
|
1351
1351
|
|
|
1352
1352
|
### `word_char_re`
|
|
1353
1353
|
|
|
@@ -1370,7 +1370,7 @@ word_char_re: "[[:alnum:]_.:-]"
|
|
|
1370
1370
|
```
|
|
1371
1371
|
|
|
1372
1372
|
|
|
1373
|
-
<a id="
|
|
1373
|
+
<a id="orgbc44962"></a>
|
|
1374
1374
|
|
|
1375
1375
|
### `esc_delay`
|
|
1376
1376
|
|
|
@@ -1381,26 +1381,26 @@ esc_delay: 0
|
|
|
1381
1381
|
```
|
|
1382
1382
|
|
|
1383
1383
|
|
|
1384
|
-
<a id="
|
|
1384
|
+
<a id="org98167b2"></a>
|
|
1385
1385
|
|
|
1386
1386
|
### `history`
|
|
1387
1387
|
|
|
1388
1388
|
|
|
1389
|
-
<a id="
|
|
1389
|
+
<a id="orgbb482e5"></a>
|
|
1390
1390
|
|
|
1391
1391
|
#### `file`
|
|
1392
1392
|
|
|
1393
1393
|
The path to the history file to use, by default `~/.fatty_history`
|
|
1394
1394
|
|
|
1395
1395
|
|
|
1396
|
-
<a id="
|
|
1396
|
+
<a id="orgf0bf225"></a>
|
|
1397
1397
|
|
|
1398
1398
|
#### `max`
|
|
1399
1399
|
|
|
1400
1400
|
The maximum number of lines of history retained, by default 10,000.
|
|
1401
1401
|
|
|
1402
1402
|
|
|
1403
|
-
<a id="
|
|
1403
|
+
<a id="org418fc0e"></a>
|
|
1404
1404
|
|
|
1405
1405
|
### `theme`
|
|
1406
1406
|
|
|
@@ -1411,7 +1411,7 @@ theme: nordic
|
|
|
1411
1411
|
```
|
|
1412
1412
|
|
|
1413
1413
|
|
|
1414
|
-
<a id="
|
|
1414
|
+
<a id="org64a8fae"></a>
|
|
1415
1415
|
|
|
1416
1416
|
### `truecolor`
|
|
1417
1417
|
|
|
@@ -1422,7 +1422,7 @@ truecolor: auto
|
|
|
1422
1422
|
```
|
|
1423
1423
|
|
|
1424
1424
|
|
|
1425
|
-
<a id="
|
|
1425
|
+
<a id="orga395022"></a>
|
|
1426
1426
|
|
|
1427
1427
|
### `log`
|
|
1428
1428
|
|
|
@@ -1444,14 +1444,14 @@ tags:
|
|
|
1444
1444
|
```
|
|
1445
1445
|
|
|
1446
1446
|
|
|
1447
|
-
<a id="
|
|
1447
|
+
<a id="orgaccae98"></a>
|
|
1448
1448
|
|
|
1449
1449
|
#### `file`
|
|
1450
1450
|
|
|
1451
1451
|
The path to the log file to use.
|
|
1452
1452
|
|
|
1453
1453
|
|
|
1454
|
-
<a id="
|
|
1454
|
+
<a id="org7393b5b"></a>
|
|
1455
1455
|
|
|
1456
1456
|
#### `level`
|
|
1457
1457
|
|
|
@@ -1463,7 +1463,7 @@ Can be one of the following
|
|
|
1463
1463
|
- **`debug`:** detailed messages to assist debugging `fatty` plus all of the above.
|
|
1464
1464
|
|
|
1465
1465
|
|
|
1466
|
-
<a id="
|
|
1466
|
+
<a id="org9f2527d"></a>
|
|
1467
1467
|
|
|
1468
1468
|
#### `tags`
|
|
1469
1469
|
|
|
@@ -1481,7 +1481,7 @@ tags:
|
|
|
1481
1481
|
```
|
|
1482
1482
|
|
|
1483
1483
|
|
|
1484
|
-
<a id="
|
|
1484
|
+
<a id="orgca2818e"></a>
|
|
1485
1485
|
|
|
1486
1486
|
## Key code definitions `keydefs.yml`
|
|
1487
1487
|
|
|
@@ -1643,7 +1643,7 @@ konsole:
|
|
|
1643
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`!).
|
|
1644
1644
|
|
|
1645
1645
|
|
|
1646
|
-
<a id="
|
|
1646
|
+
<a id="org237063c"></a>
|
|
1647
1647
|
|
|
1648
1648
|
## Key bindings `keybindings.yml`
|
|
1649
1649
|
|
|
@@ -1670,7 +1670,7 @@ A keybinding names a key chord, the context in which it applies, and the Fatty a
|
|
|
1670
1670
|
```
|
|
1671
1671
|
|
|
1672
1672
|
|
|
1673
|
-
<a id="
|
|
1673
|
+
<a id="orgbae3eeb"></a>
|
|
1674
1674
|
|
|
1675
1675
|
### Key Names
|
|
1676
1676
|
|
|
@@ -1684,7 +1684,7 @@ A keybinding uses the unmodified key name under the `key` field:
|
|
|
1684
1684
|
```
|
|
1685
1685
|
|
|
1686
1686
|
|
|
1687
|
-
<a id="
|
|
1687
|
+
<a id="orgf8dac7c"></a>
|
|
1688
1688
|
|
|
1689
1689
|
#### Printable Keys
|
|
1690
1690
|
|
|
@@ -1700,7 +1700,7 @@ Most printable keys can be written as the character itself. Quote keys that YAML
|
|
|
1700
1700
|
```
|
|
1701
1701
|
|
|
1702
1702
|
|
|
1703
|
-
<a id="
|
|
1703
|
+
<a id="orgd9c441a"></a>
|
|
1704
1704
|
|
|
1705
1705
|
#### Curses and Fatty Named Keys
|
|
1706
1706
|
|
|
@@ -1725,7 +1725,7 @@ Some terminals can report application-keypad sequences such as `keypad_divide`,
|
|
|
1725
1725
|
- `space`
|
|
1726
1726
|
|
|
1727
1727
|
|
|
1728
|
-
<a id="
|
|
1728
|
+
<a id="org2bda549"></a>
|
|
1729
1729
|
|
|
1730
1730
|
#### Possibly Invisible Keys
|
|
1731
1731
|
|
|
@@ -1734,7 +1734,7 @@ Some physical keys may never reach Fatty at all. They may be handled by the keyb
|
|
|
1734
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.
|
|
1735
1735
|
|
|
1736
1736
|
|
|
1737
|
-
<a id="
|
|
1737
|
+
<a id="org4f3759a"></a>
|
|
1738
1738
|
|
|
1739
1739
|
#### Unnamed but Recognized Keys
|
|
1740
1740
|
|
|
@@ -1759,7 +1759,7 @@ Then bind it in `keybindings.yml`:
|
|
|
1759
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`.
|
|
1760
1760
|
|
|
1761
1761
|
|
|
1762
|
-
<a id="
|
|
1762
|
+
<a id="org9cddd93"></a>
|
|
1763
1763
|
|
|
1764
1764
|
### Mouse Events
|
|
1765
1765
|
|
|
@@ -1794,7 +1794,7 @@ scroll_down
|
|
|
1794
1794
|
```
|
|
1795
1795
|
|
|
1796
1796
|
|
|
1797
|
-
<a id="
|
|
1797
|
+
<a id="org46a0d38"></a>
|
|
1798
1798
|
|
|
1799
1799
|
### Modifiers
|
|
1800
1800
|
|
|
@@ -1807,7 +1807,7 @@ shift: true
|
|
|
1807
1807
|
```
|
|
1808
1808
|
|
|
1809
1809
|
|
|
1810
|
-
<a id="
|
|
1810
|
+
<a id="orga4b4c40"></a>
|
|
1811
1811
|
|
|
1812
1812
|
### Contexts
|
|
1813
1813
|
|
|
@@ -1841,7 +1841,7 @@ The available contexts are:
|
|
|
1841
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.
|
|
1842
1842
|
|
|
1843
1843
|
|
|
1844
|
-
<a id="
|
|
1844
|
+
<a id="orga9fd42d"></a>
|
|
1845
1845
|
|
|
1846
1846
|
### Actions
|
|
1847
1847
|
|
|
@@ -1869,7 +1869,7 @@ Most movement, deletion, history, completion, paging, and popup-navigation actio
|
|
|
1869
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.
|
|
1870
1870
|
|
|
1871
1871
|
|
|
1872
|
-
<a id="
|
|
1872
|
+
<a id="org9661d90"></a>
|
|
1873
1873
|
|
|
1874
1874
|
#### Input buffer actions
|
|
1875
1875
|
|
|
@@ -1912,7 +1912,7 @@ Terminology notes:
|
|
|
1912
1912
|
| yank\_pop | Yes | Copy next kill ring item and replace prior |
|
|
1913
1913
|
|
|
1914
1914
|
|
|
1915
|
-
<a id="
|
|
1915
|
+
<a id="org2c1d151"></a>
|
|
1916
1916
|
|
|
1917
1917
|
#### Input field actions
|
|
1918
1918
|
|
|
@@ -1925,7 +1925,7 @@ Input field actions operate on an editable input field. An input field occurs at
|
|
|
1925
1925
|
| history\_next | No | Insert the next relevant history item in the input field |
|
|
1926
1926
|
|
|
1927
1927
|
|
|
1928
|
-
<a id="
|
|
1928
|
+
<a id="orgdab317e"></a>
|
|
1929
1929
|
|
|
1930
1930
|
#### Shell session actions
|
|
1931
1931
|
|
|
@@ -1946,7 +1946,7 @@ Shell session actions operate at the session level around the main command input
|
|
|
1946
1946
|
| universal\_argument | No | Set the numeric argument to 4 or multiply the current one by 4 |
|
|
1947
1947
|
|
|
1948
1948
|
|
|
1949
|
-
<a id="
|
|
1949
|
+
<a id="org79f8625"></a>
|
|
1950
1950
|
|
|
1951
1951
|
#### Pager actions
|
|
1952
1952
|
|
|
@@ -1968,7 +1968,7 @@ Pager actions navigate output when the output area is in paging mode. They move
|
|
|
1968
1968
|
| quit\_paging | No | Quit paging and return control to the input line |
|
|
1969
1969
|
|
|
1970
1970
|
|
|
1971
|
-
<a id="
|
|
1971
|
+
<a id="org781ce4c"></a>
|
|
1972
1972
|
|
|
1973
1973
|
#### Pager search actions
|
|
1974
1974
|
|
|
@@ -1997,7 +1997,7 @@ While the search session is active, accepting commits the current match and canc
|
|
|
1997
1997
|
| isearch\_cancel | No | Cancel the active incremental search and restore its starting point |
|
|
1998
1998
|
|
|
1999
1999
|
|
|
2000
|
-
<a id="
|
|
2000
|
+
<a id="orgad5cec2"></a>
|
|
2001
2001
|
|
|
2002
2002
|
#### Popup actions
|
|
2003
2003
|
|
|
@@ -2017,7 +2017,7 @@ Popup actions control selection and narrowing popups such as choose, menu, compl
|
|
|
2017
2017
|
| popup\_toggle\_selected | No | In multi-select, toggle the selection of the current item |
|
|
2018
2018
|
|
|
2019
2019
|
|
|
2020
|
-
<a id="
|
|
2020
|
+
<a id="orgf23b2b8"></a>
|
|
2021
2021
|
|
|
2022
2022
|
#### Prompt popup actions
|
|
2023
2023
|
|
|
@@ -2030,7 +2030,7 @@ Prompt popup actions control prompt dialogs that collect a string from the user.
|
|
|
2030
2030
|
| prompt\_cancel\_if\_empty | No | Cancel only if the input buffer is empty |
|
|
2031
2031
|
|
|
2032
2032
|
|
|
2033
|
-
<a id="
|
|
2033
|
+
<a id="orgae819a8"></a>
|
|
2034
2034
|
|
|
2035
2035
|
#### Utility Actions
|
|
2036
2036
|
|
|
@@ -2045,12 +2045,12 @@ Some actions exist to support `Fatty`'s own input machinery and are not normally
|
|
|
2045
2045
|
| paste | str | No | Insert pasted text at point |
|
|
2046
2046
|
|
|
2047
2047
|
|
|
2048
|
-
<a id="
|
|
2048
|
+
<a id="org59eb5c3"></a>
|
|
2049
2049
|
|
|
2050
2050
|
## Themes `themes/`
|
|
2051
2051
|
|
|
2052
2052
|
|
|
2053
|
-
<a id="
|
|
2053
|
+
<a id="org4005bd7"></a>
|
|
2054
2054
|
|
|
2055
2055
|
### Distributed Themes
|
|
2056
2056
|
|
|
@@ -2086,12 +2086,12 @@ Here are the builtin themes:
|
|
|
2086
2086
|
| wordperfect | Nostalgic nod to the good old word processor |
|
|
2087
2087
|
|
|
2088
2088
|
|
|
2089
|
-
<a id="
|
|
2089
|
+
<a id="org3ac59e9"></a>
|
|
2090
2090
|
|
|
2091
2091
|
### Custom Themes
|
|
2092
2092
|
|
|
2093
2093
|
|
|
2094
|
-
<a id="
|
|
2094
|
+
<a id="org5ee688b"></a>
|
|
2095
2095
|
|
|
2096
2096
|
#### Theme Name
|
|
2097
2097
|
|
|
@@ -2102,7 +2102,7 @@ name: nordic
|
|
|
2102
2102
|
```
|
|
2103
2103
|
|
|
2104
2104
|
|
|
2105
|
-
<a id="
|
|
2105
|
+
<a id="org630eba6"></a>
|
|
2106
2106
|
|
|
2107
2107
|
#### Inheritance from Another Theme
|
|
2108
2108
|
|
|
@@ -2119,7 +2119,7 @@ fg: "#eeeeee"
|
|
|
2119
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.
|
|
2120
2120
|
|
|
2121
2121
|
|
|
2122
|
-
<a id="
|
|
2122
|
+
<a id="org70a1774"></a>
|
|
2123
2123
|
|
|
2124
2124
|
#### Inheritance within a Theme
|
|
2125
2125
|
|
|
@@ -2139,7 +2139,7 @@ output:
|
|
|
2139
2139
|
This means that the input field will have the same coloring and attributes as the output pane.
|
|
2140
2140
|
|
|
2141
2141
|
|
|
2142
|
-
<a id="
|
|
2142
|
+
<a id="org8618ea1"></a>
|
|
2143
2143
|
|
|
2144
2144
|
#### Theme Roles
|
|
2145
2145
|
|
|
@@ -2186,7 +2186,7 @@ Here is a listing of what roles act as the parent for each of the roles, their p
|
|
|
2186
2186
|
| `markdown_hrule` | Markdown horizontal rules. | `output` |
|
|
2187
2187
|
|
|
2188
2188
|
|
|
2189
|
-
<a id="
|
|
2189
|
+
<a id="org004fbd0"></a>
|
|
2190
2190
|
|
|
2191
2191
|
#### Role Colors and Attributes and Frame Style
|
|
2192
2192
|
|
|
@@ -2309,7 +2309,7 @@ Each role can have assigned to it a foreground color (`fg:`), a background color
|
|
|
2309
2309
|
```
|
|
2310
2310
|
|
|
2311
2311
|
|
|
2312
|
-
<a id="
|
|
2312
|
+
<a id="org83394c1"></a>
|
|
2313
2313
|
|
|
2314
2314
|
### The `themer` helper
|
|
2315
2315
|
|
|
@@ -2381,7 +2381,7 @@ error:
|
|
|
2381
2381
|
```
|
|
2382
2382
|
|
|
2383
2383
|
|
|
2384
|
-
<a id="
|
|
2384
|
+
<a id="org53b18ca"></a>
|
|
2385
2385
|
|
|
2386
2386
|
# Windows differences
|
|
2387
2387
|
|
|
@@ -2400,7 +2400,7 @@ All demo commands have been tested on Windows 11 with RubyInstaller 3.4. Compare
|
|
|
2400
2400
|
- Exiting Fatty does not restore a saved copy of the screen that was visible before startup.
|
|
2401
2401
|
|
|
2402
2402
|
|
|
2403
|
-
<a id="
|
|
2403
|
+
<a id="orgd6e15b8"></a>
|
|
2404
2404
|
|
|
2405
2405
|
## Curses dependency
|
|
2406
2406
|
|
data/README.org
CHANGED
|
@@ -49,8 +49,9 @@ module Fatty
|
|
|
49
49
|
|
|
50
50
|
attr_reader :context, :key_decoder
|
|
51
51
|
|
|
52
|
-
def initialize(context: Context.new, key_decoder: nil, poll_ms: 200)
|
|
52
|
+
def initialize(context: Context.new, key_decoder: nil, poll_ms: 200, window_provider: nil)
|
|
53
53
|
@context = context
|
|
54
|
+
@window_provider = window_provider
|
|
54
55
|
@key_decoder = key_decoder || KeyDecoder.new
|
|
55
56
|
@poll_ms = poll_ms.to_i
|
|
56
57
|
configure_input_polling!
|
|
@@ -111,7 +112,13 @@ module Fatty
|
|
|
111
112
|
end
|
|
112
113
|
|
|
113
114
|
def window
|
|
114
|
-
|
|
115
|
+
modal_window = @window_provider&.call
|
|
116
|
+
if modal_window
|
|
117
|
+
modal_window.keypad(true)
|
|
118
|
+
modal_window
|
|
119
|
+
else
|
|
120
|
+
context.input_win
|
|
121
|
+
end
|
|
115
122
|
end
|
|
116
123
|
|
|
117
124
|
def configure_input_polling!
|
data/lib/fatty/terminal.rb
CHANGED
|
@@ -628,10 +628,26 @@ module Fatty
|
|
|
628
628
|
@env ||= Fatty::Env.detect
|
|
629
629
|
key_decoder = Fatty::Curses::KeyDecoder.new(env: @env)
|
|
630
630
|
@event_source =
|
|
631
|
-
Fatty::Curses::EventSource.new(
|
|
631
|
+
Fatty::Curses::EventSource.new(
|
|
632
|
+
context: @ctx,
|
|
633
|
+
key_decoder: key_decoder,
|
|
634
|
+
poll_ms: 50,
|
|
635
|
+
window_provider: -> { modal_input_window },
|
|
636
|
+
)
|
|
632
637
|
self
|
|
633
638
|
end
|
|
634
639
|
|
|
640
|
+
# PDCurses wgetch moves the physical cursor to the window being read.
|
|
641
|
+
# Read from the top modal so polling cannot repaint the shell over it.
|
|
642
|
+
# Truecolor paints with ANSI and must keep its existing curses input window.
|
|
643
|
+
def modal_input_window
|
|
644
|
+
return if @ctx.truecolor
|
|
645
|
+
|
|
646
|
+
session = @modal_stack.last&.fetch(:session)
|
|
647
|
+
# Paging/help/search sessions can be modal without owning a popup window.
|
|
648
|
+
session.win if session.respond_to?(:win)
|
|
649
|
+
end
|
|
650
|
+
|
|
635
651
|
# --- Shutdown ---------------------------------------------------------
|
|
636
652
|
|
|
637
653
|
def cleanup_after_go
|
data/lib/fatty/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fatty
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.99.12.
|
|
4
|
+
version: 0.99.12.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Daniel E. Doherty
|
|
8
8
|
bindir: exe
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-11-
|
|
10
|
+
date: 2026-11-27 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: fat_config
|