Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • karan_m/iterm2
  • zhaochangqing/iterm2
  • joykeeper/iterm2
  • nleroux/iterm2
  • kenji21/iterm2
  • gagasegsegsegeg/iterm2
  • stanhu/iterm2
  • ivyfan/iterm2
  • DAddYE/iterm2
  • trave801/iterm2
  • lordrings/iterm2
  • tweekmonster/iterm2
  • imardaras/iterm2
  • DabeDotCom/iterm2
  • sherifamin83/iterm2
  • aquarecif/iterm2
  • visualrobots/iterm2
  • xmarianox/iterm2
  • doomsayer13/iterm2
  • vikdutt/iterm2
  • me36/iterm2
  • DevGrohl/iterm2
  • manigandan-rajasekar/iterm2
  • DWoodiwiss/iterm2
  • vti/iterm2
  • DamonQin/iterm2
26 results
Show changes
Commits on Source (3)
Loading
@@ -1794,7 +1794,7 @@ ITERM_WEAKLY_REFERENCEABLE
Loading
@@ -1794,7 +1794,7 @@ ITERM_WEAKLY_REFERENCEABLE
[self replaceTerminatedShellWithNewInstance]; [self replaceTerminatedShellWithNewInstance];
} else { } else {
_shouldRestart = YES; _shouldRestart = YES;
[_shell sendSignal:SIGKILL]; [_shell sendSignal:SIGKILL toServer:NO];
} }
} }
   
Loading
Loading
Loading
@@ -70,7 +70,7 @@ extern NSString *kCoprocessStatusChangeNotification;
Loading
@@ -70,7 +70,7 @@ extern NSString *kCoprocessStatusChangeNotification;
   
- (void)writeTask:(NSData*)data; - (void)writeTask:(NSData*)data;
   
- (void)sendSignal:(int)signo; - (void)sendSignal:(int)signo toServer:(BOOL)toServer;
   
// Cause the slave to receive a SIGWINCH and change the tty's window size. If `size` equals the // Cause the slave to receive a SIGWINCH and change the tty's window size. If `size` equals the
// tty's current window size then no action is taken. // tty's current window size then no action is taken.
Loading
Loading
Loading
@@ -828,8 +828,11 @@ static int MyForkPty(int *amaster,
Loading
@@ -828,8 +828,11 @@ static int MyForkPty(int *amaster,
[self.delegate threadedTaskBrokenPipe]; [self.delegate threadedTaskBrokenPipe];
} }
   
- (void)sendSignal:(int)signo { - (void)sendSignal:(int)signo toServer:(BOOL)toServer {
if (_serverChildPid != -1) { if (toServer && _serverPid != -1) {
DLog(@"Sending signal to server %@", @(_serverPid));
kill(_serverPid, signo);
} else if (_serverChildPid != -1) {
kill(_serverChildPid, signo); kill(_serverChildPid, signo);
} else if (_childPid >= 0) { } else if (_childPid >= 0) {
kill(_childPid, signo); kill(_childPid, signo);
Loading
@@ -931,7 +934,7 @@ static int MyForkPty(int *amaster,
Loading
@@ -931,7 +934,7 @@ static int MyForkPty(int *amaster,
- (void)stop { - (void)stop {
self.paused = NO; self.paused = NO;
[self stopLogging]; [self stopLogging];
[self sendSignal:SIGHUP]; [self sendSignal:SIGHUP toServer:NO];
[self killServerIfRunning]; [self killServerIfRunning];
   
if (fd >= 0) { if (fd >= 0) {
Loading
Loading
Loading
@@ -4427,10 +4427,12 @@ ITERM_WEAKLY_REFERENCEABLE
Loading
@@ -4427,10 +4427,12 @@ ITERM_WEAKLY_REFERENCEABLE
[session setIgnoreResizeNotifications:NO]; [session setIgnoreResizeNotifications:NO];
} }
   
const BOOL willShowTabBar = ([iTermPreferences boolForKey:kPreferenceKeyHideTabBar] &&
[_contentView.tabView numberOfTabViewItems] > 1 &&
[_contentView.tabBarControl isHidden]);
// check window size in case tabs have to be hidden or shown // check window size in case tabs have to be hidden or shown
if (([_contentView.tabView numberOfTabViewItems] == 1) || // just decreased to 1 or increased above 1 and is hidden if (([_contentView.tabView numberOfTabViewItems] == 1) || // just decreased to 1 or increased above 1 and is hidden
([iTermPreferences boolForKey:kPreferenceKeyHideTabBar] && willShowTabBar) {
([_contentView.tabView numberOfTabViewItems] > 1 && [_contentView.tabBarControl isHidden]))) {
// Need to change the visibility status of the tab bar control. // Need to change the visibility status of the tab bar control.
PtyLog(@"tabViewDidChangeNumberOfTabViewItems - calling fitWindowToTab"); PtyLog(@"tabViewDidChangeNumberOfTabViewItems - calling fitWindowToTab");
   
Loading
@@ -4449,6 +4451,9 @@ ITERM_WEAKLY_REFERENCEABLE
Loading
@@ -4449,6 +4451,9 @@ ITERM_WEAKLY_REFERENCEABLE
PTYSession *session = firstTab.sessions.firstObject; PTYSession *session = firstTab.sessions.firstObject;
[[session view] setShowTitle:NO adjustScrollView:YES]; [[session view] setShowTitle:NO adjustScrollView:YES];
} }
if (willShowTabBar && [iTermPreferences intForKey:kPreferenceKeyTabPosition] == PSMTab_LeftTab) {
[_contentView willShowTabBar];
}
[self fitWindowToTabs]; [self fitWindowToTabs];
[self repositionWidgets]; [self repositionWidgets];
if (wasDraggedFromAnotherWindow_) { if (wasDraggedFromAnotherWindow_) {
Loading
Loading
Loading
@@ -685,30 +685,40 @@ static const int kMaxScreenRows = 4096;
Loading
@@ -685,30 +685,40 @@ static const int kMaxScreenRows = 4096;
graphicRendition_.bgColorMode = ColorModeAlternate; graphicRendition_.bgColorMode = ColorModeAlternate;
break; break;
case VT100CHARATTR_FG_256: case VT100CHARATTR_FG_256:
// First subparam means: # additional subparams: Accepts optional params: // The actual spec for this is called ITU T.416-199303
// 1: transparent 0 NO // You can download it for free! If you prefer to spend money, ISO/IEC 8613-6
// 2: RGB 3 YES // is supposedly the same thing.
// 3: CMY 3 YES
// 4: CMYK 4 YES
// 5: Indexed color 1 NO
// //
// Optional paramters go at position 7 and 8, and indicate toleranace as an // Here's a sad story about CSI 38:2, which is used to do 24-bit color.
// integer; and color space (0=CIELUV, 1=CIELAB). Example:
// //
// CSI 38:2:255:128:64:0:5:1 m // Lots of terminal emulators, iTerm2 included, misunderstood the spec. That's
// easy to understand if you read it, which I can't recommend doing unless
// you're looking for inspiration for your next Bulwer-Lytton Fiction Contest
// entry.
// //
// Also accepted for xterm compatibility, but never with optional parameters: // See issue 6377 for more context.
// CSI 38;2;255;128;64 m
// //
// Set the foreground color to red=255, green=128, blue=64 with a tolerance of // Ignoring color types we don't support like CMYK, the spec says to do this:
// 5 in the CIELAB color space. The 0 at the 6th position has no meaning and // CSI 38:2:[color space]:[red]:[green]:[blue]:[unused]:[tolerance]:[tolerance colorspace]
// is just a filler. //
// // Everything after [blue] is optional. Values are decimal numbers in 0...255.
// For 256-color mode (indexed) use this for the foreground: //
// CSI 38;5;N m // Unfortunately, what was implemented for a long time was this:
// where N is a value between 0 and 255. See the colors described in screen_char_t // CSI 38:2:[red]:[green]:[blue]:[unused]:[tolerance]:[tolerance colorspace]
// in the comments for fgColorCode. //
// And for xterm compatibility, the following was also accepted:
// CSI 38;2;[red];[green];[blue]
//
// The New Order
// -------------
// Tolerance never did anything, so we'll accept this non-standards compliant
// code, which people use:
// CSI 38:2:[red]:[green]:[blue]
//
// As well as the following forms:
// CSI 38:2:[colorspace]:[red]:[green]:[blue]
// CSI 38:2:[colorspace]:[red]:[green]:[blue]:<one or more additional colon-delimited arguments, all ignored>
// CSI 38;2;[red];[green];[blue] // Notice semicolons in place of colons here
if (token.csi->subCount[i] > 0) { if (token.csi->subCount[i] > 0) {
// Preferred syntax using colons to delimit subparameters // Preferred syntax using colons to delimit subparameters
if (token.csi->subCount[i] >= 2 && token.csi->sub[i][0] == 5) { if (token.csi->subCount[i] >= 2 && token.csi->sub[i][0] == 5) {
Loading
@@ -718,15 +728,30 @@ static const int kMaxScreenRows = 4096;
Loading
@@ -718,15 +728,30 @@ static const int kMaxScreenRows = 4096;
graphicRendition_.fgBlue = 0; graphicRendition_.fgBlue = 0;
graphicRendition_.fgColorMode = ColorModeNormal; graphicRendition_.fgColorMode = ColorModeNormal;
} else if (token.csi->subCount[i] >= 4 && token.csi->sub[i][0] == 2) { } else if (token.csi->subCount[i] >= 4 && token.csi->sub[i][0] == 2) {
// CSI 38:2:R:G:B m
// 24-bit color // 24-bit color
graphicRendition_.fgColorCode = token.csi->sub[i][1]; if (token.csi->subCount[i] >= 5) {
graphicRendition_.fgGreen = token.csi->sub[i][2]; // Spec-compliant. Likely rarely used in 2017.
graphicRendition_.fgBlue = token.csi->sub[i][3]; // CSI 38:2:colorspace:R:G:B m
graphicRendition_.fgColorMode = ColorMode24bit; // TODO: Respect the color space argument. See ITU-T Rec. T.414,
// but good luck actually finding the colour space IDs.
graphicRendition_.fgColorCode = token.csi->sub[i][2];
graphicRendition_.fgGreen = token.csi->sub[i][3];
graphicRendition_.fgBlue = token.csi->sub[i][4];
graphicRendition_.fgColorMode = ColorMode24bit;
} else {
// Misinterpration compliant.
// CSI 38:2:R:G:B m <- misinterpration compliant
graphicRendition_.fgColorCode = token.csi->sub[i][1];
graphicRendition_.fgGreen = token.csi->sub[i][2];
graphicRendition_.fgBlue = token.csi->sub[i][3];
graphicRendition_.fgColorMode = ColorMode24bit;
}
} }
} else if (token.csi->count - i >= 3 && token.csi->p[i + 1] == 5) { } else if (token.csi->count - i >= 3 && token.csi->p[i + 1] == 5) {
// CSI 38;5;P m // For 256-color mode (indexed) use this for the foreground:
// CSI 38;5;N m
// where N is a value between 0 and 255. See the colors described in screen_char_t
// in the comments for fgColorCode.
graphicRendition_.fgColorCode = token.csi->p[i + 2]; graphicRendition_.fgColorCode = token.csi->p[i + 2];
graphicRendition_.fgGreen = 0; graphicRendition_.fgGreen = 0;
graphicRendition_.fgBlue = 0; graphicRendition_.fgBlue = 0;
Loading
@@ -734,6 +759,7 @@ static const int kMaxScreenRows = 4096;
Loading
@@ -734,6 +759,7 @@ static const int kMaxScreenRows = 4096;
i += 2; i += 2;
} else if (token.csi->count - i >= 5 && token.csi->p[i + 1] == 2) { } else if (token.csi->count - i >= 5 && token.csi->p[i + 1] == 2) {
// CSI 38;2;R;G;B m // CSI 38;2;R;G;B m
// Hack for xterm compatibility
// 24-bit color support // 24-bit color support
graphicRendition_.fgColorCode = token.csi->p[i + 2]; graphicRendition_.fgColorCode = token.csi->p[i + 2];
graphicRendition_.fgGreen = token.csi->p[i + 3]; graphicRendition_.fgGreen = token.csi->p[i + 3];
Loading
Loading
Loading
@@ -1370,7 +1370,10 @@ static iTermController *gSharedInstance;
Loading
@@ -1370,7 +1370,10 @@ static iTermController *gSharedInstance;
assert([iTermAdvancedSettingsModel runJobsInServers]); assert([iTermAdvancedSettingsModel runJobsInServers]);
for (iTermRestorableSession *restorableSession in _restorableSessions) { for (iTermRestorableSession *restorableSession in _restorableSessions) {
for (PTYSession *aSession in restorableSession.sessions) { for (PTYSession *aSession in restorableSession.sessions) {
[aSession.shell sendSignal:SIGHUP]; if (aSession.shell.serverPid != -1) {
[aSession.shell sendSignal:SIGKILL toServer:YES];
}
[aSession.shell sendSignal:SIGHUP toServer:YES];
} }
} }
} }
Loading
Loading
Loading
@@ -69,6 +69,7 @@ extern const CGFloat kHorizontalTabBarHeight;
Loading
@@ -69,6 +69,7 @@ extern const CGFloat kHorizontalTabBarHeight;
@property(nonatomic, readonly) CGFloat tabviewWidth; @property(nonatomic, readonly) CGFloat tabviewWidth;
   
@property(nonatomic, readonly) CGFloat leftTabBarWidth; @property(nonatomic, readonly) CGFloat leftTabBarWidth;
@property(nonatomic, readonly) CGFloat leftTabBarPreferredWidth;
   
- (instancetype)initWithFrame:(NSRect)frame - (instancetype)initWithFrame:(NSRect)frame
color:(NSColor *)color color:(NSColor *)color
Loading
@@ -93,4 +94,6 @@ extern const CGFloat kHorizontalTabBarHeight;
Loading
@@ -93,4 +94,6 @@ extern const CGFloat kHorizontalTabBarHeight;
   
- (BOOL)tabBarShouldBeVisibleWithAdditionalTabs:(int)numberOfAdditionalTabs; - (BOOL)tabBarShouldBeVisibleWithAdditionalTabs:(int)numberOfAdditionalTabs;
   
- (void)willShowTabBar;
@end @end
Loading
@@ -30,7 +30,6 @@ static const CGFloat kMaximumToolbeltSizeAsFractionOfWindow = 0.5;
Loading
@@ -30,7 +30,6 @@ static const CGFloat kMaximumToolbeltSizeAsFractionOfWindow = 0.5;
@property(nonatomic, retain) SolidColorView *divisionView; @property(nonatomic, retain) SolidColorView *divisionView;
@property(nonatomic, retain) iTermToolbeltView *toolbelt; @property(nonatomic, retain) iTermToolbeltView *toolbelt;
@property(nonatomic, retain) iTermDragHandleView *leftTabBarDragHandle; @property(nonatomic, retain) iTermDragHandleView *leftTabBarDragHandle;
@property(nonatomic, readonly) CGFloat leftTabBarPreferredWidth;
   
@end @end
   
Loading
@@ -293,6 +292,10 @@ static const CGFloat kMaximumToolbeltSizeAsFractionOfWindow = 0.5;
Loading
@@ -293,6 +292,10 @@ static const CGFloat kMaximumToolbeltSizeAsFractionOfWindow = 0.5;
DLog(@"repositionWidgets - Set tab view frame to %@", NSStringFromRect(tabViewFrame)); DLog(@"repositionWidgets - Set tab view frame to %@", NSStringFromRect(tabViewFrame));
[self.tabView setFrame:tabViewFrame]; [self.tabView setFrame:tabViewFrame];
[self updateDivisionView]; [self updateDivisionView];
// Even though it's not visible it needs an accurate number so we can compute the proper
// window size when it appears.
[self setLeftTabBarWidthFromPreferredWidth];
} else { } else {
// The tabBar control is visible. // The tabBar control is visible.
DLog(@"repositionWidgets - tabs are visible. Adjusting window size..."); DLog(@"repositionWidgets - tabs are visible. Adjusting window size...");
Loading
@@ -451,16 +454,33 @@ static const CGFloat kMaximumToolbeltSizeAsFractionOfWindow = 0.5;
Loading
@@ -451,16 +454,33 @@ static const CGFloat kMaximumToolbeltSizeAsFractionOfWindow = 0.5;
DLog(@"repositionWidgets - return."); DLog(@"repositionWidgets - return.");
} }
   
- (CGFloat)leftTabBarWidthForPreferredWidth:(CGFloat)preferredWidth { - (CGFloat)leftTabBarWidthForPreferredWidth:(CGFloat)preferredWidth contentWidth:(CGFloat)contentWidth {
const CGFloat minimumWidth = 50; const CGFloat minimumWidth = 50;
const CGFloat maximumWidth = self.bounds.size.width / 3; const CGFloat maximumWidth = contentWidth / 3;
return MAX(MIN(maximumWidth, preferredWidth), minimumWidth); return MAX(MIN(maximumWidth, preferredWidth), minimumWidth);
}
- (CGFloat)leftTabBarWidthForPreferredWidth:(CGFloat)preferredWidth {
return [self leftTabBarWidthForPreferredWidth:preferredWidth contentWidth:self.bounds.size.width];
} }
   
- (void)setLeftTabBarWidthFromPreferredWidth { - (void)setLeftTabBarWidthFromPreferredWidth {
_leftTabBarWidth = [self leftTabBarWidthForPreferredWidth:_leftTabBarPreferredWidth]; _leftTabBarWidth = [self leftTabBarWidthForPreferredWidth:_leftTabBarPreferredWidth];
} }
   
- (void)willShowTabBar {
const CGFloat minimumWidth = 50;
// Given that the New window width (N) = Tab bar width (T) + Content Size (C)
// Given that T < N/3 (by leftTabBarWidthForPreferredWidth):
// T <= N / 3
// T <= 1/3(T+C)
// T <= T/3 + C/3
// 2/3T <= C/3
// T <= C/2
const CGFloat maximumWidth = self.bounds.size.width / 2;
_leftTabBarWidth = MAX(MIN(maximumWidth, _leftTabBarPreferredWidth), minimumWidth);
}
#pragma mark - iTermTabBarControlViewDelegate #pragma mark - iTermTabBarControlViewDelegate
   
- (BOOL)iTermTabBarShouldFlashAutomatically { - (BOOL)iTermTabBarShouldFlashAutomatically {
Loading
Loading