libtmux 0.1.0.alpha.1
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 +7 -0
- data/LICENSE +21 -0
- data/README.md +109 -0
- data/lib/libtmux/capture.rb +146 -0
- data/lib/libtmux/catalog.rb +116 -0
- data/lib/libtmux/child.rb +156 -0
- data/lib/libtmux/control.rb +885 -0
- data/lib/libtmux/criteria.rb +410 -0
- data/lib/libtmux/endpoint.rb +213 -0
- data/lib/libtmux/entity.rb +262 -0
- data/lib/libtmux/errors.rb +54 -0
- data/lib/libtmux/group.rb +59 -0
- data/lib/libtmux/metadata.rb +85 -0
- data/lib/libtmux/operations.rb +412 -0
- data/lib/libtmux/options.rb +180 -0
- data/lib/libtmux/owned.rb +252 -0
- data/lib/libtmux/process.rb +327 -0
- data/lib/libtmux/process_wait.rb +66 -0
- data/lib/libtmux/selection.rb +95 -0
- data/lib/libtmux/server.rb +534 -0
- data/lib/libtmux/snapshot.rb +428 -0
- data/lib/libtmux/socket_readiness.rb +232 -0
- data/lib/libtmux/source_query.rb +57 -0
- data/lib/libtmux/terminal.rb +197 -0
- data/lib/libtmux/version.rb +5 -0
- data/lib/libtmux.rb +18 -0
- data/schema/where-v1.json +2291 -0
- data/sig/control.rbs +75 -0
- data/sig/criteria.rbs +36 -0
- data/sig/fields.rbs +72 -0
- data/sig/group.rbs +14 -0
- data/sig/libtmux.rbs +186 -0
- data/sig/operations.rbs +91 -0
- data/sig/owned.rbs +7 -0
- data/sig/snapshot.rbs +70 -0
- data/sig/terminal.rbs +15 -0
- metadata +145 -0
data/sig/control.rbs
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
module LibTmux
|
|
2
|
+
class GuardedBlock
|
|
3
|
+
def initialize: (guard: Array[Integer], body: String, terminator: :end | :error, bytesize: Integer, opening: String, closing: String) -> void
|
|
4
|
+
attr_reader guard: Array[Integer]
|
|
5
|
+
attr_reader body: String
|
|
6
|
+
attr_reader terminator: :end | :error
|
|
7
|
+
attr_reader bytesize: Integer
|
|
8
|
+
def raw: () -> String
|
|
9
|
+
def guard_success?: () -> bool
|
|
10
|
+
def inspect: () -> String
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
class GuardedReply
|
|
14
|
+
def initialize: (request_id: Integer, blocks: Array[GuardedBlock], generation: String) -> void
|
|
15
|
+
attr_reader request_id: Integer
|
|
16
|
+
attr_reader blocks: Array[GuardedBlock]
|
|
17
|
+
attr_reader generation: String
|
|
18
|
+
def delivery: () -> :observed
|
|
19
|
+
def attribution: () -> :boundary_window
|
|
20
|
+
def inspect: () -> String
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
class ControlEvent
|
|
24
|
+
def initialize: (kind: Symbol, raw: String, ?data: String?, ?pane_id: String?, ?sequence: Integer?, ?generation: String?, ?lost_sequences: Array[Integer]?, ?dropped_bytes: Integer?, ?reason: Symbol?, ?previous_generation: String?) -> void
|
|
25
|
+
attr_reader kind: Symbol
|
|
26
|
+
attr_reader raw: String
|
|
27
|
+
attr_reader data: String?
|
|
28
|
+
attr_reader pane_id: String?
|
|
29
|
+
attr_reader sequence: Integer?
|
|
30
|
+
attr_reader generation: String?
|
|
31
|
+
attr_reader previous_generation: String?
|
|
32
|
+
attr_reader reason: Symbol?
|
|
33
|
+
attr_reader lost_sequences: Array[Integer]?
|
|
34
|
+
attr_reader dropped_bytes: Integer?
|
|
35
|
+
def bytesize: () -> Integer
|
|
36
|
+
def inspect: () -> String
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
class SubscriptionOverflow < CapacityError
|
|
40
|
+
attr_reader sequence: Integer?
|
|
41
|
+
def initialize: (sequence: Integer?) -> void
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
class ControlSubscription
|
|
45
|
+
include Enumerable[ControlEvent]
|
|
46
|
+
attr_reader generation: String?
|
|
47
|
+
def initialize: (?max_bytes: Integer, ?max_events: Integer, ?mode: :reliable | :tail, ?pane_id: String?, ?generation: String?) -> void
|
|
48
|
+
def next: (?timeout: Numeric?) -> ControlEvent
|
|
49
|
+
def each: () { (ControlEvent) -> untyped } -> self
|
|
50
|
+
| () -> Enumerator[ControlEvent, self]
|
|
51
|
+
def close: () -> nil
|
|
52
|
+
def closed?: () -> bool
|
|
53
|
+
def diagnostics: () -> {queued_events: Integer, retained_event_bytes: Integer, gap_pending: bool, overflowed: bool, closed: bool, mode: :reliable | :tail, limits: {max_bytes: Integer, max_events: Integer}}
|
|
54
|
+
def inspect: () -> String
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
class ControlConnection
|
|
58
|
+
attr_reader pid: Integer
|
|
59
|
+
attr_reader generation: String
|
|
60
|
+
attr_reader previous_generation: String?
|
|
61
|
+
attr_reader events: ControlSubscription
|
|
62
|
+
attr_reader cleanup_errors: Array[String]
|
|
63
|
+
def self.open: [T] (binding: untyped, session_id: String, ?reconnect: ControlConnection?, **Integer) { (ControlConnection) -> T } -> T
|
|
64
|
+
| (binding: untyped, session_id: String, ?reconnect: ControlConnection?, **Integer) -> ControlConnection
|
|
65
|
+
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
|
+
def exchange: (String, ?timeout: Numeric, ?cancel: untyped) -> GuardedReply
|
|
67
|
+
def pause_output: (pane_id: String, ?timeout: Numeric, ?cancel: untyped) -> GuardedReply
|
|
68
|
+
def resume_output: (pane_id: String, ?timeout: Numeric, ?cancel: untyped) -> GuardedReply
|
|
69
|
+
def subscribe: (?pane_id: String?, ?mode: :reliable | :tail, ?max_bytes: Integer, ?max_events: Integer) -> ControlSubscription
|
|
70
|
+
def close: (?timeout: Numeric) -> nil
|
|
71
|
+
def closed?: () -> bool
|
|
72
|
+
def diagnostics: () -> {admitted_requests: Integer, incomplete_requests: Integer, queued_requests: Integer, writing_requests: Integer, awaiting_reply: Integer, reserved_wire_bytes: Integer, retained_reply_bytes: Integer, stderr_received_bytes: Integer, subscription_count: Integer, stopping: bool, finished: bool, cleanup_error_count: Integer, limits: {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}}
|
|
73
|
+
def inspect: () -> String
|
|
74
|
+
end
|
|
75
|
+
end
|
data/sig/criteria.rbs
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
module LibTmux
|
|
2
|
+
class FilterExpr
|
|
3
|
+
private def self.new: (*untyped, **untyped) -> instance
|
|
4
|
+
PROFILE: String
|
|
5
|
+
VERSION: Integer
|
|
6
|
+
attr_reader entity: Symbol
|
|
7
|
+
def self.build: (Symbol, ?untyped, **untyped) -> FilterExpr
|
|
8
|
+
def self.from_json: (String) -> FilterExpr
|
|
9
|
+
def self.json_schema: () -> Hash[String, untyped]
|
|
10
|
+
def and: (FilterExpr) -> FilterExpr
|
|
11
|
+
def or: (FilterExpr) -> FilterExpr
|
|
12
|
+
def not: () -> FilterExpr
|
|
13
|
+
def call: (untyped) -> bool
|
|
14
|
+
alias === call
|
|
15
|
+
def to_proc: () -> ^(untyped) -> bool
|
|
16
|
+
def to_h: () -> Hash[String, untyped]
|
|
17
|
+
def to_json: (*untyped) -> String
|
|
18
|
+
def inspect: () -> String
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
module SessionWhere
|
|
22
|
+
def self.build: (?untyped, **untyped) -> FilterExpr
|
|
23
|
+
end
|
|
24
|
+
module WindowWhere
|
|
25
|
+
def self.build: (?untyped, **untyped) -> FilterExpr
|
|
26
|
+
end
|
|
27
|
+
module PaneWhere
|
|
28
|
+
def self.build: (?untyped, **untyped) -> FilterExpr
|
|
29
|
+
end
|
|
30
|
+
module WindowLinkWhere
|
|
31
|
+
def self.build: (?untyped, **untyped) -> FilterExpr
|
|
32
|
+
end
|
|
33
|
+
module ClientWhere
|
|
34
|
+
def self.build: (?untyped, **untyped) -> FilterExpr
|
|
35
|
+
end
|
|
36
|
+
end
|
data/sig/fields.rbs
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Generated by scripts/generate; edit the catalog.
|
|
2
|
+
module LibTmux
|
|
3
|
+
class SessionSnapshot < CapturedRecord
|
|
4
|
+
def id: () -> String
|
|
5
|
+
def name: () -> String
|
|
6
|
+
def created: () -> Integer
|
|
7
|
+
def attached: () -> Integer
|
|
8
|
+
def window_count: () -> Integer
|
|
9
|
+
def windows: () -> Selection[WindowSnapshot]
|
|
10
|
+
def window_links: () -> Selection[WindowLinkSnapshot]
|
|
11
|
+
def panes: () -> Selection[PaneSnapshot]
|
|
12
|
+
def current_window: () -> WindowSnapshot?
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
class WindowSnapshot < CapturedRecord
|
|
16
|
+
def id: () -> String
|
|
17
|
+
def name: () -> String
|
|
18
|
+
def width: () -> Integer
|
|
19
|
+
def height: () -> Integer
|
|
20
|
+
def pane_count: () -> Integer
|
|
21
|
+
def layout: () -> String
|
|
22
|
+
def panes: () -> Selection[PaneSnapshot]
|
|
23
|
+
def window_links: () -> Selection[WindowLinkSnapshot]
|
|
24
|
+
def active_pane: () -> PaneSnapshot?
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
class PaneSnapshot < CapturedRecord
|
|
28
|
+
def id: () -> String
|
|
29
|
+
def window_id: () -> String
|
|
30
|
+
def index: () -> Integer
|
|
31
|
+
def pid: () -> Integer
|
|
32
|
+
def current_command: () -> String
|
|
33
|
+
def current_path: () -> String?
|
|
34
|
+
def title: () -> String
|
|
35
|
+
def active: () -> bool
|
|
36
|
+
alias active? active
|
|
37
|
+
def dead: () -> bool
|
|
38
|
+
alias dead? dead
|
|
39
|
+
def dead_status: () -> Integer?
|
|
40
|
+
def width: () -> Integer
|
|
41
|
+
def height: () -> Integer
|
|
42
|
+
def window: () -> WindowSnapshot
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
class WindowLinkSnapshot < CapturedRecord
|
|
46
|
+
def session_id: () -> String
|
|
47
|
+
def window_id: () -> String
|
|
48
|
+
def index: () -> Integer
|
|
49
|
+
def active: () -> bool
|
|
50
|
+
alias active? active
|
|
51
|
+
def session: () -> SessionSnapshot
|
|
52
|
+
def window: () -> WindowSnapshot
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
class ClientSnapshot < CapturedRecord
|
|
56
|
+
def name: () -> String
|
|
57
|
+
def pid: () -> Integer
|
|
58
|
+
def created: () -> Integer
|
|
59
|
+
def tty: () -> String?
|
|
60
|
+
def session_id: () -> String?
|
|
61
|
+
def width: () -> Integer
|
|
62
|
+
def height: () -> Integer?
|
|
63
|
+
def read_only: () -> bool
|
|
64
|
+
alias read_only? read_only
|
|
65
|
+
def utf8: () -> bool
|
|
66
|
+
alias utf8? utf8
|
|
67
|
+
def control_mode: () -> bool
|
|
68
|
+
alias control_mode? control_mode
|
|
69
|
+
def session: () -> SessionSnapshot?
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
end
|
data/sig/group.rbs
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
module LibTmux
|
|
2
|
+
class GroupResult
|
|
3
|
+
private def self.new: (*untyped, **untyped) -> instance
|
|
4
|
+
attr_reader result: CommandResult
|
|
5
|
+
attr_reader steps: Array[Hash[Symbol, Integer | Symbol]]
|
|
6
|
+
def success?: () -> bool
|
|
7
|
+
def delivery: () -> :observed
|
|
8
|
+
def inspect: () -> String
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
class Server
|
|
12
|
+
def run_group: (Array[Array[String]], ?input: String, ?timeout: Numeric, ?cancel: untyped) -> GroupResult
|
|
13
|
+
end
|
|
14
|
+
end
|
data/sig/libtmux.rbs
ADDED
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
module LibTmux
|
|
2
|
+
class Cancellation
|
|
3
|
+
def initialize: () -> void
|
|
4
|
+
attr_reader reader: IO
|
|
5
|
+
def cancel: () -> void
|
|
6
|
+
def cancelled?: () -> bool
|
|
7
|
+
def close: () -> void
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
VERSION: String
|
|
11
|
+
|
|
12
|
+
class Error < StandardError
|
|
13
|
+
attr_reader delivery: Symbol
|
|
14
|
+
attr_reader phase: Symbol?
|
|
15
|
+
attr_reader pid: Integer?
|
|
16
|
+
attr_reader cleanup_errors: Array[String]
|
|
17
|
+
attr_reader entity: Symbol?
|
|
18
|
+
attr_reader path: String?
|
|
19
|
+
attr_reader expected: String?
|
|
20
|
+
def initialize: (String, ?delivery: Symbol, ?phase: Symbol?, ?pid: Integer?, ?cleanup_errors: Array[String], ?entity: Symbol?, ?path: String?, ?expected: String?) -> void
|
|
21
|
+
end
|
|
22
|
+
class InvalidFilterError < Error
|
|
23
|
+
def initialize: (?String, ?entity: Symbol?, ?path: String, ?expected: String?, **untyped) -> void
|
|
24
|
+
end
|
|
25
|
+
class IncompleteSnapshotError < Error
|
|
26
|
+
end
|
|
27
|
+
class InconsistentSnapshotError < Error
|
|
28
|
+
end
|
|
29
|
+
class NoMatchError < Error
|
|
30
|
+
end
|
|
31
|
+
class MultipleMatchesError < Error
|
|
32
|
+
end
|
|
33
|
+
class TargetNotFoundError < Error
|
|
34
|
+
end
|
|
35
|
+
class FieldDecodeError < Error
|
|
36
|
+
end
|
|
37
|
+
class UnsupportedFeatureError < Error
|
|
38
|
+
end
|
|
39
|
+
class TransportError < Error
|
|
40
|
+
end
|
|
41
|
+
class ProtocolError < Error
|
|
42
|
+
end
|
|
43
|
+
class CapacityError < Error
|
|
44
|
+
end
|
|
45
|
+
class DeadlineExceeded < Error
|
|
46
|
+
end
|
|
47
|
+
class Cancelled < Error
|
|
48
|
+
end
|
|
49
|
+
class OutcomeUnknown < Error
|
|
50
|
+
end
|
|
51
|
+
class ClosedError < Error
|
|
52
|
+
end
|
|
53
|
+
class CommandError < Error
|
|
54
|
+
attr_reader result: CommandResult?
|
|
55
|
+
def initialize: (?String, ?result: CommandResult?, **untyped) -> void
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
class Endpoint
|
|
59
|
+
attr_reader executable: String
|
|
60
|
+
attr_reader socket_path: String
|
|
61
|
+
def initialize: (?socket_path: String?, ?socket_name: String?, ?executable: String, ?socket_directory: String?) -> void
|
|
62
|
+
def self.from_env: (?untyped, **untyped) -> Endpoint
|
|
63
|
+
def ==: (untyped) -> bool
|
|
64
|
+
alias eql? ==
|
|
65
|
+
def hash: () -> Integer
|
|
66
|
+
def inspect: () -> String
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
class CommandResult
|
|
70
|
+
attr_reader stdout: String
|
|
71
|
+
attr_reader stderr: String
|
|
72
|
+
attr_reader status: Process::Status
|
|
73
|
+
attr_reader elapsed_seconds: Float
|
|
74
|
+
attr_reader pid: Integer
|
|
75
|
+
attr_reader argv: Array[String]
|
|
76
|
+
def initialize: (stdout: String, stderr: String, status: Process::Status, elapsed_seconds: Float, pid: Integer, argv: Array[String]) -> void
|
|
77
|
+
def success?: () -> bool
|
|
78
|
+
def delivery: () -> :observed
|
|
79
|
+
def text: (?invalid: :strict | :replace) -> String
|
|
80
|
+
def inspect: () -> String
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
class EntityRef
|
|
84
|
+
private def self.new: (*untyped, **untyped) -> instance
|
|
85
|
+
attr_reader binding_key: String
|
|
86
|
+
attr_reader kind: :session | :window | :pane | :window_link
|
|
87
|
+
attr_reader id: String
|
|
88
|
+
attr_reader session_id: String?
|
|
89
|
+
attr_reader index: Integer?
|
|
90
|
+
def ==: (untyped) -> bool
|
|
91
|
+
alias eql? ==
|
|
92
|
+
def hash: () -> Integer
|
|
93
|
+
def inspect: () -> String
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
class CreationReceipt
|
|
97
|
+
private def self.new: (*untyped, **untyped) -> instance
|
|
98
|
+
attr_reader entity: Session | Window
|
|
99
|
+
attr_reader window: Window
|
|
100
|
+
attr_reader pane: Pane
|
|
101
|
+
attr_reader result: CommandResult
|
|
102
|
+
def inspect: () -> String
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
class Entity
|
|
106
|
+
private def self.new: (*untyped, **untyped) -> instance
|
|
107
|
+
attr_reader server: Server
|
|
108
|
+
attr_reader ref: EntityRef
|
|
109
|
+
def id: () -> String
|
|
110
|
+
def snapshot: (**untyped) -> CapturedRecord
|
|
111
|
+
def ==: (untyped) -> bool
|
|
112
|
+
alias eql? ==
|
|
113
|
+
def hash: () -> Integer
|
|
114
|
+
def kill: (?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
115
|
+
def inspect: () -> String
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
class Session < Entity
|
|
119
|
+
def snapshot: (**untyped) -> SessionSnapshot
|
|
120
|
+
def kill: (?expected_windows: Array[EntityRef]?, ?expected_panes: Array[EntityRef]?, ?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
121
|
+
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
|
|
122
|
+
| (name: String, command: Array[String], ?receipt: false, ?index: Integer?, ?cwd: String?, ?environment: Hash[String, String], ?focus: bool, ?timeout: Numeric, ?cancel: untyped) -> Window
|
|
123
|
+
def list_windows: (?timeout: Numeric, ?cancel: untyped) -> Array[Window]
|
|
124
|
+
def list_panes: (?timeout: Numeric, ?cancel: untyped) -> Array[Pane]
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
class Window < Entity
|
|
128
|
+
def snapshot: (**untyped) -> WindowSnapshot
|
|
129
|
+
def list_panes: (?timeout: Numeric, ?cancel: untyped) -> Array[Pane]
|
|
130
|
+
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
|
+
def select_layout: (String | Symbol, ?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
class Pane < Entity
|
|
135
|
+
def snapshot: (**untyped) -> PaneSnapshot
|
|
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
|
|
137
|
+
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
|
+
def send_text: (String, ?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
139
|
+
def send_keys: (*String, ?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
class Server
|
|
143
|
+
attr_reader endpoint: Endpoint
|
|
144
|
+
def self.open: [T] (?endpoint: Endpoint?, ?socket_path: String?, ?socket_name: String?, ?executable: String, ?max_requests: Integer, ?max_controls: Integer, ?close_timeout: Numeric) { (Server) -> T } -> T
|
|
145
|
+
| (?endpoint: Endpoint?, ?socket_path: String?, ?socket_name: String?, ?executable: String, ?max_requests: Integer, ?max_controls: Integer, ?close_timeout: Numeric) -> Server
|
|
146
|
+
def initialize: (?endpoint: Endpoint?, ?socket_path: String?, ?socket_name: String?, ?executable: String, ?max_requests: Integer, ?max_controls: Integer, ?close_timeout: Numeric) -> void
|
|
147
|
+
def run: (Array[String], ?input: String, ?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
148
|
+
def close: () -> nil
|
|
149
|
+
def diagnostics: () -> {admitted_requests: Integer, reserved_process_slots: Integer, control_connections: Integer, closed: bool, limits: {max_requests: Integer, max_controls: Integer, close_timeout: Numeric}}
|
|
150
|
+
def kill: (?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
151
|
+
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
|
|
152
|
+
| (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
|
|
153
|
+
def list_sessions: (?timeout: Numeric, ?cancel: untyped) -> Array[Session]
|
|
154
|
+
def list_windows: (?timeout: Numeric, ?cancel: untyped) -> Array[Window]
|
|
155
|
+
def list_panes: (?timeout: Numeric, ?cancel: untyped) -> Array[Pane]
|
|
156
|
+
def session: (EntityRef) -> Session
|
|
157
|
+
def window: (EntityRef) -> Window
|
|
158
|
+
def pane: (EntityRef) -> Pane
|
|
159
|
+
def snapshot: (?timeout: Numeric, ?cancel: untyped, ?clients: bool, ?max_bytes: Integer, ?max_rows: Integer, ?max_field_bytes: Integer) -> Snapshot
|
|
160
|
+
def search_panes: (?where: untyped, ?pushdown: Symbol, **untyped) -> Selection[PaneSnapshot]
|
|
161
|
+
def explain_panes: (?where: untyped, ?pushdown: Symbol) -> Hash[Symbol, untyped]
|
|
162
|
+
def open_control: [T] (session: EntityRef, ?reconnect: ControlConnection?, **untyped) { (ControlConnection) -> T } -> T
|
|
163
|
+
| (session: EntityRef, ?reconnect: ControlConnection?, **untyped) -> ControlConnection
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
class Selection[Elem]
|
|
167
|
+
include Enumerable[Elem]
|
|
168
|
+
def initialize: (Enumerable[Elem], ?entity: Symbol?, ?graph: untyped) -> void
|
|
169
|
+
def each: () { (Elem) -> untyped } -> self
|
|
170
|
+
| () -> Enumerator[Elem, self]
|
|
171
|
+
def select: () { (Elem) -> untyped } -> Selection[Elem]
|
|
172
|
+
| () -> Enumerator[Elem, Selection[Elem]]
|
|
173
|
+
alias filter select
|
|
174
|
+
alias find_all select
|
|
175
|
+
def reject: () { (Elem) -> untyped } -> Selection[Elem]
|
|
176
|
+
| () -> Enumerator[Elem, Selection[Elem]]
|
|
177
|
+
def to_a: () -> Array[Elem]
|
|
178
|
+
def size: () -> Integer
|
|
179
|
+
alias length size
|
|
180
|
+
def empty?: () -> bool
|
|
181
|
+
def where: (?untyped, **untyped) -> Selection[Elem]
|
|
182
|
+
def one: (?untyped, **untyped) -> Elem
|
|
183
|
+
def one_or_nil: (?untyped, **untyped) -> Elem?
|
|
184
|
+
def exists?: (?untyped, **untyped) -> bool
|
|
185
|
+
end
|
|
186
|
+
end
|
data/sig/operations.rbs
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
module LibTmux
|
|
2
|
+
class OptionValue
|
|
3
|
+
private def self.new: (*untyped, **untyped) -> instance
|
|
4
|
+
attr_reader name: String
|
|
5
|
+
attr_reader index: Integer?
|
|
6
|
+
attr_reader raw: String
|
|
7
|
+
def inherited?: () -> bool
|
|
8
|
+
def array?: () -> bool
|
|
9
|
+
def present?: () -> bool
|
|
10
|
+
def as: (:bytes | :string) -> String
|
|
11
|
+
| (:integer) -> Integer
|
|
12
|
+
| (:boolean) -> bool
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
class Options
|
|
16
|
+
private def self.new: (*untyped, **untyped) -> instance
|
|
17
|
+
def list: (?name: String?, ?inherited: bool, ?timeout: Numeric, ?cancel: untyped) -> Array[OptionValue]
|
|
18
|
+
def get: (String, ?index: Integer?, ?inherited: bool, ?timeout: Numeric, ?cancel: untyped) -> OptionValue
|
|
19
|
+
def set: (String, String | Integer | bool, ?index: Integer?, ?append: bool, ?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
20
|
+
def unset: (String, ?index: Integer?, ?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
class Hooks < Options
|
|
24
|
+
def set: (String, command: String, ?index: Integer?, ?append: bool, ?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
25
|
+
def run: (String, ?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
class Server
|
|
29
|
+
def options: (?scope: :server | :session | :window) -> Options
|
|
30
|
+
def hooks: (?scope: :session | :window) -> Hooks
|
|
31
|
+
def display: (String, ?target: EntityRef?, ?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
32
|
+
def source_file: (String, ?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
33
|
+
def wait_for: (String, ?action: :wait | :signal | :lock | :unlock, ?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
34
|
+
def write_buffer: (name: String, data: String, ?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
35
|
+
def read_buffer: (String, ?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
36
|
+
def delete_buffer: (String, ?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
37
|
+
def list_buffers: (?timeout: Numeric, ?cancel: untyped) -> Array[{ name: String, size: Integer }]
|
|
38
|
+
def list_window_links: (?timeout: Numeric, ?cancel: untyped) -> Array[WindowLink]
|
|
39
|
+
def window_link: (EntityRef) -> WindowLink
|
|
40
|
+
def list_clients: (?timeout: Numeric, ?cancel: untyped) -> Array[{ name: String, pid: Integer, created: Integer, tty: String?, session_id: String?, control: bool }]
|
|
41
|
+
def set_environment: (String, String, ?hidden: bool, ?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
42
|
+
def environment: (String, ?hidden: bool, ?timeout: Numeric, ?cancel: untyped) -> String?
|
|
43
|
+
def unset_environment: (String, ?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
class Entity
|
|
47
|
+
def options: () -> Options
|
|
48
|
+
def hooks: () -> Hooks
|
|
49
|
+
def display: (String, ?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
class Session
|
|
53
|
+
def rename: (String, ?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
54
|
+
def list_window_links: (?timeout: Numeric, ?cancel: untyped) -> Array[WindowLink]
|
|
55
|
+
def link_window: (EntityRef, index: Integer, ?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
56
|
+
def set_environment: (String, String, ?hidden: bool, ?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
57
|
+
def environment: (String, ?hidden: bool, ?timeout: Numeric, ?cancel: untyped) -> String?
|
|
58
|
+
def unset_environment: (String, ?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
class Window
|
|
62
|
+
def rename: (String, ?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
63
|
+
def respawn: (command: Array[String], ?kill: bool, ?cwd: String?, ?environment: Hash[String, String], ?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
64
|
+
def resize: (?width: Integer?, ?height: Integer?, ?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
class Pane
|
|
68
|
+
def select: (?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
69
|
+
def resize: (?width: Integer?, ?height: Integer?, ?direction: :left | :right | :up | :down | nil, ?amount: Integer, ?zoom: bool, ?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
70
|
+
def swap: (EntityRef, ?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
71
|
+
def join: (EntityRef, direction: :horizontal | :vertical, ?before: bool, ?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
72
|
+
def move: (EntityRef, direction: :horizontal | :vertical, ?before: bool, ?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
73
|
+
def break_out: (session: EntityRef, name: String, ?timeout: Numeric, ?cancel: untyped) -> Window
|
|
74
|
+
def respawn: (command: Array[String], ?kill: bool, ?cwd: String?, ?environment: Hash[String, String], ?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
75
|
+
def paste: (buffer: String, ?delete: bool, ?bracketed: bool, ?separator: String?, ?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
76
|
+
def pipe: (?shell_command: String?, ?input: bool, ?output: bool, ?only_if_closed: bool, ?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
77
|
+
def copy_mode: (?scroll_up: bool, ?exit_on_bottom: bool, ?mouse_drag: bool, ?cancel_mode: bool, ?page_down: bool, ?source: EntityRef?, ?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
78
|
+
def copy_command: (String, *String, ?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
class WindowLink < Entity
|
|
82
|
+
def snapshot: (**untyped) -> WindowLinkSnapshot
|
|
83
|
+
def index: () -> Integer
|
|
84
|
+
def window: () -> Window
|
|
85
|
+
def session: () -> Session
|
|
86
|
+
def select: (?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
87
|
+
def unlink: (?force: bool, ?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
88
|
+
def move: (session: EntityRef, index: Integer, ?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
89
|
+
def swap: (EntityRef, ?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
90
|
+
end
|
|
91
|
+
end
|
data/sig/owned.rbs
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
module LibTmux
|
|
2
|
+
class Server
|
|
3
|
+
def self.start: (?executable: String, ?config: String?, ?timeout: Numeric, ?cancel: untyped, **untyped) -> Server
|
|
4
|
+
| [T] (?executable: String, ?config: String?, ?timeout: Numeric, ?cancel: untyped, **untyped) { (Server) -> T } -> T
|
|
5
|
+
def owned?: () -> bool
|
|
6
|
+
end
|
|
7
|
+
end
|
data/sig/snapshot.rbs
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
module LibTmux
|
|
2
|
+
class CapturedRecord
|
|
3
|
+
private def self.new: (*untyped, **untyped) -> instance
|
|
4
|
+
attr_reader capture_id: String
|
|
5
|
+
def ref: () -> EntityRef
|
|
6
|
+
def raw: (Symbol) -> String?
|
|
7
|
+
def ==: (untyped) -> bool
|
|
8
|
+
alias eql? ==
|
|
9
|
+
def hash: () -> Integer
|
|
10
|
+
def inspect: () -> String
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
class Snapshot
|
|
14
|
+
private def self.new: (*untyped, **untyped) -> instance
|
|
15
|
+
attr_reader capture_id: String
|
|
16
|
+
attr_reader binding_key: String
|
|
17
|
+
attr_reader started_at: Float
|
|
18
|
+
attr_reader finished_at: Float
|
|
19
|
+
attr_reader reads: Array[Hash[Symbol, untyped]]
|
|
20
|
+
attr_reader server_info: Hash[Symbol, untyped]
|
|
21
|
+
attr_reader coverage: Hash[Symbol, untyped]
|
|
22
|
+
def resolve: (EntityRef) -> CapturedRecord
|
|
23
|
+
def inspect: () -> String
|
|
24
|
+
def sessions: () -> Selection[SessionSnapshot]
|
|
25
|
+
def windows: () -> Selection[WindowSnapshot]
|
|
26
|
+
def panes: () -> Selection[PaneSnapshot]
|
|
27
|
+
def window_links: () -> Selection[WindowLinkSnapshot]
|
|
28
|
+
def clients: () -> Selection[ClientSnapshot]
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
module Internal
|
|
32
|
+
module Catalog
|
|
33
|
+
class Field < Data
|
|
34
|
+
attr_reader id: String
|
|
35
|
+
attr_reader name: Symbol
|
|
36
|
+
attr_reader wire_name: String
|
|
37
|
+
attr_reader type: Symbol
|
|
38
|
+
attr_reader nullable: bool
|
|
39
|
+
attr_reader empty_is_null: bool
|
|
40
|
+
attr_reader min: Integer?
|
|
41
|
+
attr_reader max: Integer?
|
|
42
|
+
attr_reader operators: Array[Symbol]
|
|
43
|
+
attr_reader format: String
|
|
44
|
+
attr_reader min_version: String
|
|
45
|
+
attr_reader scope: Symbol
|
|
46
|
+
attr_reader capture_requirements: Array[Symbol]
|
|
47
|
+
end
|
|
48
|
+
class Relation < Data
|
|
49
|
+
attr_reader name: Symbol
|
|
50
|
+
attr_reader wire_name: String
|
|
51
|
+
attr_reader target: Symbol
|
|
52
|
+
attr_reader cardinality: Symbol
|
|
53
|
+
attr_reader nullable: bool
|
|
54
|
+
attr_reader capture_requirements: Array[Symbol]
|
|
55
|
+
end
|
|
56
|
+
class Schema < Data
|
|
57
|
+
attr_reader kind: Symbol
|
|
58
|
+
attr_reader wire_entity: String
|
|
59
|
+
attr_reader fields: Hash[Symbol, Field]
|
|
60
|
+
attr_reader relations: Hash[Symbol, Relation]
|
|
61
|
+
end
|
|
62
|
+
def self.entity: (Symbol) -> Schema
|
|
63
|
+
def self.kinds: () -> Array[Symbol]
|
|
64
|
+
end
|
|
65
|
+
class Capture
|
|
66
|
+
def initialize: (Server, binding_key: String) -> void
|
|
67
|
+
def call: (?timeout: Numeric, ?cancel: untyped, ?clients: bool, ?max_bytes: Integer, ?max_rows: Integer, ?max_field_bytes: Integer) -> Snapshot
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
data/sig/terminal.rbs
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module LibTmux
|
|
2
|
+
class TerminalResult
|
|
3
|
+
private def self.new: (*untyped, **untyped) -> instance
|
|
4
|
+
attr_reader status: Process::Status
|
|
5
|
+
attr_reader pid: Integer
|
|
6
|
+
attr_reader elapsed_seconds: Float
|
|
7
|
+
def success?: () -> bool
|
|
8
|
+
def delivery: () -> :observed
|
|
9
|
+
def inspect: () -> String
|
|
10
|
+
end
|
|
11
|
+
class Server
|
|
12
|
+
def switch_client: (client: String, session: EntityRef, ?timeout: Numeric, ?cancel: untyped) -> CommandResult
|
|
13
|
+
def attach: (session: EntityRef, terminal: IO, term: String, ?read_only: bool, ?timeout: Numeric?, ?cancel: untyped) -> TerminalResult
|
|
14
|
+
end
|
|
15
|
+
end
|