fatty 0.99.0 → 0.99.3
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 +11 -29
- data/README.md +2207 -18
- data/README.org +2066 -104
- data/exe/fatty +236 -93
- data/help/help.md +233 -0
- data/lib/fatty/action.rb +3 -7
- data/lib/fatty/actionable.rb +2 -0
- data/lib/fatty/alert.rb +65 -39
- data/lib/fatty/ansi/renderer.rb +26 -6
- data/lib/fatty/ansi.rb +1 -0
- data/lib/fatty/api/alert.rb +15 -0
- data/lib/fatty/api/choose.rb +145 -0
- data/lib/fatty/api/environment.rb +12 -0
- data/lib/fatty/api/keytest.rb +11 -0
- data/lib/fatty/api/menu.rb +104 -0
- data/lib/fatty/api/output.rb +55 -0
- data/lib/fatty/api/progress.rb +24 -0
- data/lib/fatty/api/prompt.rb +77 -0
- data/lib/fatty/api/status.rb +55 -0
- data/lib/fatty/api.rb +38 -0
- data/lib/fatty/callback_environment.rb +74 -0
- data/lib/fatty/colors/color.rb +366 -232
- data/lib/fatty/colors/pairs.rb +2 -0
- data/lib/fatty/command.rb +78 -0
- data/lib/fatty/config.rb +227 -39
- data/lib/fatty/config_files/config.yml +4 -12
- data/lib/fatty/config_files/keydefs.yml +13 -23
- data/lib/fatty/config_files/themes/capuchin_monk.yml +140 -0
- data/lib/fatty/config_files/themes/catppuccin_latte.yml +140 -0
- data/lib/fatty/config_files/themes/catppuccin_mocha.yml +140 -0
- data/lib/fatty/config_files/themes/cyberpunk.yml +141 -0
- data/lib/fatty/config_files/themes/dracula.yml +140 -0
- data/lib/fatty/config_files/themes/everforest_dark.yml +140 -0
- data/lib/fatty/config_files/themes/gruvbox_dark.yml +140 -0
- data/lib/fatty/config_files/themes/gruvbox_light.yml +140 -0
- data/lib/fatty/config_files/themes/mono.yml +119 -47
- data/lib/fatty/config_files/themes/monokai.yml +140 -0
- data/lib/fatty/config_files/themes/nordic.yml +1 -0
- data/lib/fatty/config_files/themes/onedark.yml +140 -0
- data/lib/fatty/config_files/themes/solarized_dark.yml +1 -0
- data/lib/fatty/config_files/themes/solarized_light.yml +140 -0
- data/lib/fatty/config_files/themes/terminal.yml +67 -0
- data/lib/fatty/config_files/themes/tokyo_night.yml +140 -0
- data/lib/fatty/config_files/themes/wordperfect.yml +80 -9
- data/lib/fatty/core_ext/hash.rb +19 -0
- data/lib/fatty/core_ext/string.rb +19 -12
- data/lib/fatty/core_ext.rb +1 -0
- data/lib/fatty/curses/context.rb +86 -84
- data/lib/fatty/curses/event_source.rb +128 -40
- data/lib/fatty/curses/key_decoder.rb +77 -11
- data/lib/fatty/env.rb +21 -20
- data/lib/fatty/help.rb +1 -29
- data/lib/fatty/history/entry.rb +2 -0
- data/lib/fatty/history.rb +17 -14
- data/lib/fatty/input_buffer.rb +71 -47
- data/lib/fatty/input_field.rb +216 -149
- data/lib/fatty/key_event.rb +67 -66
- data/lib/fatty/key_map.rb +54 -16
- data/lib/fatty/keymaps/emacs.rb +40 -6
- data/lib/fatty/log_formats/json.rb +2 -0
- data/lib/fatty/log_formats/text.rb +2 -0
- data/lib/fatty/logger.rb +7 -2
- data/lib/fatty/markdown/ansi_renderer.rb +75 -6
- data/lib/fatty/markdown/render.rb +2 -3
- data/lib/fatty/mouse_event.rb +142 -2
- data/lib/fatty/output_buffer.rb +2 -0
- data/lib/fatty/pager.rb +158 -47
- data/lib/fatty/progress.rb +417 -0
- data/lib/fatty/renderer/curses.rb +340 -184
- data/lib/fatty/renderer/truecolor.rb +266 -163
- data/lib/fatty/renderer.rb +115 -97
- data/lib/fatty/screen.rb +2 -0
- data/lib/fatty/session/alert_session.rb +39 -21
- data/lib/fatty/session/isearch_session.rb +92 -38
- data/lib/fatty/session/keytest_session.rb +105 -85
- data/lib/fatty/session/modal_session.rb +38 -1
- data/lib/fatty/session/output_session.rb +472 -21
- data/lib/fatty/session/popup_session.rb +251 -134
- data/lib/fatty/session/prompt_session.rb +68 -26
- data/lib/fatty/session/search_session.rb +79 -31
- data/lib/fatty/session/shell_session.rb +383 -368
- data/lib/fatty/session/status_session.rb +167 -0
- data/lib/fatty/session.rb +95 -95
- data/lib/fatty/terminal/popup_owner.rb +14 -11
- data/lib/fatty/terminal.rb +515 -813
- data/lib/fatty/themes/loader.rb +4 -2
- data/lib/fatty/themes/manager.rb +4 -0
- data/lib/fatty/themes/registry.rb +2 -0
- data/lib/fatty/themes/resolver.rb +175 -162
- data/lib/fatty/version.rb +1 -1
- data/lib/fatty/viewport.rb +8 -1
- data/lib/fatty.rb +35 -7
- metadata +42 -40
- data/.envrc +0 -2
- data/.simplecov +0 -23
- data/.yardopts +0 -4
- data/CHANGELOG.md +0 -34
- data/Rakefile +0 -15
- data/TODO.org +0 -163
- data/examples/markdown/native-markdown.md +0 -370
- data/examples/markdown/ox-gfm-markdown.md +0 -373
- data/examples/markdown/ox-gfm-markdown.org +0 -376
- data/fatty.gemspec +0 -42
- data/lib/fatty/accept_env.rb +0 -32
- data/lib/fatty/config_files/help.md +0 -120
- data/lib/fatty/config_files/help.org +0 -124
- data/lib/fatty/config_files/themes/wordperfect_light.yml +0 -77
- data/lib/fatty/menu_env.rb +0 -22
- data/lib/fatty/session/input_session.rb +0 -99
- data/lib/fatty/sessions.rb +0 -14
- data/lib/fatty/terminal/progress.rb +0 -374
- data/lib/fatty/view/alert_view.rb +0 -14
- data/lib/fatty/view/cursor_view.rb +0 -18
- data/lib/fatty/view/input_view.rb +0 -9
- data/lib/fatty/view/output_view.rb +0 -9
- data/lib/fatty/view/status_view.rb +0 -14
- data/lib/fatty/view.rb +0 -33
- data/lib/fatty/views.rb +0 -9
- data/sig/fatty.rbs +0 -4
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fatty
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.99.
|
|
4
|
+
version: 0.99.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Daniel E. Doherty
|
|
@@ -38,21 +38,21 @@ dependencies:
|
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
39
|
version: 0.8.0
|
|
40
40
|
- !ruby/object:Gem::Dependency
|
|
41
|
-
name:
|
|
41
|
+
name: rainbow
|
|
42
42
|
requirement: !ruby/object:Gem::Requirement
|
|
43
43
|
requirements:
|
|
44
|
-
- - "
|
|
44
|
+
- - ">="
|
|
45
45
|
- !ruby/object:Gem::Version
|
|
46
|
-
version: '
|
|
46
|
+
version: '0'
|
|
47
47
|
type: :runtime
|
|
48
48
|
prerelease: false
|
|
49
49
|
version_requirements: !ruby/object:Gem::Requirement
|
|
50
50
|
requirements:
|
|
51
|
-
- - "
|
|
51
|
+
- - ">="
|
|
52
52
|
- !ruby/object:Gem::Version
|
|
53
|
-
version: '
|
|
53
|
+
version: '0'
|
|
54
54
|
- !ruby/object:Gem::Dependency
|
|
55
|
-
name:
|
|
55
|
+
name: redcarpet
|
|
56
56
|
requirement: !ruby/object:Gem::Requirement
|
|
57
57
|
requirements:
|
|
58
58
|
- - ">="
|
|
@@ -66,7 +66,7 @@ dependencies:
|
|
|
66
66
|
- !ruby/object:Gem::Version
|
|
67
67
|
version: '0'
|
|
68
68
|
- !ruby/object:Gem::Dependency
|
|
69
|
-
name:
|
|
69
|
+
name: rouge
|
|
70
70
|
requirement: !ruby/object:Gem::Requirement
|
|
71
71
|
requirements:
|
|
72
72
|
- - ">="
|
|
@@ -80,21 +80,21 @@ dependencies:
|
|
|
80
80
|
- !ruby/object:Gem::Version
|
|
81
81
|
version: '0'
|
|
82
82
|
- !ruby/object:Gem::Dependency
|
|
83
|
-
name:
|
|
83
|
+
name: unicode-display_width
|
|
84
84
|
requirement: !ruby/object:Gem::Requirement
|
|
85
85
|
requirements:
|
|
86
|
-
- - "
|
|
86
|
+
- - "~>"
|
|
87
87
|
- !ruby/object:Gem::Version
|
|
88
|
-
version: '
|
|
88
|
+
version: '2.5'
|
|
89
89
|
type: :runtime
|
|
90
90
|
prerelease: false
|
|
91
91
|
version_requirements: !ruby/object:Gem::Requirement
|
|
92
92
|
requirements:
|
|
93
|
-
- - "
|
|
93
|
+
- - "~>"
|
|
94
94
|
- !ruby/object:Gem::Version
|
|
95
|
-
version: '
|
|
95
|
+
version: '2.5'
|
|
96
96
|
- !ruby/object:Gem::Dependency
|
|
97
|
-
name:
|
|
97
|
+
name: yaml
|
|
98
98
|
requirement: !ruby/object:Gem::Requirement
|
|
99
99
|
requirements:
|
|
100
100
|
- - ">="
|
|
@@ -117,47 +117,59 @@ executables:
|
|
|
117
117
|
extensions: []
|
|
118
118
|
extra_rdoc_files: []
|
|
119
119
|
files:
|
|
120
|
-
- ".envrc"
|
|
121
|
-
- ".simplecov"
|
|
122
|
-
- ".yardopts"
|
|
123
|
-
- CHANGELOG.md
|
|
124
120
|
- CHANGELOG.org
|
|
125
121
|
- LICENSE.txt
|
|
126
122
|
- README.md
|
|
127
123
|
- README.org
|
|
128
|
-
- Rakefile
|
|
129
|
-
- TODO.org
|
|
130
|
-
- examples/markdown/native-markdown.md
|
|
131
|
-
- examples/markdown/ox-gfm-markdown.md
|
|
132
|
-
- examples/markdown/ox-gfm-markdown.org
|
|
133
124
|
- exe/fatty
|
|
134
|
-
-
|
|
125
|
+
- help/help.md
|
|
135
126
|
- lib/fatty.rb
|
|
136
|
-
- lib/fatty/accept_env.rb
|
|
137
127
|
- lib/fatty/action.rb
|
|
138
128
|
- lib/fatty/action_environment.rb
|
|
139
129
|
- lib/fatty/actionable.rb
|
|
140
130
|
- lib/fatty/alert.rb
|
|
141
131
|
- lib/fatty/ansi.rb
|
|
142
132
|
- lib/fatty/ansi/renderer.rb
|
|
133
|
+
- lib/fatty/api.rb
|
|
134
|
+
- lib/fatty/api/alert.rb
|
|
135
|
+
- lib/fatty/api/choose.rb
|
|
136
|
+
- lib/fatty/api/environment.rb
|
|
137
|
+
- lib/fatty/api/keytest.rb
|
|
138
|
+
- lib/fatty/api/menu.rb
|
|
139
|
+
- lib/fatty/api/output.rb
|
|
140
|
+
- lib/fatty/api/progress.rb
|
|
141
|
+
- lib/fatty/api/prompt.rb
|
|
142
|
+
- lib/fatty/api/status.rb
|
|
143
|
+
- lib/fatty/callback_environment.rb
|
|
143
144
|
- lib/fatty/colors.rb
|
|
144
145
|
- lib/fatty/colors/color.rb
|
|
145
146
|
- lib/fatty/colors/pairs.rb
|
|
146
147
|
- lib/fatty/colors/palette.rb
|
|
147
148
|
- lib/fatty/colors/rgb.txt
|
|
149
|
+
- lib/fatty/command.rb
|
|
148
150
|
- lib/fatty/config.rb
|
|
149
151
|
- lib/fatty/config_files/config.yml
|
|
150
|
-
- lib/fatty/config_files/help.md
|
|
151
|
-
- lib/fatty/config_files/help.org
|
|
152
152
|
- lib/fatty/config_files/keybindings.yml
|
|
153
153
|
- lib/fatty/config_files/keydefs.yml
|
|
154
|
+
- lib/fatty/config_files/themes/capuchin_monk.yml
|
|
155
|
+
- lib/fatty/config_files/themes/catppuccin_latte.yml
|
|
156
|
+
- lib/fatty/config_files/themes/catppuccin_mocha.yml
|
|
157
|
+
- lib/fatty/config_files/themes/cyberpunk.yml
|
|
158
|
+
- lib/fatty/config_files/themes/dracula.yml
|
|
159
|
+
- lib/fatty/config_files/themes/everforest_dark.yml
|
|
160
|
+
- lib/fatty/config_files/themes/gruvbox_dark.yml
|
|
161
|
+
- lib/fatty/config_files/themes/gruvbox_light.yml
|
|
154
162
|
- lib/fatty/config_files/themes/mono.yml
|
|
163
|
+
- lib/fatty/config_files/themes/monokai.yml
|
|
155
164
|
- lib/fatty/config_files/themes/nordic.yml
|
|
165
|
+
- lib/fatty/config_files/themes/onedark.yml
|
|
156
166
|
- lib/fatty/config_files/themes/solarized_dark.yml
|
|
167
|
+
- lib/fatty/config_files/themes/solarized_light.yml
|
|
157
168
|
- lib/fatty/config_files/themes/terminal.yml
|
|
169
|
+
- lib/fatty/config_files/themes/tokyo_night.yml
|
|
158
170
|
- lib/fatty/config_files/themes/wordperfect.yml
|
|
159
|
-
- lib/fatty/config_files/themes/wordperfect_light.yml
|
|
160
171
|
- lib/fatty/core_ext.rb
|
|
172
|
+
- lib/fatty/core_ext/hash.rb
|
|
161
173
|
- lib/fatty/core_ext/string.rb
|
|
162
174
|
- lib/fatty/counter.rb
|
|
163
175
|
- lib/fatty/curses.rb
|
|
@@ -182,10 +194,10 @@ files:
|
|
|
182
194
|
- lib/fatty/markdown.rb
|
|
183
195
|
- lib/fatty/markdown/ansi_renderer.rb
|
|
184
196
|
- lib/fatty/markdown/render.rb
|
|
185
|
-
- lib/fatty/menu_env.rb
|
|
186
197
|
- lib/fatty/mouse_event.rb
|
|
187
198
|
- lib/fatty/output_buffer.rb
|
|
188
199
|
- lib/fatty/pager.rb
|
|
200
|
+
- lib/fatty/progress.rb
|
|
189
201
|
- lib/fatty/prompt.rb
|
|
190
202
|
- lib/fatty/renderer.rb
|
|
191
203
|
- lib/fatty/renderer/curses.rb
|
|
@@ -194,7 +206,6 @@ files:
|
|
|
194
206
|
- lib/fatty/search.rb
|
|
195
207
|
- lib/fatty/session.rb
|
|
196
208
|
- lib/fatty/session/alert_session.rb
|
|
197
|
-
- lib/fatty/session/input_session.rb
|
|
198
209
|
- lib/fatty/session/isearch_session.rb
|
|
199
210
|
- lib/fatty/session/keytest_session.rb
|
|
200
211
|
- lib/fatty/session/modal_session.rb
|
|
@@ -203,10 +214,9 @@ files:
|
|
|
203
214
|
- lib/fatty/session/prompt_session.rb
|
|
204
215
|
- lib/fatty/session/search_session.rb
|
|
205
216
|
- lib/fatty/session/shell_session.rb
|
|
206
|
-
- lib/fatty/
|
|
217
|
+
- lib/fatty/session/status_session.rb
|
|
207
218
|
- lib/fatty/terminal.rb
|
|
208
219
|
- lib/fatty/terminal/popup_owner.rb
|
|
209
|
-
- lib/fatty/terminal/progress.rb
|
|
210
220
|
- lib/fatty/themes.rb
|
|
211
221
|
- lib/fatty/themes/loader.rb
|
|
212
222
|
- lib/fatty/themes/manager.rb
|
|
@@ -214,15 +224,7 @@ files:
|
|
|
214
224
|
- lib/fatty/themes/resolver.rb
|
|
215
225
|
- lib/fatty/themes/themes.rb
|
|
216
226
|
- lib/fatty/version.rb
|
|
217
|
-
- lib/fatty/view.rb
|
|
218
|
-
- lib/fatty/view/alert_view.rb
|
|
219
|
-
- lib/fatty/view/cursor_view.rb
|
|
220
|
-
- lib/fatty/view/input_view.rb
|
|
221
|
-
- lib/fatty/view/output_view.rb
|
|
222
|
-
- lib/fatty/view/status_view.rb
|
|
223
227
|
- lib/fatty/viewport.rb
|
|
224
|
-
- lib/fatty/views.rb
|
|
225
|
-
- sig/fatty.rbs
|
|
226
228
|
homepage: https://github.com/ddoherty03/fatty
|
|
227
229
|
licenses:
|
|
228
230
|
- MIT
|
data/.envrc
DELETED
data/.simplecov
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
SimpleCov.start do
|
|
2
|
-
track_files "lib/**/*.rb"
|
|
3
|
-
|
|
4
|
-
# any custom configs like groups and filters can be here at a central place
|
|
5
|
-
add_filter %r{^/spec/}
|
|
6
|
-
add_filter %r{^/bin/}
|
|
7
|
-
add_filter %r{^/doc/}
|
|
8
|
-
add_filter %r{^/sig/}
|
|
9
|
-
add_filter %r{^/coverage/}
|
|
10
|
-
add_filter %r{^/\.yardoc/}
|
|
11
|
-
add_filter %r{^/\.ruby-lsp/}
|
|
12
|
-
add_filter %r{^/\.git/}
|
|
13
|
-
add_filter %r{^/\.githib/}
|
|
14
|
-
|
|
15
|
-
add_group "Core", %r{^/lib/fatty/[^/]*\.rb}
|
|
16
|
-
add_group "Views", %r{^/lib/fatty/view/[^/]*\.rb}
|
|
17
|
-
add_group "Sessions", %r{^/lib/fatty/session/[^/]*\.rb}
|
|
18
|
-
add_group "Curses", %r{^/lib/fatty/backends/curses/[^/]*\.rb}
|
|
19
|
-
merge_timeout 3600
|
|
20
|
-
# Make this true to merge rspec and cucumber coverage together
|
|
21
|
-
use_merging false
|
|
22
|
-
# enable_coverage :branch
|
|
23
|
-
end
|
data/.yardopts
DELETED
data/CHANGELOG.md
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
- [Version 0.5.0 <span class="timestamp-wrapper"><span class="timestamp">[2026-05-03 Sun]</span></span>](#orgb0bc550)
|
|
2
|
-
- [Version 0.4.0 <span class="timestamp-wrapper"><span class="timestamp">[2026-04-30 Thu]</span></span>](#org805c7ee)
|
|
3
|
-
- [Version 0.3.0 <span class="timestamp-wrapper"><span class="timestamp">[2025-04-26 Sat]</span></span>](#org2c7a225)
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
<a id="orgb0bc550"></a>
|
|
7
|
-
|
|
8
|
-
# Version 0.5.0 <span class="timestamp-wrapper"><span class="timestamp">[2026-05-03 Sun]</span></span>
|
|
9
|
-
|
|
10
|
-
- Implemented YAML-driven theme system with inheritance, both for themes and for roles within a theme.
|
|
11
|
-
- Themes allow popup frames to be styled now with single or double lines and square or rounded corners.
|
|
12
|
-
- Use the default multi-term matcher for popups
|
|
13
|
-
- Fix auto-completion regression on input line to trigger on self-insert.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
<a id="org805c7ee"></a>
|
|
17
|
-
|
|
18
|
-
# Version 0.4.0 <span class="timestamp-wrapper"><span class="timestamp">[2026-04-30 Thu]</span></span>
|
|
19
|
-
|
|
20
|
-
- Add \`keytest\` interactive keybinding inspector
|
|
21
|
-
- Add markdown rendering support in demo
|
|
22
|
-
- Internal: unified action dispatch system (actionize)
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
<a id="org2c7a225"></a>
|
|
26
|
-
|
|
27
|
-
# Version 0.3.0 <span class="timestamp-wrapper"><span class="timestamp">[2025-04-26 Sat]</span></span>
|
|
28
|
-
|
|
29
|
-
- Change name from fat\_term to fatty: it was too tempting to resist
|
|
30
|
-
- Add widgets for \`choose\` \`choosevals\` \`progress\` \`prompt\` \`menu\` \`choose\_multi\` \`choosevals\_multi\`
|
|
31
|
-
- Add status line
|
|
32
|
-
- Improve scroll speed
|
|
33
|
-
- Add completions and predictive completions
|
|
34
|
-
- Many, many internal improvements
|
data/Rakefile
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "bundler/gem_tasks"
|
|
4
|
-
require "rspec/core/rake_task"
|
|
5
|
-
|
|
6
|
-
RSpec::Core::RakeTask.new(:spec)
|
|
7
|
-
|
|
8
|
-
require "rubocop/rake_task"
|
|
9
|
-
|
|
10
|
-
RuboCop::RakeTask.new
|
|
11
|
-
|
|
12
|
-
require 'gem_docs'
|
|
13
|
-
GemDocs.install
|
|
14
|
-
|
|
15
|
-
task default: %i[spec rubocop]
|
data/TODO.org
DELETED
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
* TODO Horizontal Scrolling
|
|
2
|
-
* TODO Add modes for vi-like keybindings
|
|
3
|
-
- will require changing keybindongs.yml format to include a mode qualifier
|
|
4
|
-
- for advanced two-step actions, e.g. dw, will require an action-pending
|
|
5
|
-
capability
|
|
6
|
-
* DONE Theming
|
|
7
|
-
CLOSED: [2026-05-22 Fri 09:28]
|
|
8
|
-
** Add attributes (like bold to themes)
|
|
9
|
-
So, in themes, this would be possible:
|
|
10
|
-
#+begin_src ruby
|
|
11
|
-
status_info: { fg: "white", bg: "navy", attrs: [:bold] }
|
|
12
|
-
#+end_src
|
|
13
|
-
** Develop a ruby DSL for defining themes
|
|
14
|
-
** Develop more builtin themes
|
|
15
|
-
* DONE Truecolor Support
|
|
16
|
-
CLOSED: [2026-05-22 Fri 09:28]
|
|
17
|
-
Remember this from ChatGPT:
|
|
18
|
-
|
|
19
|
-
#+begin_quote
|
|
20
|
-
1. Can you detect truecolor support?
|
|
21
|
-
|
|
22
|
-
Yes—best practice is a combination of environment hints:
|
|
23
|
-
|
|
24
|
-
def truecolor_supported?
|
|
25
|
-
ct = ENV["COLORTERM"]&.downcase
|
|
26
|
-
return true if ct&.include?("truecolor") || ct&.include?("24bit")
|
|
27
|
-
|
|
28
|
-
term = ENV["TERM"]&.downcase
|
|
29
|
-
return true if term&.include?("direct") # e.g. xterm-direct
|
|
30
|
-
|
|
31
|
-
false
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
This catches most modern terminals:
|
|
35
|
-
|
|
36
|
-
COLORTERM=truecolor (very common)
|
|
37
|
-
TERM=xterm-direct (less common but explicit)
|
|
38
|
-
|
|
39
|
-
You can also sanity-check:
|
|
40
|
-
|
|
41
|
-
ENV["TERM_PROGRAM"] # iTerm, Apple_Terminal, etc.
|
|
42
|
-
|
|
43
|
-
…but COLORTERM is the main signal.
|
|
44
|
-
|
|
45
|
-
2. The real blocker: ncurses
|
|
46
|
-
|
|
47
|
-
Even if truecolor is available, ncurses color pairs:
|
|
48
|
-
|
|
49
|
-
Curses.init_pair(...)
|
|
50
|
-
|
|
51
|
-
are limited to:
|
|
52
|
-
|
|
53
|
-
256 colors (best case)
|
|
54
|
-
often fewer
|
|
55
|
-
|
|
56
|
-
So your current renderer cannot display truecolor, even if the terminal supports it.
|
|
57
|
-
|
|
58
|
-
3. What it would take to use truecolor
|
|
59
|
-
|
|
60
|
-
You’d need to bypass color pairs and emit ANSI directly:
|
|
61
|
-
|
|
62
|
-
\e[38;2;R;G;Bm # foreground
|
|
63
|
-
\e[48;2;R;G;Bm # background
|
|
64
|
-
|
|
65
|
-
Example:
|
|
66
|
-
|
|
67
|
-
"\e[48;2;135;206;250m"
|
|
68
|
-
|
|
69
|
-
That means:
|
|
70
|
-
|
|
71
|
-
no color_pair
|
|
72
|
-
renderer writes ANSI sequences inline
|
|
73
|
-
you manage resets (\e[0m or partial resets)
|
|
74
|
-
4. Can you mix curses + truecolor?
|
|
75
|
-
|
|
76
|
-
Sort of—but awkwardly:
|
|
77
|
-
|
|
78
|
-
keep curses for cursor/window management
|
|
79
|
-
use ANSI for colors
|
|
80
|
-
don’t rely on attrset / color pairs
|
|
81
|
-
|
|
82
|
-
This is doable, but:
|
|
83
|
-
|
|
84
|
-
you lose some curses conveniences
|
|
85
|
-
you must be careful about redraws and state
|
|
86
|
-
5. Recommended path (incremental)
|
|
87
|
-
|
|
88
|
-
Don’t rewrite everything yet. Do this:
|
|
89
|
-
|
|
90
|
-
Step 1 — detect capability
|
|
91
|
-
Fatty.truecolor? = truecolor_supported?
|
|
92
|
-
Step 2 — extend color model
|
|
93
|
-
|
|
94
|
-
Your Color object should carry:
|
|
95
|
-
|
|
96
|
-
{ r: 135, g: 206, b: 250 }
|
|
97
|
-
|
|
98
|
-
in addition to (or instead of) pair indices.
|
|
99
|
-
|
|
100
|
-
Step 3 — dual rendering path (later)
|
|
101
|
-
|
|
102
|
-
In renderer:
|
|
103
|
-
|
|
104
|
-
if truecolor?
|
|
105
|
-
emit ANSI
|
|
106
|
-
else
|
|
107
|
-
use color_pair
|
|
108
|
-
end
|
|
109
|
-
6. Why this is worth it
|
|
110
|
-
|
|
111
|
-
Your theme system is now perfectly positioned for truecolor:
|
|
112
|
-
|
|
113
|
-
you already use semantic roles
|
|
114
|
-
you already parse X11 names
|
|
115
|
-
you already separate rendering
|
|
116
|
-
|
|
117
|
-
So switching later is contained.
|
|
118
|
-
|
|
119
|
-
Bottom line
|
|
120
|
-
✅ You can detect truecolor
|
|
121
|
-
❌ You cannot use it with curses color pairs
|
|
122
|
-
✅ Your architecture is ready to support it later
|
|
123
|
-
|
|
124
|
-
#+end_quote
|
|
125
|
-
|
|
126
|
-
* DONE Change to Fatty?
|
|
127
|
-
CLOSED: [2026-04-30 Thu 03:39]
|
|
128
|
-
and change the name of the demo to fatty for user testing.
|
|
129
|
-
|
|
130
|
-
* DONE Additional UI components
|
|
131
|
-
CLOSED: [2026-04-30 Thu 03:39]
|
|
132
|
-
- [X] prompt :: ask the user for an arbitrary string
|
|
133
|
-
- [X] notice, warn, error :: put messages in the status line
|
|
134
|
-
- [X] choose_many :: present a list of choices that a user can pick many items
|
|
135
|
-
from
|
|
136
|
-
- [X] menu :: user picks an action by name attached to a proc
|
|
137
|
-
|
|
138
|
-
* DONE In demo, add `help` and `keytest` commands
|
|
139
|
-
CLOSED: [2026-04-30 Thu 03:39]
|
|
140
|
-
- help :: would explain what commands are available for the demo
|
|
141
|
-
- keytest :: would echo to the output information about pressed keys, including
|
|
142
|
-
- the detected terminal type
|
|
143
|
-
- the keycode returned by the keyboard/terminal
|
|
144
|
-
- the keyname that the key is mapped to
|
|
145
|
-
- the bindings for the keyname in all contexts
|
|
146
|
-
- if no keyname, a suggested keydef entry to give it a name in the config
|
|
147
|
-
- if not bound, a suggested keybinding entry to add to config
|
|
148
|
-
|
|
149
|
-
* DONE Add cut and paste
|
|
150
|
-
CLOSED: [2026-04-13 Mon 07:48]
|
|
151
|
-
* DONE Add history
|
|
152
|
-
CLOSED: [2026-01-27 Tue 05:44]
|
|
153
|
-
* DONE Add completion
|
|
154
|
-
CLOSED: [2026-04-13 Mon 07:48]
|
|
155
|
-
* DONE Add undo
|
|
156
|
-
CLOSED: [2026-01-27 Tue 05:44]
|
|
157
|
-
* DONE Scrollback Navigation (PgUp/PgDn)
|
|
158
|
-
CLOSED: [2026-04-13 Mon 07:48]
|
|
159
|
-
|
|
160
|
-
* DONE Add Output Search
|
|
161
|
-
CLOSED: [2026-04-13 Mon 07:48]
|
|
162
|
-
* CNCL SIGINT forwarding to child process
|
|
163
|
-
CLOSED: [2026-05-22 Fri 09:28]
|