rcurses 3.9 → 4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +11 -0
- data/lib/rcurses/pane.rb +29 -0
- data/lib/rcurses.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64fede93e0d646b947c3cf6c3217a1aa7bf62f923b724a4dd55b02e3981b8593
|
4
|
+
data.tar.gz: 3dca4a698dbbc31356e50e322d3e52ba2c0d6a574b7b824e6d6fe7d5d5b49dd2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e866db8fa1db394653b90a88c73632d024b7b565db7f984360004b6d4bb4b83c56650e2784669bf827f32585dbbbb9918f98016d5a6612ee39ff352e194b7f84
|
7
|
+
data.tar.gz: 67ceadf4ccb04fb5708e0faa33253099156cddedd9fe906d5d24a11d9ccfeac836a945ff7990f19df380f64061a986836a6432206e5f7a8cd09cb6f9e112e81b
|
data/README.md
CHANGED
@@ -243,6 +243,17 @@ mypane.edit
|
|
243
243
|
|
244
244
|
And - try running the example file `rcurses_example.rb`.
|
245
245
|
|
246
|
+
# Clean exit for your application
|
247
|
+
To restore the terminal fully after you exit your application, add this:
|
248
|
+
```
|
249
|
+
at_exit do # Always restore terminal state on quit (or fatal)
|
250
|
+
$stdin.cooked!
|
251
|
+
$stdin.echo = true
|
252
|
+
Rcurses.clear_screen
|
253
|
+
Cursor.show
|
254
|
+
end
|
255
|
+
```
|
256
|
+
|
246
257
|
# Not yet implemented
|
247
258
|
Let me know what other features you like to see.
|
248
259
|
|
data/lib/rcurses/pane.rb
CHANGED
@@ -128,6 +128,35 @@ module Rcurses
|
|
128
128
|
refresh(cont)
|
129
129
|
end
|
130
130
|
|
131
|
+
# Refresh only the border
|
132
|
+
def border_refresh
|
133
|
+
left_col = @x - 1
|
134
|
+
right_col = @x + @w
|
135
|
+
top_row = @y - 1
|
136
|
+
bottom_row = @y + @h
|
137
|
+
|
138
|
+
if @border
|
139
|
+
fmt = [@fg.to_s, @bg.to_s].join(',')
|
140
|
+
top = ("┌" + "─" * @w + "┐").c(fmt)
|
141
|
+
STDOUT.print "\e[#{top_row};#{left_col}H" + top
|
142
|
+
(0...@h).each do |i|
|
143
|
+
row = @y + i
|
144
|
+
STDOUT.print "\e[#{row};#{left_col}H" + "│".c(fmt)
|
145
|
+
STDOUT.print "\e[#{row};#{right_col}H" + "│".c(fmt)
|
146
|
+
end
|
147
|
+
bottom = ("└" + "─" * @w + "┘").c(fmt)
|
148
|
+
STDOUT.print "\e[#{bottom_row};#{left_col}H" + bottom
|
149
|
+
else
|
150
|
+
STDOUT.print "\e[#{top_row};#{left_col}H" + " " * (@w + 2)
|
151
|
+
(0...@h).each do |i|
|
152
|
+
row = @y + i
|
153
|
+
STDOUT.print "\e[#{row};#{left_col}H" + " "
|
154
|
+
STDOUT.print "\e[#{row};#{right_col}H" + " "
|
155
|
+
end
|
156
|
+
STDOUT.print "\e[#{bottom_row};#{left_col}H" + " " * (@w + 2)
|
157
|
+
end
|
158
|
+
end
|
159
|
+
|
131
160
|
# Diff-based refresh that minimizes flicker.
|
132
161
|
# In this updated version we lazily process only the raw lines required to fill the pane.
|
133
162
|
def refresh(cont = @text)
|
data/lib/rcurses.rb
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
# Web_site: http://isene.com/
|
6
6
|
# Github: https://github.com/isene/rcurses
|
7
7
|
# License: Public domain
|
8
|
-
# Version:
|
8
|
+
# Version: 4.0: Added border_refresh to refresh only the border of a pane
|
9
9
|
|
10
10
|
require 'io/console' # Basic gem for rcurses
|
11
11
|
require 'io/wait' # stdin handling
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rcurses
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '
|
4
|
+
version: '4.0'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Geir Isene
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-05-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: clipboard
|
@@ -30,7 +30,8 @@ description: 'Create curses applications for the terminal easier than ever. Crea
|
|
30
30
|
color, blink and in any 256 terminal colors for foreground and background. Use a
|
31
31
|
simple editor to let users edit text in panes. Left, right or center align text
|
32
32
|
in panes. Cursor movement around the terminal. New in 3.8: Fixed border fragments
|
33
|
-
upon utf-8 characters.
|
33
|
+
upon utf-8 characters. 4.0: Added border_refresh to refresh only the border of a
|
34
|
+
pane.'
|
34
35
|
email: g@isene.com
|
35
36
|
executables: []
|
36
37
|
extensions: []
|