This repository has been archived by the owner on Oct 26, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
iTerm2-borderless.patch
927 lines (876 loc) · 37 KB
/
iTerm2-borderless.patch
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
diff --git a/ThirdParty/PSMTabBarControl/source/PSMDarkTabStyle.m b/ThirdParty/PSMTabBarControl/source/PSMDarkTabStyle.m
index e197d37..4585eda 100644
--- a/ThirdParty/PSMTabBarControl/source/PSMDarkTabStyle.m
+++ b/ThirdParty/PSMTabBarControl/source/PSMDarkTabStyle.m
@@ -17,14 +17,18 @@ - (NSString *)name {
}
+ (NSColor *)tabBarColorWhenKeyAndActive:(BOOL)keyAndActive {
+ // PATCH: (Added) transparent tab bar
+ return [NSColor clearColor];
if (@available(macOS 10.14, *)) {
- return [NSColor colorWithSRGBRed:0 green:0 blue:0 alpha:0.25];
+ return [NSColor colorWithSRGBRed:0 green:0 blue:0 alpha:0.0];
} else {
- return [NSColor colorWithCalibratedWhite:0.12 alpha:1.00];
+ return [NSColor colorWithCalibratedWhite:0.12 alpha:0.00];
}
}
- (NSColor *)tabBarColor {
+ // PATCH: (Added) transparent tab bar
+ return [NSColor clearColor];
return [PSMDarkTabStyle tabBarColorWhenKeyAndActive:self.tabBar.window.isKeyWindow && [NSApp isActive]];
}
@@ -53,6 +57,8 @@ - (NSColor *)topLineColorSelected:(BOOL)selected {
}
- (NSColor *)bottomLineColorSelected:(BOOL)selected {
+ // PATCH: (Added) transparent tab bar bottom line
+ return [NSColor clearColor];
if (@available(macOS 10.14, *)) {
return [NSColor colorWithWhite:0 alpha:0.1];
} else {
@@ -61,6 +67,8 @@ - (NSColor *)bottomLineColorSelected:(BOOL)selected {
}
- (NSColor *)verticalLineColorSelected:(BOOL)selected {
+ // PATCH: (Added) transparent tab bar vertical line
+ return [NSColor clearColor];
if (@available(macOS 10.14, *)) {
return [self topLineColorSelected:selected];
} else {
@@ -69,6 +77,8 @@ - (NSColor *)verticalLineColorSelected:(BOOL)selected {
}
- (NSColor *)backgroundColorSelected:(BOOL)selected highlightAmount:(CGFloat)highlightAmount {
+ // PATCH: (Added) transparent tab bar
+ return [NSColor clearColor];
if (@available(macOS 10.14, *)) {
CGFloat colors[3];
if (self.tabBar.window.isKeyWindow && [NSApp isActive]) {
diff --git a/ThirdParty/PSMTabBarControl/source/PSMTabBarCell.m b/ThirdParty/PSMTabBarControl/source/PSMTabBarCell.m
index 0d83568..fa513b9 100644
--- a/ThirdParty/PSMTabBarControl/source/PSMTabBarCell.m
+++ b/ThirdParty/PSMTabBarControl/source/PSMTabBarCell.m
@@ -400,6 +400,8 @@ - (CGFloat)highlightAmount {
- (void)mouseEntered:(NSEvent *)theEvent {
// check for which tag
+ // PATCH: (Added) Don't show close button if the indicator is visible
+ if (self.hasIcon) return;
if ([theEvent trackingNumber] == _closeButtonTrackingTag) {
_closeButtonOver = YES;
}
diff --git a/ThirdParty/PSMTabBarControl/source/PSMTabBarControl.m b/ThirdParty/PSMTabBarControl/source/PSMTabBarControl.m
index 54b162d..1cdc983 100644
--- a/ThirdParty/PSMTabBarControl/source/PSMTabBarControl.m
+++ b/ThirdParty/PSMTabBarControl/source/PSMTabBarControl.m
@@ -1858,9 +1858,7 @@ - (NSTabViewItem *)tabView:(NSTabView *)tabView unknownObjectWasDropped:(id <NSD
- (NSString *)view:(NSView *)view stringForToolTip:(NSToolTipTag)tag point:(NSPoint)point userData:(void *)userData
{
- if ([[self delegate] respondsToSelector:@selector(tabView:toolTipForTabViewItem:)]) {
- return [[self delegate] tabView:[self tabView] toolTipForTabViewItem:[[self cellForPoint:point cellFrame:nil] representedObject]];
- }
+ // PATCH: (Removed) always return empty string for tab tooltips
return @"";
}
diff --git a/ThirdParty/PSMTabBarControl/source/PSMYosemiteTabStyle.m b/ThirdParty/PSMTabBarControl/source/PSMYosemiteTabStyle.m
index 1fd9750..57fe2db 100644
--- a/ThirdParty/PSMTabBarControl/source/PSMYosemiteTabStyle.m
+++ b/ThirdParty/PSMTabBarControl/source/PSMYosemiteTabStyle.m
@@ -162,12 +162,14 @@ - (void)dealloc {
#pragma mark - Control Specific
- (float)leftMarginForTabBarControl {
- return self.tabBar.insets.left;
+ // PATCH: (Modified) make room for window controls
+ return 70.0f;
}
- (float)rightMarginForTabBarControl {
// Leaves space for overflow control.
- return 24.0f;
+ // PATCH: (Modified) equal left/right margins so single tab window titles are centered
+ return 70.0f;
}
// For vertical orientation
@@ -224,6 +226,11 @@ - (NSRect)closeButtonRectForTabCell:(PSMTabBarCell *)cell {
result.origin.x = cellFrame.origin.x + kSPMTabBarCellInternalXMargin;
result.origin.y = cellFrame.origin.y + floor((cellFrame.size.height - result.size.height) / 2.0);
+ // PATCH: (Added) Move closeButtonRect to display on the left of the tab cell label
+ result.origin.x += cellFrame.size.width / 2 - result.size.width - 13;
+ result.origin.x -= cell.attributedStringValue.size.width / 2;
+ result.origin.y += 1;
+
return result;
}
@@ -459,7 +466,8 @@ - (NSAttributedString *)attributedStringValueForTabCell:(PSMTabBarCell *)cell {
// graphic
NSImage *graphic = [(id)[[cell representedObject] identifier] psmTabGraphic];
- NSFont *font = [NSFont systemFontOfSize:self.fontSize];
+ // PATCH: (Modified) larger font size for tab label
+ NSFont *font = [NSFont systemFontOfSize:NSFont.systemFontSize];
NSDictionary *attributes = @{ NSFontAttributeName: font,
NSForegroundColorAttributeName: [self textColorForCell:cell],
NSParagraphStyleAttributeName: truncatingTailParagraphStyle };
@@ -923,6 +931,8 @@ - (void)drawInteriorWithTabCell:(PSMTabBarCell *)cell
// icon
NSRect iconRect = NSZeroRect;
+ // PATCH: (Moved) we need to access this property later on
+ NSImage *icon = [(id)[[cell representedObject] identifier] icon];
if ([cell hasIcon]) {
iconRect = [self iconRectForTabCell:cell];
NSImage *icon = [(id)[[cell representedObject] identifier] icon];
@@ -935,12 +945,8 @@ - (void)drawInteriorWithTabCell:(PSMTabBarCell *)cell
iconRect.origin.y -= (kPSMTabBarIconWidth - [icon size].height)/2.0;
}
- [icon drawInRect:iconRect
- fromRect:NSZeroRect
- operation:NSCompositingOperationSourceOver
- fraction:1.0
- respectFlipped:YES
- hints:nil];
+ // PATCH: (Removed) Don't draw the icon yet,
+ // we need to mess with tht eframe first, see bottom of this method
}
// object counter
@@ -957,16 +963,12 @@ - (void)drawInteriorWithTabCell:(PSMTabBarCell *)cell
// label rect
NSAttributedString *attributedString = [cell attributedStringValue];
+ // PATCH: (Moved) we need to access this property later on
+ NSRect labelRect;
if (attributedString.length > 0) {
- NSRect labelRect;
labelRect.origin.x = labelPosition;
labelRect.size.width = cellFrame.size.width - (labelRect.origin.x - cellFrame.origin.x) - kPSMTabBarCellPadding;
- if ([cell hasIcon]) {
- // Reduce size of label if there is an icon or activity indicator
- labelRect.size.width -= iconRect.size.width + kPSMTabBarCellIconPadding;
- } else if (![[cell indicator] isHidden]) {
- labelRect.size.width -= cell.indicator.frame.size.width + kPSMTabBarCellIconPadding;
- }
+ // PATCH: (Removed) Don't mmove the label to the left if the indicator is visible
labelRect.size.height = cellFrame.size.height;
if ([cell count] > 0) {
@@ -989,6 +991,19 @@ - (void)drawInteriorWithTabCell:(PSMTabBarCell *)cell
[attributedString drawInRect:labelRect];
}
+
+ // PATCH: (Added) modify the icon frame and draw it
+ if ([cell hasIcon]) {
+ iconRect.origin.x -= labelRect.size.width / 2 + attributedString.size.width / 2 - 13;
+ iconRect.origin.x -= iconRect.size.width; // Remove if we don't move the label over;
+ iconRect.origin.y += 1;
+ [icon drawInRect:iconRect
+ fromRect:NSZeroRect
+ operation:NSCompositingOperationSourceOver
+ fraction:1.0
+ respectFlipped:YES
+ hints:nil];
+ }
}
- (NSColor *)tabBarColor {
@@ -1105,8 +1120,9 @@ - (void)drawTabBar:(PSMTabBarControl *)bar
} else {
insetRect = clipRect;
}
- [self drawHorizontalLineInFrame:NSIntersectionRect(clipRect, insetRect) y:0];
-
+
+ // PATCH: (Removed) Don't draw horizontal lines for tabview
+
// no tab view == not connected
if (![bar tabView]) {
NSRect labelRect = rect;
diff --git a/iTerm2.xcodeproj/project.pbxproj b/iTerm2.xcodeproj/project.pbxproj
index 78ef8f4..0ee299e 100644
--- a/iTerm2.xcodeproj/project.pbxproj
+++ b/iTerm2.xcodeproj/project.pbxproj
@@ -9529,7 +9529,8 @@
DevelopmentTeam = H7V7XYVQ7D;
};
874206460564169600CFC3F1 = {
- ProvisioningStyle = Manual;
+ DevelopmentTeam = 4688J3MK2P;
+ ProvisioningStyle = Automatic;
SystemCapabilities = {
com.apple.HardenedRuntime = {
enabled = 0;
@@ -11972,11 +11973,11 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_INT_CONVERSION = YES;
- CODE_SIGN_IDENTITY = "-";
- CODE_SIGN_STYLE = Manual;
+ CODE_SIGN_IDENTITY = "Mac Developer";
+ CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = YES;
- DEVELOPMENT_TEAM = "";
+ DEVELOPMENT_TEAM = 4688J3MK2P;
ENABLE_HARDENED_RUNTIME = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -12112,7 +12113,7 @@
CODE_SIGN_IDENTITY = "Mac Developer";
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = YES;
- DEVELOPMENT_TEAM = H7V7XYVQ7D;
+ DEVELOPMENT_TEAM = 4688J3MK2P;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)",
@@ -12603,11 +12604,11 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_INT_CONVERSION = YES;
- CODE_SIGN_IDENTITY = "-";
- CODE_SIGN_STYLE = Manual;
+ CODE_SIGN_IDENTITY = "Mac Developer";
+ CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = YES;
- DEVELOPMENT_TEAM = "";
+ DEVELOPMENT_TEAM = 4688J3MK2P;
ENABLE_HARDENED_RUNTIME = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -12779,7 +12780,7 @@
CODE_SIGN_IDENTITY = "Mac Developer";
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = YES;
- DEVELOPMENT_TEAM = H7V7XYVQ7D;
+ DEVELOPMENT_TEAM = 4688J3MK2P;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(SRCROOT)",
@@ -13644,12 +13645,12 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_INT_CONVERSION = YES;
- CODE_SIGN_IDENTITY = "-";
- CODE_SIGN_STYLE = Manual;
+ CODE_SIGN_IDENTITY = "Mac Developer";
+ CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
- DEVELOPMENT_TEAM = "";
+ DEVELOPMENT_TEAM = 4688J3MK2P;
ENABLE_HARDENED_RUNTIME = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -13721,11 +13722,11 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_INT_CONVERSION = YES;
- CODE_SIGN_IDENTITY = "-";
- CODE_SIGN_STYLE = Manual;
+ CODE_SIGN_IDENTITY = "Mac Developer";
+ CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = YES;
- DEVELOPMENT_TEAM = "";
+ DEVELOPMENT_TEAM = 4688J3MK2P;
ENABLE_HARDENED_RUNTIME = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
diff --git a/plists/iTerm2.plist b/plists/iTerm2.plist
index bc2fc2b..7e80879 100644
--- a/plists/iTerm2.plist
+++ b/plists/iTerm2.plist
@@ -2,24 +2,6 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
- <key>NSAppTransportSecurity</key>
- <dict>
- <key>NSExceptionDomains</key>
- <dict>
- <key>127.0.0.1</key>
- <dict>
- <key>NSExceptionAllowsInsecureHTTPLoads</key>
- <true/>
- </dict>
- <key>localhost</key>
- <dict>
- <key>NSExceptionAllowsInsecureHTTPLoads</key>
- <true/>
- </dict>
- </dict>
- </dict>
- <key>NSHumanReadableCopyright</key>
- <string>GPL v2</string>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleDocumentTypes</key>
@@ -42,12 +24,12 @@
<string>Editor</string>
</dict>
<dict>
+ <key>CFBundleTypeName</key>
+ <string>Folders</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>fold</string>
</array>
- <key>CFBundleTypeName</key>
- <string>Folders</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
</dict>
@@ -84,65 +66,6 @@
</array>
</dict>
</array>
- <key>NSAppleEventsUsageDescription</key>
- <string>An application in iTerm2 wants to use AppleScript.</string>
- <key>NSCalendarsUsageDescription</key>
- <string>An application in iTerm2 wants to use Calendar data.</string>
- <key>NSCameraUsageDescription</key>
- <string>An application in iTerm2 wants to use the camera.</string>
- <key>NSContactsUsageDescription</key>
- <string>An application in iTerm2 wants to use your contacts.</string>
- <key>NSLocationAlwaysUsageDescription</key>
- <string>An application in iTerm2 wants to use your location information, even in the background.</string>
- <key>NSLocationUsageDescription</key>
- <string>An application in iTerm2 wants to use your location information.</string>
- <key>NSLocationWhenInUseUsageDescription</key>
- <string>An application in iTerm2 wants to use your location information while active.</string>
- <key>NSMicrophoneUsageDescription</key>
- <string>An application in iTerm2 wants to use your microphone.</string>
- <key>NSRemindersUsageDescription</key>
- <string>An application in iTerm2 wants to use your reminders.</string>
- <key>NSServices</key>
- <array>
- <dict>
- <key>NSMenuItem</key>
- <dict>
- <key>default</key>
- <string>New iTerm2 Tab Here</string>
- </dict>
- <key>NSMessage</key>
- <string>openTab</string>
- <key>NSRequiredContext</key>
- <dict>
- <key>NSTextContent</key>
- <string>FilePath</string>
- </dict>
- <key>NSSendTypes</key>
- <array>
- <string>NSFilenamesPboardType</string>
- <string>public.plain-text</string>
- </array>
- </dict>
- <dict>
- <key>NSMenuItem</key>
- <dict>
- <key>default</key>
- <string>New iTerm2 Window Here</string>
- </dict>
- <key>NSMessage</key>
- <string>openWindow</string>
- <key>NSRequiredContext</key>
- <dict>
- <key>NSTextContent</key>
- <string>FilePath</string>
- </dict>
- <key>NSSendTypes</key>
- <array>
- <string>NSFilenamesPboardType</string>
- <string>public.plain-text</string>
- </array>
- </dict>
- </array>
<key>CFBundleExecutable</key>
<string>iTerm2</string>
<key>CFBundleGetInfoString</key>
@@ -154,7 +77,7 @@
<key>CFBundleIconFile</key>
<string>iTerm2.icns</string>
<key>CFBundleIdentifier</key>
- <string>com.googlecode.iterm2</string>
+ <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
@@ -268,25 +191,102 @@
<string>unknown</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
+ <key>NSAppTransportSecurity</key>
+ <dict>
+ <key>NSExceptionDomains</key>
+ <dict>
+ <key>127.0.0.1</key>
+ <dict>
+ <key>NSExceptionAllowsInsecureHTTPLoads</key>
+ <true/>
+ </dict>
+ <key>localhost</key>
+ <dict>
+ <key>NSExceptionAllowsInsecureHTTPLoads</key>
+ <true/>
+ </dict>
+ </dict>
+ </dict>
+ <key>NSAppleEventsUsageDescription</key>
+ <string>An application in iTerm2 wants to use AppleScript.</string>
<key>NSAppleScriptEnabled</key>
<string>YES</string>
- <key>OSAScriptingDefinition</key>
- <string>iTerm2.sdef</string>
+ <key>NSCalendarsUsageDescription</key>
+ <string>An application in iTerm2 wants to use Calendar data.</string>
+ <key>NSCameraUsageDescription</key>
+ <string>An application in iTerm2 wants to use the camera.</string>
+ <key>NSContactsUsageDescription</key>
+ <string>An application in iTerm2 wants to use your contacts.</string>
<key>NSExtensions</key>
<dict/>
+ <key>NSHumanReadableCopyright</key>
+ <string>GPL v2</string>
+ <key>NSLocationAlwaysUsageDescription</key>
+ <string>An application in iTerm2 wants to use your location information, even in the background.</string>
+ <key>NSLocationUsageDescription</key>
+ <string>An application in iTerm2 wants to use your location information.</string>
+ <key>NSLocationWhenInUseUsageDescription</key>
+ <string>An application in iTerm2 wants to use your location information while active.</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
+ <key>NSMicrophoneUsageDescription</key>
+ <string>An application in iTerm2 wants to use your microphone.</string>
<key>NSPrincipalClass</key>
<string>iTermApplication</string>
- <key>SUPublicDSAKeyFile</key>
- <string>dsa_pub.pem</string>
+ <key>NSRemindersUsageDescription</key>
+ <string>An application in iTerm2 wants to use your reminders.</string>
+ <key>NSServices</key>
+ <array>
+ <dict>
+ <key>NSMenuItem</key>
+ <dict>
+ <key>default</key>
+ <string>New iTerm2 Tab Here</string>
+ </dict>
+ <key>NSMessage</key>
+ <string>openTab</string>
+ <key>NSRequiredContext</key>
+ <dict>
+ <key>NSTextContent</key>
+ <string>FilePath</string>
+ </dict>
+ <key>NSSendTypes</key>
+ <array>
+ <string>NSFilenamesPboardType</string>
+ <string>public.plain-text</string>
+ </array>
+ </dict>
+ <dict>
+ <key>NSMenuItem</key>
+ <dict>
+ <key>default</key>
+ <string>New iTerm2 Window Here</string>
+ </dict>
+ <key>NSMessage</key>
+ <string>openWindow</string>
+ <key>NSRequiredContext</key>
+ <dict>
+ <key>NSTextContent</key>
+ <string>FilePath</string>
+ </dict>
+ <key>NSSendTypes</key>
+ <array>
+ <string>NSFilenamesPboardType</string>
+ <string>public.plain-text</string>
+ </array>
+ </dict>
+ </array>
<key>NSSupportsAutomaticGraphicsSwitching</key>
<true/>
- <key>SUFeedURLForTesting</key>
- <string>https://iterm2.com/appcasts/testing.xml</string>
+ <key>OSAScriptingDefinition</key>
+ <string>iTerm2.sdef</string>
+ <key>SUFeedURL</key>
+ <string>https://iterm2.com/appcasts/final.xml</string>
<key>SUFeedURLForFinal</key>
<string>https://iterm2.com/appcasts/final.xml</string>
- <key>SUFeedURL</key>
- <string>https://iterm2.com/appcasts/final.xml</string>
+ <key>SUFeedURLForTesting</key>
+ <string>https://iterm2.com/appcasts/testing.xml</string>
+ <key>SUPublicDSAKeyFile</key>
+ <string>dsa_pub.pem</string>
</dict>
</plist>
diff --git a/sources/PTYSession.m b/sources/PTYSession.m
index 624603c..2494f98 100644
--- a/sources/PTYSession.m
+++ b/sources/PTYSession.m
@@ -3583,7 +3583,9 @@ - (void)setPreferencesFromAddressBookEntry:(NSDictionary *)aePrefs {
inBookmark:aDict]];
// transparency
- [self setTransparency:[iTermProfilePreferences floatForKey:KEY_TRANSPARENCY inProfile:aDict]];
+ // PATCH: (Modified) now the window appears semi-transparent, not the terminal
+ // So if it's not opaque, make the terminal fully transparent
+ [self setTransparency:[iTermProfilePreferences floatForKey:KEY_TRANSPARENCY inProfile:aDict] == 0 ? 0 : 1];
[self setBlend:[iTermProfilePreferences floatForKey:KEY_BLEND inProfile:aDict]];
[self setTransparencyAffectsOnlyDefaultBackgroundColor:[iTermProfilePreferences floatForKey:KEY_TRANSPARENCY_AFFECTS_ONLY_DEFAULT_BACKGROUND_COLOR inProfile:aDict]];
@@ -3981,10 +3983,7 @@ - (float)transparency
- (void)setTransparency:(float)transparency
{
- // Limit transparency because fully transparent windows can't be clicked on.
- if (transparency > 0.9) {
- transparency = 0.9;
- }
+ // PATCH: (Removed) ignore limit, make terminal fully transparent, they can still be clicked
[_textview setTransparency:transparency];
[self useTransparencyDidChange];
[self.view setNeedsDisplay:YES];
diff --git a/sources/PTYTab.m b/sources/PTYTab.m
index 54ddef3..95197c4 100644
--- a/sources/PTYTab.m
+++ b/sources/PTYTab.m
@@ -557,6 +557,16 @@ - (void)setState:(NSUInteger)flagsToSet reset:(NSUInteger)flagsToReset {
}
- (void)updateIcon {
+ NSArray *commands = [[iTermAdvancedSettingsModel disabledNewOutputIndicatorCommands] componentsSeparatedByString:@","];
+ for (id command in commands) {
+ NSString *trimmedCommand = [command stringByTrimmingCharactersInSet:
+ [NSCharacterSet whitespaceAndNewlineCharacterSet]];
+ if ([[self.activeSession.childJobNames lastObject] isEqualToString:trimmedCommand]) {
+ [self setIcon:nil];
+ return;
+ }
+ }
+
if (_state & kPTYTabDeadState) {
[self setIcon:[PTYTab deadImageWithAppearance:self.realParentWindow.window.effectiveAppearance]];
} else if (_state & kPTYTabBellState) {
@@ -572,6 +582,30 @@ - (void)updateIcon {
}
}
+/*- (void)updateIcon {
+ if (_state & kPTYTabDeadState) {
+ [self setIcon:[PTYTab deadImageWithAppearance:self.realParentWindow.window.effectiveAppearance]];
+ } else if (_state & kPTYTabBellState) {
+ if ([iTermAdvancedSettingsModel showNewOutputIndicatorForBell]) {
+ [self setIcon:[PTYTab imageForNewOutputWithAppearance:self.realParentWindow.window.effectiveAppearance]];
+ [self setState:kPTYTabNewOutputState reset:kPTYTabBellState];
+ [self updateIcon];
+ } else {
+ [self setIcon:[PTYTab bellImage]];
+ }
+ } else if ([iTermPreferences boolForKey:kPreferenceKeyShowNewOutputIndicator] &&
+ (_state & (kPTYTabNewOutputState))) {
+ if (![iTermAdvancedSettingsModel showNewOutputIndicatorForBell]) {
+ [self setIcon:[PTYTab imageForNewOutputWithAppearance:self.realParentWindow.window.effectiveAppearance]];
+ }
+ } else if ([iTermPreferences boolForKey:kPreferenceKeyShowNewOutputIndicator] &&
+ (_state & kPTYTabIdleState)) {
+ [self setIcon:[PTYTab idleImageWithAppearance:self.realParentWindow.window.effectiveAppearance]];
+ } else {
+ [self setIcon:nil];
+ }
+}*/
+
- (void)loadTitleFromSession {
tabViewItem_.label = self.activeSession.name;
}
@@ -584,7 +618,8 @@ - (void)nameOfSession:(PTYSession *)session didChangeTo:(NSString*)newName {
- (void)updateTabTitleForCurrentSessionName:(NSString *)newName {
NSString *value = (self.evaluatedTitleOverride ?: newName) ?: @" ";
- [tabViewItem_ setLabel:value]; // PSM uses bindings to bind the label to its title
+ // PATCH: (Modified) set tab view label to the window title if it's set
+ [tabViewItem_ setLabel:self.activeSession.windowTitle.length != 0 ? self.activeSession.windowTitle : value]; // PSM uses bindings to bind the label to its title
[self.realParentWindow tabTitleDidChange:self];
}
diff --git a/sources/PTYTextView.m b/sources/PTYTextView.m
index 3359c5a..f3a6aaa 100644
--- a/sources/PTYTextView.m
+++ b/sources/PTYTextView.m
@@ -587,7 +587,8 @@ - (BOOL)isFlipped
- (BOOL)isOpaque
{
- return YES;
+ // PATCH: (Modified) transparent so we can see our semi-transparent window
+ return NO;
}
- (void)setHighlightCursorLine:(BOOL)highlightCursorLine {
diff --git a/sources/PseudoTerminal.m b/sources/PseudoTerminal.m
index 04262b2..dea52c2 100644
--- a/sources/PseudoTerminal.m
+++ b/sources/PseudoTerminal.m
@@ -404,12 +404,12 @@ + (void)registerSessionsInArrangement:(NSDictionary *)arrangement {
}
+ (void)updateDecorationsOfWindow:(NSWindow *)myWindow forType:(iTermWindowType)windowType {
- const BOOL isCompact = (windowType == WINDOW_TYPE_COMPACT);
- [myWindow setHasShadow:(windowType == WINDOW_TYPE_NORMAL ||
- isCompact)];
- // Chrome doesn't change titleVisibility so neither do we.
- // Some truly dreadful hacks are used instead. See PTYWindow.m.
- myWindow.titlebarAppearsTransparent = isCompact;
+ // PATCH: (Modified) Native macOS window shadow
+ [myWindow setHasShadow:YES];
+ [myWindow setTitleVisibility:NSWindowTitleHidden];
+
+ // PATCH: (Modified) Hides title bar strip for our tab view instead
+ myWindow.titlebarAppearsTransparent = YES;
}
+ (NSInteger)styleMaskForWindowType:(iTermWindowType)windowType
@@ -418,6 +418,10 @@ + (NSInteger)styleMaskForWindowType:(iTermWindowType)windowType
if (hotkeyWindowType == iTermHotkeyWindowTypeFloatingPanel) {
mask = NSWindowStyleMaskNonactivatingPanel;
}
+
+ // PATCH: (Added) Always use full size content view
+ mask |= NSWindowStyleMaskFullSizeContentView;
+
switch (windowType) {
case WINDOW_TYPE_TOP:
case WINDOW_TYPE_BOTTOM:
@@ -1853,7 +1857,8 @@ - (void)setWindowTitle {
if (self.isShowingTransientTitle) {
PTYSession *session = self.currentSession;
NSString *aTitle;
- if (self.window.frame.size.width < 250) {
+ // PATCH: (Modified) check tab width for displaying size when resizing
+ if (self.window.frame.size.width / (self.tabs.count) < 200) {
aTitle = [NSString stringWithFormat:@"%d✕%d", session.columns, session.rows];
} else {
aTitle = [NSString stringWithFormat:@"%@ \u2014 %d✕%d",
@@ -3549,12 +3554,8 @@ - (NSEdgeInsets)tabBarInsets {
}
- (BOOL)tabBarAlwaysVisible {
- if (@available(macOS 10.14, *)) {
- if (togglingLionFullScreen_ || [self lionFullScreen]) {
- return YES;
- }
- }
- return ![iTermPreferences boolForKey:kPreferenceKeyHideTabBar];
+ // PATCH: (Added) always show tab bar
+ return YES;
}
- (BOOL)anyFullScreen
@@ -4157,8 +4158,7 @@ - (void)toggleTraditionalFullScreenMode {
}
PtyLog(@"toggleFullScreenMode - allocate new terminal");
}
- [self.window setHasShadow:(windowType_ == WINDOW_TYPE_NORMAL ||
- windowType_ == WINDOW_TYPE_COMPACT)];
+ [self.window setHasShadow:YES]; // PATCH: (Modified) always set window shadow
if (!_fullScreen &&
[iTermPreferences boolForKey:kPreferenceKeyDisableFullscreenTransparencyByDefault]) {
@@ -4277,7 +4277,7 @@ - (void)updateWindowShadow {
if ([iTermAdvancedSettingsModel disableWindowShadowWhenTransparencyOnMojave]) {
const BOOL haveTransparency = [self anySessionInCurrentTabHasTransparency];
DLog(@"%@: have transparency = %@ for sessions %@ in tab %@", self, @(haveTransparency), self.currentTab.sessions, self.currentTab);
- self.window.hasShadow = !haveTransparency;
+ self.window.hasShadow = YES; // PATCH: (Modified) always has window shadow
}
}
}
@@ -5611,9 +5611,10 @@ - (void)updateTabColors {
[_contentView.tabBarControl setTabColor:color forTabViewItem:tabViewItem];
if ([_contentView.tabView selectedTabViewItem] == tabViewItem) {
NSColor* newTabColor = [_contentView.tabBarControl tabColorForTabViewItem:tabViewItem];
- if ([_contentView.tabView numberOfTabViewItems] == 1 &&
- [iTermPreferences boolForKey:kPreferenceKeyHideTabBar] &&
- newTabColor) {
+ if (YES) { // PATCH: (Modified) always use the tab color
+ // PATCH: (Added) set window title background so it renders properly
+ //NSTextView *titleView = [self.contentView.window standardWindowButton:NSWindowCloseButton].superview.subviews[3];
+ //titleView.backgroundColor = [aSession.colorMap colorForKey:kColorMapBackground];
[self setBackgroundColor:newTabColor];
[_contentView setColor:newTabColor];
@@ -5656,7 +5657,11 @@ - (void)setMojaveBackgroundColor:(nullable NSColor *)backgroundColor NS_AVAILABL
self.window.appearance = [NSAppearance appearanceNamed:NSAppearanceNameDarkAqua];
break;
}
- self.window.backgroundColor = self.anyPaneIsTransparent ? [NSColor clearColor] : [NSColor windowBackgroundColor];
+ // PATCH: (Modified) set window background color so our transparent title bar doesn't show behind the window
+ backgroundColor = [self.currentSession.colorMap colorForKey:kColorMapBackground];
+ backgroundColor = [backgroundColor colorWithAlphaComponent:1 - [iTermProfilePreferences floatForKey:KEY_TRANSPARENCY inProfile:self.currentSession.profile]];
+
+ self.window.backgroundColor = backgroundColor;
self.window.titlebarAppearsTransparent = NO; // Keep it from showing content from other windows behind it. Issue 7108.
}
@@ -5695,6 +5700,10 @@ - (void)setLegacyBackgroundColor:(nullable NSColor *)backgroundColor {
}
darkAppearance = (backgroundColor != nil && backgroundColor.perceivedBrightness < 0.5);
}
+
+ // PATCH: (Added) set window background color to terminal background color
+ backgroundColor = [self.currentSession.colorMap colorForKey:kColorMapBackground];
+
[self.window setBackgroundColor:backgroundColor];
if (darkAppearance) {
self.window.appearance = [NSAppearance appearanceNamed:NSAppearanceNameVibrantDark];
diff --git a/sources/iTermAdvancedSettingsModel.h b/sources/iTermAdvancedSettingsModel.h
index f515a97..afca0be 100644
--- a/sources/iTermAdvancedSettingsModel.h
+++ b/sources/iTermAdvancedSettingsModel.h
@@ -189,6 +189,14 @@ extern NSString *const iTermAdvancedSettingsDidChange;
+ (int)slowPasteBytesPerCall;
+ (double)slowPasteDelayBetweenCalls;
+// PATCH: (Added) iTerm2-borderless Features
++ (double)timeBeforeBlinks;
++ (BOOL)setCursorForegroundColor;
++ (NSString *)windowTitleFormat;
++ (int)standardWindowButtonsHorizontalOffset;
++ (int)standardWindowButtonsVerticalOffset;
++ (NSString *)disabledNewOutputIndicatorCommands;
+
// The cursor's background goes to the "most different" color from its neighbors if the difference
// in brightness between the proposed background color and the neighbors' background color is less
// than this threshold.
diff --git a/sources/iTermAdvancedSettingsModel.m b/sources/iTermAdvancedSettingsModel.m
index a1bfd21..b14a593 100644
--- a/sources/iTermAdvancedSettingsModel.m
+++ b/sources/iTermAdvancedSettingsModel.m
@@ -271,6 +271,19 @@ + (void)enumerateDictionaries:(void (^)(NSDictionary *))block {
// `-----' : :
DEFINE_FLOAT(fractionOfCharacterSelectingNextNeighbor, 0.35, SECTION_MOUSE @"Fraction of character’s width on its right side that can be used to select the character to its right.");
+// PATCH: (Added) iTerm2-borderless Features
+
+#pragma mark iTerm2-borderless Features
+
+#define SECTION_BORDERLESS @"iTerm2-borderless Features: "
+
+DEFINE_FLOAT(timeBeforeBlinks, 0.5, SECTION_BORDERLESS @"Duration before cursor starts blinking after a keypress.");
+DEFINE_BOOL(setCursorForegroundColor, YES, SECTION_BORDERLESS @"Set cursor foreground color.");
+//DEFINE_STRING(windowTitleFormat, @"%@", SECTION_BORDERLESS @"Window title format\n“%@” represents the current session name, e.g. 'Terminal - %@'")
+DEFINE_INT(standardWindowButtonsHorizontalOffset, 17, SECTION_BORDERLESS @"Standard window buttons horizontal offset")
+DEFINE_INT(standardWindowButtonsVerticalOffset, 8, SECTION_BORDERLESS @"Standard window buttons vertical offset")
+DEFINE_STRING(disabledNewOutputIndicatorCommands, @"vi,vim,top,htop", SECTION_BORDERLESS @"Comma-seperated list of commands to not show new-output indicator");
+
#pragma mark Terminal
#define SECTION_TERMINAL @"Terminal: "
diff --git a/sources/iTermCursor.m b/sources/iTermCursor.m
index a38fd56..c944dd6 100644
--- a/sources/iTermCursor.m
+++ b/sources/iTermCursor.m
@@ -209,9 +209,10 @@ - (void)drawWithRect:(NSRect)rect
coord:coord];
} else {
// Non-smart
+ // PATCH: (Modified) Set cursor foreground color
[self.delegate cursorDrawCharacterAt:coord
doubleWidth:doubleWidth
- overrideColor:foregroundColor
+ overrideColor:[iTermAdvancedSettingsModel setCursorForegroundColor] == YES ? foregroundColor : nil
context:ctx
backgroundColor:backgroundColor];
}
diff --git a/sources/iTermRootTerminalView.m b/sources/iTermRootTerminalView.m
index b1d5a10..8d050c1 100644
--- a/sources/iTermRootTerminalView.m
+++ b/sources/iTermRootTerminalView.m
@@ -136,7 +136,7 @@ - (instancetype)initWithFrame:(NSRect)frameRect
[self setTabBarControlAutoresizingMask:(NSViewHeightSizable | NSViewMaxXMargin)];
break;
}
- if (@available(macOS 10.14, *)) {
+ if (NO) {
[self addSubview:_tabBarBacking];
[_tabBarBacking addSubview:_tabBarControl];
} else {
@@ -695,7 +695,8 @@ - (void)layoutSubviewsTopTabBarVisible:(BOOL)topTabBarVisible forWindow:(NSWindo
}
- (void)setTabBarFrame:(NSRect)frame {
- if (@available(macOS 10.14, *)) {
+ frame.origin.y -= 10;
+ if (NO) {
assert(!_tabBarControlOnLoan);
_tabBarBacking.frame = frame;
self.tabBarControl.frame = _tabBarBacking.bounds;
diff --git a/sources/iTermTabBarControlView.m b/sources/iTermTabBarControlView.m
index 4be80cf..b4014de 100644
--- a/sources/iTermTabBarControlView.m
+++ b/sources/iTermTabBarControlView.m
@@ -13,7 +13,7 @@
#import "NSObject+iTerm.h"
#import "NSView+iTerm.h"
-CGFloat iTermTabBarControlViewDefaultHeight = 24;
+CGFloat iTermTabBarControlViewDefaultHeight = 22; // PATCH: (Modified) hide tab bar
@interface NSView (Private)
- (NSRect)_opaqueRectForWindowMoveWhenInTitlebar;
@@ -49,8 +49,8 @@ - (instancetype)initWithFrame:(NSRect)frameRect {
- (void)drawRect:(NSRect)dirtyRect {
if (@available(macOS 10.14, *)) { } else {
- [[NSColor windowBackgroundColor] set];
- NSRectFill(dirtyRect);
+ [[NSColor clearColor] set];
+ //NSRectFill(dirtyRect);
}
[super drawRect:dirtyRect];
@@ -245,7 +245,8 @@ - (void)setFlashState:(iTermTabBarFlashState)flashState {
#pragma mark - Window Dragging
- (BOOL)mouseDownCanMoveWindow {
- return [self.itermTabBarDelegate iTermTabBarCanDragWindow] ? NO : [super mouseDownCanMoveWindow];
+ // PATCH: (Modified) make it easier to drag the window without the tab bar getting in the way
+ return YES;
}
- (NSRect)_opaqueRectForWindowMoveWhenInTitlebar {
diff --git a/sources/iTermTextDrawingHelper.m b/sources/iTermTextDrawingHelper.m
index 49bbd96..9977aac 100644
--- a/sources/iTermTextDrawingHelper.m
+++ b/sources/iTermTextDrawingHelper.m
@@ -2586,10 +2586,11 @@ - (NSColor *)backgroundColorForCursor {
}
- (BOOL)shouldShowCursor {
+ // PATCH: (Modified) Blink delay after moving the cursor
if (_cursorBlinking &&
self.isInKeyWindow &&
_textViewIsActiveSession &&
- [NSDate timeIntervalSinceReferenceDate] - _lastTimeCursorMoved > 0.5) {
+ [NSDate timeIntervalSinceReferenceDate] - _lastTimeCursorMoved > [iTermAdvancedSettingsModel timeBeforeBlinks]) {
// Allow the cursor to blink if it is configured, the window is key, this session is active
// in the tab, and the cursor has not moved for half a second.
return _blinkingItemsVisible;
diff --git a/sources/iTermWindowImpl.m b/sources/iTermWindowImpl.m
index 235077c..bc66a5c 100644
--- a/sources/iTermWindowImpl.m
+++ b/sources/iTermWindowImpl.m
@@ -60,6 +60,48 @@ - (void)iterm_dealloc {
}
+// PATCH: (Added) Modify standard title bar
+- (void)layoutIfNeeded {
+ NSButton *closeButton = [self.contentView.window standardWindowButton:NSWindowCloseButton];
+ NSButton *miniaturizeButton = [self.contentView.window standardWindowButton:NSWindowMiniaturizeButton];
+ NSButton *fullscreenButton = [self.contentView.window standardWindowButton:NSWindowZoomButton];
+
+ int horizOff = [iTermAdvancedSettingsModel standardWindowButtonsHorizontalOffset];
+ int vertOff = [iTermAdvancedSettingsModel standardWindowButtonsVerticalOffset] + 20;
+
+ [closeButton setFrameOrigin:NSMakePoint(0 + horizOff, 3)];
+ [miniaturizeButton setFrameOrigin:NSMakePoint(20 + horizOff, 3)];
+ [fullscreenButton setFrameOrigin:NSMakePoint(40 + horizOff, 3)];
+
+ NSView *lights = closeButton.superview.superview;
+ if (lights) {
+ NSRect newFrame = lights.frame;
+ newFrame.origin.y = self.contentView.frame.size.height - vertOff;
+ lights.frame = newFrame;
+ }
+
+
+ self.titlebarAppearsTransparent = true;
+
+
+ if (@available(macOS 10.14, *)) {
+ NSView *decorationView = closeButton.superview.superview.subviews[1];
+ decorationView.layer.opacity = 0.0;
+ }
+
+ /*
+ NSTextView *titleView = closeButton.superview.subviews[3];
+ titleView.font = [NSFont systemFontOfSize:13];
+ [titleView removeConstraints:titleView.constraints];
+ CGRect frame = titleView.frame;
+ frame.size.width = 200;
+ frame.origin.y = 3;
+ titleView.frame = frame;
+ titleView.drawsBackground = true;
+ */
+ [super layoutIfNeeded];
+}
+
- (BOOL)titleChangedRecently {
NSTimeInterval now = [NSDate timeIntervalSinceReferenceDate];
return (now > _timeOfLastWindowTitleChange && now - _timeOfLastWindowTitleChange < iTermWindowTitleChangeMinimumInterval);