-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathiTerm2GeneratedScriptingBridge.h
155 lines (125 loc) · 7.96 KB
/
iTerm2GeneratedScriptingBridge.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
/*
* iTerm2.h
*/
#import <AppKit/AppKit.h>
#import <ScriptingBridge/ScriptingBridge.h>
@class iTerm2Application, iTerm2Window, iTerm2Tab, iTerm2Session;
enum iTerm2SaveOptions {
iTerm2SaveOptionsYes = 'yes ' /* Save the file. */,
iTerm2SaveOptionsNo = 'no ' /* Do not save the file. */,
iTerm2SaveOptionsAsk = 'ask ' /* Ask the user whether or not to save the file. */
};
typedef enum iTerm2SaveOptions iTerm2SaveOptions;
@protocol iTerm2GenericMethods
- (void)delete; // Delete an object.
- (void)duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy object(s) and put the copies at a new location.
- (BOOL)exists; // Verify if an object exists.
- (void)moveTo:(SBObject *)to; // Move object(s) to a new location.
- (void)close; // Close a document.
- (iTerm2Tab *)createTabWithProfile:(NSString *)withProfile command:(NSString *)command; // Create a new tab
- (iTerm2Tab *)createTabWithDefaultProfileCommand:(NSString *)command; // Create a new tab with the default profile
- (void)writeContentsOfFile:(NSURL *)contentsOfFile text:(NSString *)text newline:(BOOL)newline; // Send text as though it was typed.
- (void)select; // Make receiver visible and selected.
- (iTerm2Session *)splitVerticallyWithProfile:(NSString *)withProfile command:(NSString *)command; // Split a session vertically.
- (iTerm2Session *)splitVerticallyWithDefaultProfileCommand:(NSString *)command; // Split a session vertically, using the default profile for the new session
- (iTerm2Session *)splitVerticallyWithSameProfileCommand:(NSString *)command; // Split a session vertically, using the original session's profile for the new session
- (iTerm2Session *)splitHorizontallyWithProfile:(NSString *)withProfile command:(NSString *)command; // Split a session horizontally.
- (iTerm2Session *)splitHorizontallyWithDefaultProfileCommand:(NSString *)command; // Split a session horizontally, using the default profile for the new session
- (iTerm2Session *)splitHorizontallyWithSameProfileCommand:(NSString *)command; // Split a session horizontally, using the original session's profile for the new session
- (NSString *)variableNamed:(NSString *)named; // Returns the value of a session variable with the given name
- (NSString *)setVariableNamed:(NSString *)named to:(NSString *)to; // Sets the value of a session variable
- (void)revealHotkeyWindow; // Reveals a hotkey window. Only to be called on windows that are hotkey windows.
- (void)hideHotkeyWindow; // Hides a hotkey window. Only to be called on windows that are hotkey windows.
- (void)toggleHotkeyWindow; // Toggles the visibility of a hotkey window. Only to be called on windows that are hotkey windows.
@end
/*
* Standard Suite
*/
// The application's top-level scripting object.
@interface iTerm2Application : SBApplication
- (SBElementArray<iTerm2Window *> *)windows;
@property (copy) iTerm2Window *currentWindow; // The frontmost window
@property (copy, readonly) NSString *name; // The name of the application.
@property (readonly) BOOL frontmost; // Is this the frontmost (active) application?
@property (copy, readonly) NSString *version; // The version of the application.
- (iTerm2Window *)createWindowWithProfile:(NSString *)x command:(NSString *)command; // Create a new window
- (iTerm2Window *)createHotkeyWindowWithProfile:(NSString *)x; // Create a hotkey window
- (iTerm2Window *)createWindowWithDefaultProfileCommand:(NSString *)command; // Create a new window with the default profile
@end
// A window.
@interface iTerm2Window : SBObject <iTerm2GenericMethods>
- (SBElementArray<iTerm2Tab *> *)tabs;
- (NSInteger)id; // The unique identifier of the session.
@property (copy, readonly) NSString *alternateIdentifier; // The alternate unique identifier of the session.
@property (copy, readonly) NSString *name; // The full title of the window.
@property NSInteger index; // The index of the window, ordered front to back.
@property NSRect bounds; // The bounding rectangle of the window.
@property (readonly) BOOL closeable; // Whether the window has a close box.
@property (readonly) BOOL miniaturizable; // Whether the window can be minimized.
@property BOOL miniaturized; // Whether the window is currently minimized.
@property (readonly) BOOL resizable; // Whether the window can be resized.
@property BOOL visible; // Whether the window is currently visible.
@property (readonly) BOOL zoomable; // Whether the window can be zoomed.
@property BOOL zoomed; // Whether the window is currently zoomed.
@property BOOL frontmost; // Whether the window is currently the frontmost window.
@property (copy) iTerm2Tab *currentTab; // The currently selected tab
@property (copy) iTerm2Session *currentSession; // The current session in a window
@property BOOL isHotkeyWindow; // Whether the window is a hotkey window.
@property (copy) NSString *hotkeyWindowProfile; // If the window is a hotkey window, this gives the name of the profile that created the window.
@property NSPoint position; // The position of the window, relative to the upper left corner of the screen.
@property NSPoint origin; // The position of the window, relative to the lower left corner of the screen.
@property NSPoint size; // The width and height of the window
@property NSRect frame; // The bounding rectangle, relative to the lower left corner of the screen.
@end
/*
* iTerm2 Suite
*/
// A terminal tab
@interface iTerm2Tab : SBObject <iTerm2GenericMethods>
- (SBElementArray<iTerm2Session *> *)sessions;
@property (copy) iTerm2Session *currentSession; // The current session in a tab
@property NSInteger index; // Index of tab in parent tab view control
@end
// A terminal session
@interface iTerm2Session : SBObject <iTerm2GenericMethods>
- (NSString *)id; // The unique identifier of the session.
@property BOOL isProcessing; // The session has received output recently.
@property BOOL isAtShellPrompt; // The terminal is at the shell prompt. Requires shell integration.
@property NSInteger columns;
@property NSInteger rows;
@property (copy, readonly) NSString *tty;
@property (copy) NSString *contents; // The currently visible contents of the session.
@property (copy, readonly) NSString *text; // The currently visible contents of the session.
@property (copy) NSString *colorPreset;
@property (copy) NSColor *backgroundColor;
@property (copy) NSColor *boldColor;
@property (copy) NSColor *cursorColor;
@property (copy) NSColor *cursorTextColor;
@property (copy) NSColor *foregroundColor;
@property (copy) NSColor *selectedTextColor;
@property (copy) NSColor *selectionColor;
@property (copy) NSColor *ANSIBlackColor;
@property (copy) NSColor *ANSIRedColor;
@property (copy) NSColor *ANSIGreenColor;
@property (copy) NSColor *ANSIYellowColor;
@property (copy) NSColor *ANSIBlueColor;
@property (copy) NSColor *ANSIMagentaColor;
@property (copy) NSColor *ANSICyanColor;
@property (copy) NSColor *ANSIWhiteColor;
@property (copy) NSColor *ANSIBrightBlackColor;
@property (copy) NSColor *ANSIBrightRedColor;
@property (copy) NSColor *ANSIBrightGreenColor;
@property (copy) NSColor *ANSIBrightYellowColor;
@property (copy) NSColor *ANSIBrightBlueColor;
@property (copy) NSColor *ANSIBrightMagentaColor;
@property (copy) NSColor *ANSIBrightCyanColor;
@property (copy) NSColor *ANSIBrightWhiteColor;
@property (copy) NSColor *underlineColor;
@property BOOL useUnderlineColor; // Whether the use a dedicated color for underlining.
@property (copy) NSString *backgroundImage;
@property (copy) NSString *name;
@property double transparency;
@property (copy, readonly) NSString *uniqueID;
@property (copy, readonly) NSString *profileName; // The session's profile name
@property (copy) NSString *answerbackString; // ENQ Answerback string
@end