rubyterm 0.2.2 → 0.2.4
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/bin/record +3 -0
- data/lib/charwidth.rb +18 -2
- data/lib/rubyterm/version.rb +1 -1
- data/lib/term.rb +21 -6
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 201ce77d71abc653a76c0fb9a51827e13910767e5f5946999853a13b8ab02006
|
|
4
|
+
data.tar.gz: 4b57378d7077055158b33aca41b4e365c4f63a60bb95547e2c5e64ffa91e1e75
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d60d6b223b2819739d0dff9e571b8007a2422c2f38fc5d784e733c3273242037d1833fdea48c15735e72b76ef3487e4c716ed8b1cc10b707cfaddac96e76c511
|
|
7
|
+
data.tar.gz: 3c5b38c7f9a928f2f1bfa99b798515bb42a0d455c04d956cac11ec8687bac35adcd92fa96c2c6e6c40c28587957ced61c25c747ab990a526a2961c9d01377824
|
data/bin/record
ADDED
data/lib/charwidth.rb
CHANGED
|
@@ -20,9 +20,25 @@ module CharWidth
|
|
|
20
20
|
WIDE_SPACER = 0
|
|
21
21
|
|
|
22
22
|
# Wide (two-cell) blocks: CJK, Hangul, Kana, fullwidth forms, and emoji.
|
|
23
|
+
#
|
|
24
|
+
# In the BMP symbol zone (Misc Symbols, Dingbats, Misc Symbols & Arrows)
|
|
25
|
+
# only the East Asian Wide + emoji-presentation codepoints are double-width;
|
|
26
|
+
# the surrounding text dingbats are single-width. A broad 0x25FD..0x27BF (and
|
|
27
|
+
# peers) wrongly widened text characters like U+273B (the spinner ✻ used by
|
|
28
|
+
# TUIs), shifting the cursor one column on every line that contained one and
|
|
29
|
+
# corrupting incremental redraws. These ranges now match tmux exactly.
|
|
23
30
|
WIDE = [
|
|
24
|
-
0x1100..0x115F,
|
|
25
|
-
|
|
31
|
+
0x1100..0x115F,
|
|
32
|
+
0x231A..0x231B, 0x2329..0x232A, 0x23E9..0x23EC, 0x23F0..0x23F0,
|
|
33
|
+
0x23F3..0x23F3, 0x25FD..0x25FE, 0x2614..0x2615, 0x2648..0x2653,
|
|
34
|
+
0x267F..0x267F, 0x2693..0x2693, 0x26A1..0x26A1, 0x26AA..0x26AB,
|
|
35
|
+
0x26BD..0x26BE, 0x26C4..0x26C5, 0x26CE..0x26CE, 0x26D4..0x26D4,
|
|
36
|
+
0x26EA..0x26EA, 0x26F2..0x26F3, 0x26F5..0x26F5, 0x26FA..0x26FA,
|
|
37
|
+
0x26FD..0x26FD, 0x2705..0x2705, 0x270A..0x270B, 0x2728..0x2728,
|
|
38
|
+
0x274C..0x274C, 0x274E..0x274E, 0x2753..0x2755, 0x2757..0x2757,
|
|
39
|
+
0x2795..0x2797, 0x27B0..0x27B0, 0x27BF..0x27BF, 0x2B1B..0x2B1C,
|
|
40
|
+
0x2B50..0x2B50, 0x2B55..0x2B55,
|
|
41
|
+
0x2E80..0xA4C6, 0xA960..0xA97C, 0xAC00..0xD7A3,
|
|
26
42
|
0xF900..0xFAD9, 0xFE10..0xFE6B, 0xFF01..0xFF60, 0xFFE0..0xFFE6,
|
|
27
43
|
0x16FE0..0x18D08, 0x1B000..0x1B2FB, 0x1F18E..0x1F19A, 0x1F200..0x1F265,
|
|
28
44
|
0x1F300..0x1F5A4, 0x1F5FB..0x1F6FC, 0x1F7E0..0x1F7EB, 0x1F90C..0x1F9FF,
|
data/lib/rubyterm/version.rb
CHANGED
data/lib/term.rb
CHANGED
|
@@ -115,6 +115,15 @@ class Term
|
|
|
115
115
|
@buffer.clear # the buffer (TrackChanges) also clears the backend
|
|
116
116
|
end
|
|
117
117
|
|
|
118
|
+
# Cursor + charset save/restore, shared by DECSC/DECRC (ESC 7 / ESC 8) and
|
|
119
|
+
# DEC private modes 1048/1049. DECRC with no prior save defaults to the home
|
|
120
|
+
# position and default charsets rather than leaving @x/@y nil (which would
|
|
121
|
+
# crash draw_cursor).
|
|
122
|
+
def save_cursor = @saved = [@x, @y, @gl, @gr, @g.dup]
|
|
123
|
+
def restore_cursor
|
|
124
|
+
@x, @y, @gl, @gr, @g = @saved || [0, 0, 0, nil, [DefaultCharset, nil, nil, nil]]
|
|
125
|
+
end
|
|
126
|
+
|
|
118
127
|
# RIS - Reset to Initial State (ESC c). Full reset: restore margins,
|
|
119
128
|
# modes, charsets, tab stops and attributes to their defaults, home the
|
|
120
129
|
# cursor and clear the screen.
|
|
@@ -408,6 +417,16 @@ class Term
|
|
|
408
417
|
# FIXME: Save/restore
|
|
409
418
|
# FIXME: Scrollback should be disabled/enabled.
|
|
410
419
|
clear_screen
|
|
420
|
+
when 1048
|
|
421
|
+
# Save (h) / restore (l) cursor, as DECSC / DECRC.
|
|
422
|
+
set ? save_cursor : restore_cursor
|
|
423
|
+
when 1049
|
|
424
|
+
# Alternate screen + cursor save/restore. Like mode 47 this
|
|
425
|
+
# terminal has no separate alt buffer yet, so it just clears; the
|
|
426
|
+
# cursor save (on enter) / restore (on leave) is what apps rely on
|
|
427
|
+
# to land the cursor back where it was before the alt screen.
|
|
428
|
+
set ? save_cursor : restore_cursor
|
|
429
|
+
clear_screen
|
|
411
430
|
|
|
412
431
|
# Extended mouse modes
|
|
413
432
|
# See https://terminalguide.namepad.de/mouse/
|
|
@@ -596,12 +615,8 @@ class Term
|
|
|
596
615
|
when ")B"; @g[1] = DefaultCharset
|
|
597
616
|
when "(0"; @g[0] = GraphicsCharset
|
|
598
617
|
when ")0"; @g[1] = GraphicsCharset
|
|
599
|
-
when "7";
|
|
600
|
-
when "8"
|
|
601
|
-
# DECRC with no prior DECSC: default to home position and default
|
|
602
|
-
# charsets rather than leaving @x/@y nil (which crashes draw_cursor).
|
|
603
|
-
sx, sy, sgl, sgr, sg = @saved || [0, 0, 0, nil, [DefaultCharset, nil, nil, nil]]
|
|
604
|
-
@x, @y, @gl, @gr, @g = sx, sy, sgl, sgr, sg
|
|
618
|
+
when "7"; save_cursor # DECSC
|
|
619
|
+
when "8"; restore_cursor # DECRC
|
|
605
620
|
else
|
|
606
621
|
unhandled(:escape, s)
|
|
607
622
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rubyterm
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Vidar Hokstad
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-06-
|
|
11
|
+
date: 2026-06-26 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: pure-x11
|
|
@@ -95,6 +95,7 @@ extensions: []
|
|
|
95
95
|
extra_rdoc_files: []
|
|
96
96
|
files:
|
|
97
97
|
- README.md
|
|
98
|
+
- bin/record
|
|
98
99
|
- bin/rubyterm
|
|
99
100
|
- example-config.toml
|
|
100
101
|
- lib/ansibackend.rb
|