libtmux 0.1.1 → 0.1.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.md +108 -0
- data/README.md +270 -89
- data/lib/libtmux/capabilities.rb +105 -10
- data/lib/libtmux/capture.rb +6 -11
- data/lib/libtmux/control.rb +3 -0
- data/lib/libtmux/entity.rb +176 -3
- data/lib/libtmux/errors.rb +20 -1
- data/lib/libtmux/operations.rb +7 -0
- data/lib/libtmux/option_catalog.rb +54 -0
- data/lib/libtmux/options.rb +39 -11
- data/lib/libtmux/owned.rb +11 -0
- data/lib/libtmux/process.rb +40 -11
- data/lib/libtmux/program.rb +478 -0
- data/lib/libtmux/server.rb +182 -78
- data/lib/libtmux/terminal.rb +6 -1
- data/lib/libtmux/text_wait.rb +101 -0
- data/lib/libtmux/tmux_version.rb +24 -2
- data/lib/libtmux/version.rb +1 -1
- data/lib/libtmux.rb +6 -0
- data/libexec/program_child.rb +60 -0
- data/schema/option-catalog.json +1723 -0
- data/sig/control.rbs +2 -1
- data/sig/libtmux.rbs +81 -6
- data/sig/option_catalog.rbs +26 -0
- data/sig/program.rbs +47 -0
- data/sig/terminal.rbs +1 -0
- metadata +19 -4
data/sig/control.rbs
CHANGED
|
@@ -60,7 +60,8 @@ module LibTmux
|
|
|
60
60
|
attr_reader previous_generation: String?
|
|
61
61
|
attr_reader events: ControlSubscription
|
|
62
62
|
attr_reader cleanup_errors: Array[String]
|
|
63
|
-
def self.
|
|
63
|
+
private def self.new: (*untyped, **untyped) -> instance
|
|
64
|
+
private def self.open: [T] (binding: untyped, session_id: String, ?reconnect: ControlConnection?, **Integer) { (ControlConnection) -> T } -> T
|
|
64
65
|
| (binding: untyped, session_id: String, ?reconnect: ControlConnection?, **Integer) -> ControlConnection
|
|
65
66
|
def initialize: (binding: untyped, session_id: String, ?reconnect: ControlConnection?, ?max_requests: Integer, ?max_command_bytes: Integer, ?max_queue_bytes: Integer, ?max_line_bytes: Integer, ?max_reply_bytes: Integer, ?max_stderr_bytes: Integer, ?max_subscriptions: Integer) -> void
|
|
66
67
|
def exchange: (String, ?timeout: Numeric, ?cancel: untyped) -> GuardedReply
|
data/sig/libtmux.rbs
CHANGED
|
@@ -17,6 +17,7 @@ module LibTmux
|
|
|
17
17
|
attr_reader entity: Symbol?
|
|
18
18
|
attr_reader path: String?
|
|
19
19
|
attr_reader expected: String?
|
|
20
|
+
attr_reader text: String?
|
|
20
21
|
def initialize: (String, ?delivery: Symbol, ?phase: Symbol?, ?pid: Integer?, ?cleanup_errors: Array[String], ?entity: Symbol?, ?path: String?, ?expected: String?) -> void
|
|
21
22
|
end
|
|
22
23
|
class InvalidFilterError < Error
|
|
@@ -50,6 +51,11 @@ module LibTmux
|
|
|
50
51
|
end
|
|
51
52
|
class ClosedError < Error
|
|
52
53
|
end
|
|
54
|
+
class PaneDied < Error
|
|
55
|
+
private def self.new: (*untyped) -> instance
|
|
56
|
+
attr_reader text: String
|
|
57
|
+
attr_reader reason: :pane_exited | :pane_gone | :server_gone
|
|
58
|
+
end
|
|
53
59
|
class CommandError < Error
|
|
54
60
|
attr_reader result: CommandResult?
|
|
55
61
|
def initialize: (?String, ?result: CommandResult?, **untyped) -> void
|
|
@@ -118,8 +124,8 @@ module LibTmux
|
|
|
118
124
|
class Session < Entity
|
|
119
125
|
def snapshot: (**untyped) -> SessionSnapshot
|
|
120
126
|
def kill: (?expected_windows: Array[EntityRef]?, ?expected_panes: Array[EntityRef]?, ?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
121
|
-
def new_window: (name: String
|
|
122
|
-
| (name: String
|
|
127
|
+
def new_window: (?name: String?, ?command: Array[String]?, receipt: true, ?index: Integer?, ?cwd: String?, ?environment: Hash[String, String], ?focus: bool, ?timeout: Numeric, ?cancel: untyped) -> CreationReceipt
|
|
128
|
+
| (?name: String?, ?command: Array[String]?, ?receipt: false, ?index: Integer?, ?cwd: String?, ?environment: Hash[String, String], ?focus: bool, ?timeout: Numeric, ?cancel: untyped) -> Window
|
|
123
129
|
def list_windows: (?timeout: Numeric, ?cancel: untyped) -> Array[Window]
|
|
124
130
|
def list_panes: (?timeout: Numeric, ?cancel: untyped) -> Array[Pane]
|
|
125
131
|
end
|
|
@@ -127,16 +133,27 @@ module LibTmux
|
|
|
127
133
|
class Window < Entity
|
|
128
134
|
def snapshot: (**untyped) -> WindowSnapshot
|
|
129
135
|
def list_panes: (?timeout: Numeric, ?cancel: untyped) -> Array[Pane]
|
|
130
|
-
def split: (direction: :horizontal | :vertical, command: Array[String]
|
|
136
|
+
def split: (direction: :horizontal | :vertical, ?command: Array[String]?, ?size: Integer | String | nil, ?cwd: String?, ?environment: Hash[String, String], ?focus: bool, ?timeout: Numeric, ?cancel: untyped) -> Pane
|
|
131
137
|
def select_layout: (String | Symbol, ?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
132
138
|
end
|
|
133
139
|
|
|
134
140
|
class Pane < Entity
|
|
135
141
|
def snapshot: (**untyped) -> PaneSnapshot
|
|
136
|
-
def split: (direction: :horizontal | :vertical, command: Array[String]
|
|
142
|
+
def split: (direction: :horizontal | :vertical, ?command: Array[String]?, ?size: Integer | String | nil, ?cwd: String?, ?environment: Hash[String, String], ?focus: bool, ?timeout: Numeric, ?cancel: untyped) -> Pane
|
|
137
143
|
def capture: (?start: Integer | String | nil, ?finish: Integer | String | nil, ?join: bool, ?escapes: bool, ?escape_bytes: bool, ?preserve_trailing: bool, ?trim_trailing: bool, ?alternate: bool, ?mode_screen: bool, ?pending: bool, ?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
138
144
|
def send_text: (String, ?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
139
145
|
def send_keys: (*String, ?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
146
|
+
def wait_for_text: (String, ?interval: Numeric, ?timeout: Numeric, ?cancel: untyped) -> TextWait::Result
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
module TextWait
|
|
150
|
+
class Result < Data
|
|
151
|
+
private def self.new: (*untyped, **untyped) -> instance
|
|
152
|
+
private def self.[]: (*untyped, **untyped) -> instance
|
|
153
|
+
def self.members: () -> Array[Symbol]
|
|
154
|
+
attr_reader text: String
|
|
155
|
+
attr_reader matched_at_entry: bool
|
|
156
|
+
end
|
|
140
157
|
end
|
|
141
158
|
|
|
142
159
|
module Support
|
|
@@ -151,6 +168,63 @@ module LibTmux
|
|
|
151
168
|
end
|
|
152
169
|
end
|
|
153
170
|
|
|
171
|
+
class Capabilities
|
|
172
|
+
private def self.new: (*untyped, **untyped) -> instance
|
|
173
|
+
attr_reader binding_key: String
|
|
174
|
+
attr_reader pid: Integer
|
|
175
|
+
attr_reader start_time: Integer
|
|
176
|
+
attr_reader version: String
|
|
177
|
+
attr_reader features: Array[Feature]
|
|
178
|
+
attr_reader workarounds: Array[Workaround]
|
|
179
|
+
def feature: (String id) -> Feature
|
|
180
|
+
def supports?: (String id) -> bool
|
|
181
|
+
def workaround: (String id) -> Workaround
|
|
182
|
+
def to_h: () -> Hash[String, untyped]
|
|
183
|
+
|
|
184
|
+
class Command < Data
|
|
185
|
+
private def self.new: (*untyped, **untyped) -> instance
|
|
186
|
+
private def self.[]: (*untyped, **untyped) -> instance
|
|
187
|
+
def self.members: () -> Array[Symbol]
|
|
188
|
+
attr_reader command: String
|
|
189
|
+
attr_reader flags: Array[String]
|
|
190
|
+
def to_h: () -> Hash[String, untyped]
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
class Feature < Data
|
|
194
|
+
private def self.new: (*untyped, **untyped) -> instance
|
|
195
|
+
private def self.[]: (*untyped, **untyped) -> instance
|
|
196
|
+
def self.members: () -> Array[Symbol]
|
|
197
|
+
attr_reader id: String
|
|
198
|
+
attr_reader name: String
|
|
199
|
+
attr_reader summary: String
|
|
200
|
+
attr_reader since: String
|
|
201
|
+
attr_reader handling: :refuse | :fallback | :repair
|
|
202
|
+
attr_reader error: String?
|
|
203
|
+
attr_reader apis: Array[String]
|
|
204
|
+
attr_reader commands: Array[Command]
|
|
205
|
+
attr_reader except: Array[String]
|
|
206
|
+
attr_reader supported: bool
|
|
207
|
+
def supported?: () -> bool
|
|
208
|
+
def to_h: () -> Hash[String, untyped]
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
class Workaround < Data
|
|
212
|
+
private def self.new: (*untyped, **untyped) -> instance
|
|
213
|
+
private def self.[]: (*untyped, **untyped) -> instance
|
|
214
|
+
def self.members: () -> Array[Symbol]
|
|
215
|
+
attr_reader id: String
|
|
216
|
+
attr_reader name: String
|
|
217
|
+
attr_reader summary: String
|
|
218
|
+
attr_reader releases: Array[String]
|
|
219
|
+
attr_reader handling: :refuse | :repair
|
|
220
|
+
attr_reader apis: Array[String]
|
|
221
|
+
attr_reader commands: Array[Command]
|
|
222
|
+
attr_reader active: bool
|
|
223
|
+
def active?: () -> bool
|
|
224
|
+
def to_h: () -> Hash[String, untyped]
|
|
225
|
+
end
|
|
226
|
+
end
|
|
227
|
+
|
|
154
228
|
class Server
|
|
155
229
|
attr_reader endpoint: Endpoint
|
|
156
230
|
def self.open: [T] (?endpoint: Endpoint?, ?socket_path: String?, ?socket_name: String?, ?executable: String, ?max_requests: Integer, ?max_controls: Integer, ?close_timeout: Numeric, ?version_timeout: Numeric) { (Server) -> T } -> T
|
|
@@ -158,12 +232,13 @@ module LibTmux
|
|
|
158
232
|
def initialize: (?endpoint: Endpoint?, ?socket_path: String?, ?socket_name: String?, ?executable: String, ?max_requests: Integer, ?max_controls: Integer, ?close_timeout: Numeric, ?version_timeout: Numeric) -> void
|
|
159
233
|
def tmux_version: () -> String
|
|
160
234
|
def supports_control?: () -> bool
|
|
235
|
+
def capabilities: (?timeout: Numeric, ?cancel: untyped) -> Capabilities
|
|
161
236
|
def run: (Array[String], ?input: String, ?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
162
237
|
def close: () -> nil
|
|
163
238
|
def diagnostics: () -> {admitted_requests: Integer, reserved_process_slots: Integer, control_connections: Integer, closed: bool, limits: {max_requests: Integer, max_controls: Integer, close_timeout: Numeric}}
|
|
164
239
|
def kill: (?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
165
|
-
def new_session: (name: String
|
|
166
|
-
| (name: String
|
|
240
|
+
def new_session: (?name: String?, ?command: Array[String]?, receipt: true, ?width: Integer?, ?height: Integer?, ?window_name: String?, ?cwd: String?, ?environment: Hash[String, String], ?timeout: Numeric, ?cancel: untyped) -> CreationReceipt
|
|
241
|
+
| (?name: String?, ?command: Array[String]?, ?receipt: false, ?width: Integer?, ?height: Integer?, ?window_name: String?, ?cwd: String?, ?environment: Hash[String, String], ?timeout: Numeric, ?cancel: untyped) -> Session
|
|
167
242
|
def list_sessions: (?timeout: Numeric, ?cancel: untyped) -> Array[Session]
|
|
168
243
|
def list_windows: (?timeout: Numeric, ?cancel: untyped) -> Array[Window]
|
|
169
244
|
def list_panes: (?timeout: Numeric, ?cancel: untyped) -> Array[Pane]
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
module LibTmux
|
|
2
|
+
module OptionCatalog
|
|
3
|
+
type scope = :server | :session | :window | :pane
|
|
4
|
+
type option_type = :string | :number | :key | :colour | :flag | :choice | :command
|
|
5
|
+
|
|
6
|
+
class Option
|
|
7
|
+
private def self.new: (*untyped) -> instance
|
|
8
|
+
attr_reader name: String
|
|
9
|
+
attr_reader type: option_type
|
|
10
|
+
attr_reader scopes: Array[scope]
|
|
11
|
+
attr_reader range: Range[Integer]?
|
|
12
|
+
attr_reader choices: Array[String]
|
|
13
|
+
def array?: () -> bool
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
class Hook
|
|
17
|
+
private def self.new: (*untyped) -> instance
|
|
18
|
+
attr_reader name: String
|
|
19
|
+
attr_reader scopes: Array[scope]
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def self.tmux_version: () -> String
|
|
23
|
+
def self.options: () -> Hash[String, Option]
|
|
24
|
+
def self.hooks: () -> Hash[String, Hook]
|
|
25
|
+
end
|
|
26
|
+
end
|
data/sig/program.rbs
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
module LibTmux
|
|
2
|
+
def self.start_program: (Array[String], ?server: Server?, ?executable: String, ?cwd: String?, ?environment: Hash[String, String], ?width: Integer, ?height: Integer, ?history_lines: Integer, ?timeout: Numeric, ?cancel: untyped) -> Program
|
|
3
|
+
| [T] (Array[String], ?server: Server?, ?executable: String, ?cwd: String?, ?environment: Hash[String, String], ?width: Integer, ?height: Integer, ?history_lines: Integer, ?timeout: Numeric, ?cancel: untyped) { (Program) -> T } -> T
|
|
4
|
+
def self.run_program: (Array[String], ?server: Server?, ?executable: String, ?cwd: String?, ?environment: Hash[String, String], ?width: Integer, ?height: Integer, ?history_lines: Integer, ?timeout: Numeric, ?cancel: untyped) -> Program::Result
|
|
5
|
+
|
|
6
|
+
class Server
|
|
7
|
+
def program_support: (?timeout: Numeric, ?cancel: untyped) -> {binding_key: String, pid: Integer, start_time: Integer, version: String, since: String, supported: bool}
|
|
8
|
+
def start_program: (Array[String], ?cwd: String?, ?environment: Hash[String, String], ?width: Integer, ?height: Integer, ?history_lines: Integer, ?timeout: Numeric, ?cancel: untyped) -> Program
|
|
9
|
+
| [T] (Array[String], ?cwd: String?, ?environment: Hash[String, String], ?width: Integer, ?height: Integer, ?history_lines: Integer, ?timeout: Numeric, ?cancel: untyped) { (Program) -> T } -> T
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
class Program
|
|
13
|
+
private def self.new: (*untyped, **untyped) -> instance
|
|
14
|
+
|
|
15
|
+
SCREEN_BYTES: Integer
|
|
16
|
+
MAX_WIDTH: Integer
|
|
17
|
+
MAX_HEIGHT: Integer
|
|
18
|
+
|
|
19
|
+
class ScreenGeometryError < CapacityError
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
class Screen
|
|
23
|
+
private def self.new: (*untyped) -> instance
|
|
24
|
+
attr_reader text: String
|
|
25
|
+
def truncated?: () -> bool
|
|
26
|
+
def inspect: () -> String
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
class Result
|
|
30
|
+
private def self.new: (*untyped, **untyped) -> instance
|
|
31
|
+
attr_reader exit_status: Integer?
|
|
32
|
+
attr_reader signal: Integer?
|
|
33
|
+
attr_reader screen: String
|
|
34
|
+
def screen_truncated?: () -> bool
|
|
35
|
+
def inspect: () -> String
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def wait: (?timeout: Numeric, ?cancel: untyped) -> Result
|
|
39
|
+
def capture_screen: (?timeout: Numeric, ?cancel: untyped) -> Screen
|
|
40
|
+
def screen: (?timeout: Numeric, ?cancel: untyped) -> String
|
|
41
|
+
def send_text: (String, ?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
42
|
+
def send_keys: (*String, ?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
43
|
+
def resize: (width: Integer, height: Integer, ?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
44
|
+
def close: () -> nil
|
|
45
|
+
def inspect: () -> String
|
|
46
|
+
end
|
|
47
|
+
end
|
data/sig/terminal.rbs
CHANGED
|
@@ -9,6 +9,7 @@ module LibTmux
|
|
|
9
9
|
def inspect: () -> String
|
|
10
10
|
end
|
|
11
11
|
class Server
|
|
12
|
+
def self.valid_terminal_type?: (untyped value) -> bool
|
|
12
13
|
def switch_client: (client: String, session: EntityRef, ?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
13
14
|
def attach: (session: EntityRef, terminal: IO, term: String, ?read_only: bool, ?timeout: Numeric?, ?cancel: untyped) -> TerminalResult
|
|
14
15
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: libtmux
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- libtmux contributors
|
|
@@ -13,16 +13,22 @@ dependencies:
|
|
|
13
13
|
name: json
|
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
|
15
15
|
requirements:
|
|
16
|
-
- - "
|
|
16
|
+
- - ">="
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
18
|
version: 3.0.2
|
|
19
|
+
- - "<"
|
|
20
|
+
- !ruby/object:Gem::Version
|
|
21
|
+
version: '4'
|
|
19
22
|
type: :runtime
|
|
20
23
|
prerelease: false
|
|
21
24
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
25
|
requirements:
|
|
23
|
-
- - "
|
|
26
|
+
- - ">="
|
|
24
27
|
- !ruby/object:Gem::Version
|
|
25
28
|
version: 3.0.2
|
|
29
|
+
- - "<"
|
|
30
|
+
- !ruby/object:Gem::Version
|
|
31
|
+
version: '4'
|
|
26
32
|
- !ruby/object:Gem::Dependency
|
|
27
33
|
name: tmpdir
|
|
28
34
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -85,6 +91,7 @@ executables: []
|
|
|
85
91
|
extensions: []
|
|
86
92
|
extra_rdoc_files: []
|
|
87
93
|
files:
|
|
94
|
+
- CHANGELOG.md
|
|
88
95
|
- LICENSE
|
|
89
96
|
- README.md
|
|
90
97
|
- assets/logo.png
|
|
@@ -103,10 +110,12 @@ files:
|
|
|
103
110
|
- lib/libtmux/metadata.rb
|
|
104
111
|
- lib/libtmux/native_guard.rb
|
|
105
112
|
- lib/libtmux/operations.rb
|
|
113
|
+
- lib/libtmux/option_catalog.rb
|
|
106
114
|
- lib/libtmux/options.rb
|
|
107
115
|
- lib/libtmux/owned.rb
|
|
108
116
|
- lib/libtmux/process.rb
|
|
109
117
|
- lib/libtmux/process_wait.rb
|
|
118
|
+
- lib/libtmux/program.rb
|
|
110
119
|
- lib/libtmux/selection.rb
|
|
111
120
|
- lib/libtmux/server.rb
|
|
112
121
|
- lib/libtmux/snapshot.rb
|
|
@@ -114,8 +123,11 @@ files:
|
|
|
114
123
|
- lib/libtmux/source_query.rb
|
|
115
124
|
- lib/libtmux/support.rb
|
|
116
125
|
- lib/libtmux/terminal.rb
|
|
126
|
+
- lib/libtmux/text_wait.rb
|
|
117
127
|
- lib/libtmux/tmux_version.rb
|
|
118
128
|
- lib/libtmux/version.rb
|
|
129
|
+
- libexec/program_child.rb
|
|
130
|
+
- schema/option-catalog.json
|
|
119
131
|
- schema/where-v1.json
|
|
120
132
|
- sig/control.rbs
|
|
121
133
|
- sig/criteria.rbs
|
|
@@ -123,7 +135,9 @@ files:
|
|
|
123
135
|
- sig/group.rbs
|
|
124
136
|
- sig/libtmux.rbs
|
|
125
137
|
- sig/operations.rbs
|
|
138
|
+
- sig/option_catalog.rbs
|
|
126
139
|
- sig/owned.rbs
|
|
140
|
+
- sig/program.rbs
|
|
127
141
|
- sig/snapshot.rbs
|
|
128
142
|
- sig/terminal.rbs
|
|
129
143
|
homepage: https://github.com/libtmux/libtmux-ruby
|
|
@@ -131,7 +145,8 @@ licenses:
|
|
|
131
145
|
- MIT
|
|
132
146
|
metadata:
|
|
133
147
|
source_code_uri: https://github.com/libtmux/libtmux-ruby
|
|
134
|
-
|
|
148
|
+
changelog_uri: https://github.com/libtmux/libtmux-ruby/blob/master/gems/libtmux/CHANGELOG.md
|
|
149
|
+
documentation_uri: https://libtmux.org/en/ruby/v0.1.3/
|
|
135
150
|
rdoc_options: []
|
|
136
151
|
require_paths:
|
|
137
152
|
- lib
|