rubyterm 0.2.1 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b689e43998c1e63f2cd607d3200aeb67d7cf49d6a1ce685ab532ea525132b41c
4
- data.tar.gz: a6b2201c362d87c3114762e30cc55a2b90af4bd3d7ceec2fe4b14beaabc61d72
3
+ metadata.gz: 201ce77d71abc653a76c0fb9a51827e13910767e5f5946999853a13b8ab02006
4
+ data.tar.gz: 4b57378d7077055158b33aca41b4e365c4f63a60bb95547e2c5e64ffa91e1e75
5
5
  SHA512:
6
- metadata.gz: 005e2010106589917df481c5ae217959114a8f80a7ce5787855dab5ef9ed69fa14b9c840781899e609e0d795f39f022fe60ff46448960dd0f2a713dc00c4a2f4
7
- data.tar.gz: e6182b8a2b492e41777386c0a2cc8626d3e5195a89b14b6e46639cb5e5f7e1baa2abde4b1a135bba08004f78a5077075dcebf089b790cf9fcd27296ec011031a
6
+ metadata.gz: d60d6b223b2819739d0dff9e571b8007a2422c2f38fc5d784e733c3273242037d1833fdea48c15735e72b76ef3487e4c716ed8b1cc10b707cfaddac96e76c511
7
+ data.tar.gz: 3c5b38c7f9a928f2f1bfa99b798515bb42a0d455c04d956cac11ec8687bac35adcd92fa96c2c6e6c40c28587957ced61c25c747ab990a526a2961c9d01377824
data/README.md CHANGED
@@ -18,6 +18,25 @@ all.
18
18
  > to contribute, **talk to me first** (vidar@hokstad.com) or fork — I won't
19
19
  > promise to merge changes we haven't discussed.
20
20
 
21
+ ## Getting started
22
+
23
+ rubyterm is a **standalone X11 terminal emulator** — like `xterm` or any
24
+ other terminal, but written entirely in Ruby. You run it inside a running X
25
+ session and it opens a window with a shell in it.
26
+
27
+ gem install rubyterm
28
+
29
+ Then, from within an X session (`$DISPLAY` must point at your X server):
30
+
31
+ rubyterm # your $SHELL in a new window
32
+ rubyterm bash -lc htop # ...or run a specific command
33
+
34
+ Launch it however you launch any other terminal — from your window manager's
35
+ menu or a keybinding, from your X startup file, or from an existing terminal.
36
+
37
+ **Tabs?** Not yet — rubyterm is one terminal per window. For multiple
38
+ sessions, open several windows or run `tmux`/`screen` inside it.
39
+
21
40
  ## Screenshots of Ruby-in-Ruby-in-Ruby-...
22
41
 
23
42
  ![Rubyterm](docs/2026-06-15_18-40_1.png)
@@ -57,32 +76,31 @@ For the full picture and the rationale behind the layering, see:
57
76
 
58
77
  ## Installation
59
78
 
60
- Dependencies are managed with Bundler.
79
+ **From RubyGems** to use it:
61
80
 
62
81
  ```bash
63
- bundle install
82
+ gem install rubyterm
83
+ rubyterm # then run it inside an X session
64
84
  ```
65
85
 
66
- `skrift` and `skrift-x11` are developed alongside this project and are
67
- pulled from git. To build against a local checkout instead of the pushed
68
- branch, set a per-machine local override (kept out of the repo):
86
+ **From source** to hack on it:
69
87
 
70
88
  ```bash
71
- bundle config set --global local.skrift /path/to/skrift
72
- bundle config set --global local.skrift-x11 /path/to/skrift-x11
89
+ git clone https://github.com/vidarh/rubyterm && cd rubyterm
90
+ bundle install
91
+ bundle exec rubyterm
73
92
  ```
74
93
 
75
- ## Running
94
+ [skrift](https://github.com/vidarh/skrift) — the pure-Ruby TrueType/OpenType
95
+ font renderer rubyterm draws its text with — and its companion plugins live in
96
+ one monorepo and are pulled from git. To build against a local checkout, set
97
+ one per-machine override at the monorepo root (kept out of the repo):
76
98
 
77
99
  ```bash
78
- bundle exec rubyterm # start a terminal running your $SHELL
79
- bundle exec rubyterm bash -lc htop # ...or run a specific command
100
+ bundle config set --global disable_local_branch_check true
101
+ bundle config set --global local.skrift /path/to/skrift
80
102
  ```
81
103
 
82
- With some luck you'll get a terminal window. Once the gem (and its
83
- dependencies) are installed system-wide, the `rubyterm` executable can be
84
- run directly.
85
-
86
104
  ## Configuration
87
105
 
88
106
  Configuration is read from `~/.config/rterm/config.toml` (TOML). See
data/bin/record ADDED
@@ -0,0 +1,3 @@
1
+ #!/bin/env ruby
2
+
3
+ exec(%{ruby harness/cli.rb record --out /tmp/#{ARGV[0].gsub("/","_")}.rec -- #{ARGV.join(" ")}})
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, 0x231A..0x232A, 0x23E9..0x23F3, 0x25FD..0x27BF,
25
- 0x2B1B..0x2B55, 0x2E80..0xA4C6, 0xA960..0xA97C, 0xAC00..0xD7A3,
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,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class RubyTerm
4
- VERSION = "0.2.1"
4
+ VERSION = "0.2.4"
5
5
  end
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"; @saved = [@x,@y,@gl,@gr,@g.dup]
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.1
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-22 00:00:00.000000000 Z
11
+ date: 2026-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pure-x11
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: 0.0.15
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: 0.0.15
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: skrift
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -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