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
Loading
@@ -1794,7 +1794,7 @@ ITERM_WEAKLY_REFERENCEABLE
[self replaceTerminatedShellWithNewInstance];
} else {
_shouldRestart = YES;
[_shell sendSignal:SIGKILL];
[_shell sendSignal:SIGKILL toServer:NO];
}
}
 
Loading
Loading
Loading
Loading
@@ -70,7 +70,7 @@ extern NSString *kCoprocessStatusChangeNotification;
 
- (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
// tty's current window size then no action is taken.
Loading
Loading
Loading
Loading
@@ -828,8 +828,11 @@ static int MyForkPty(int *amaster,
[self.delegate threadedTaskBrokenPipe];
}
 
- (void)sendSignal:(int)signo {
if (_serverChildPid != -1) {
- (void)sendSignal:(int)signo toServer:(BOOL)toServer {
if (toServer && _serverPid != -1) {
DLog(@"Sending signal to server %@", @(_serverPid));
kill(_serverPid, signo);
} else if (_serverChildPid != -1) {
kill(_serverChildPid, signo);
} else if (_childPid >= 0) {
kill(_childPid, signo);
Loading
Loading
@@ -931,7 +934,7 @@ static int MyForkPty(int *amaster,
- (void)stop {
self.paused = NO;
[self stopLogging];
[self sendSignal:SIGHUP];
[self sendSignal:SIGHUP toServer:NO];
[self killServerIfRunning];
 
if (fd >= 0) {
Loading
Loading
Loading
Loading
@@ -4427,10 +4427,12 @@ ITERM_WEAKLY_REFERENCEABLE
[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
if (([_contentView.tabView numberOfTabViewItems] == 1) || // just decreased to 1 or increased above 1 and is hidden
([iTermPreferences boolForKey:kPreferenceKeyHideTabBar] &&
([_contentView.tabView numberOfTabViewItems] > 1 && [_contentView.tabBarControl isHidden]))) {
willShowTabBar) {
// Need to change the visibility status of the tab bar control.
PtyLog(@"tabViewDidChangeNumberOfTabViewItems - calling fitWindowToTab");
 
Loading
Loading
@@ -4449,6 +4451,9 @@ ITERM_WEAKLY_REFERENCEABLE
PTYSession *session = firstTab.sessions.firstObject;
[[session view] setShowTitle:NO adjustScrollView:YES];
}
if (willShowTabBar && [iTermPreferences intForKey:kPreferenceKeyTabPosition] == PSMTab_LeftTab) {
[_contentView willShowTabBar];
}
[self fitWindowToTabs];
[self repositionWidgets];
if (wasDraggedFromAnotherWindow_) {
Loading
Loading
Loading
Loading
@@ -685,30 +685,40 @@ static const int kMaxScreenRows = 4096;
graphicRendition_.bgColorMode = ColorModeAlternate;
break;
case VT100CHARATTR_FG_256:
// First subparam means: # additional subparams: Accepts optional params:
// 1: transparent 0 NO
// 2: RGB 3 YES
// 3: CMY 3 YES
// 4: CMYK 4 YES
// 5: Indexed color 1 NO
// The actual spec for this is called ITU T.416-199303
// You can download it for free! If you prefer to spend money, ISO/IEC 8613-6
// is supposedly the same thing.
//
// Optional paramters go at position 7 and 8, and indicate toleranace as an
// integer; and color space (0=CIELUV, 1=CIELAB). Example:
// Here's a sad story about CSI 38:2, which is used to do 24-bit color.
//
// 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:
// CSI 38;2;255;128;64 m
// See issue 6377 for more context.
//
// Set the foreground color to red=255, green=128, blue=64 with a tolerance of
// 5 in the CIELAB color space. The 0 at the 6th position has no meaning and
// is just a filler.
//
// 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.
// Ignoring color types we don't support like CMYK, the spec says to do this:
// CSI 38:2:[color space]:[red]:[green]:[blue]:[unused]:[tolerance]:[tolerance colorspace]
//
// Everything after [blue] is optional. Values are decimal numbers in 0...255.
//
// Unfortunately, what was implemented for a long time was this:
// CSI 38:2:[red]:[green]:[blue]:[unused]:[tolerance]:[tolerance colorspace]
//
// 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) {
// Preferred syntax using colons to delimit subparameters
if (token.csi->subCount[i] >= 2 && token.csi->sub[i][0] == 5) {
Loading
Loading
@@ -718,15 +728,30 @@ static const int kMaxScreenRows = 4096;
graphicRendition_.fgBlue = 0;
graphicRendition_.fgColorMode = ColorModeNormal;
} else if (token.csi->subCount[i] >= 4 && token.csi->sub[i][0] == 2) {
// CSI 38:2:R:G:B m
// 24-bit color
graphicRendition_.fgColorCode = token.csi->sub[i][1];
graphicRendition_.fgGreen = token.csi->sub[i][2];
graphicRendition_.fgBlue = token.csi->sub[i][3];
graphicRendition_.fgColorMode = ColorMode24bit;
if (token.csi->subCount[i] >= 5) {
// Spec-compliant. Likely rarely used in 2017.
// CSI 38:2:colorspace:R:G:B m
// 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) {
// 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_.fgGreen = 0;
graphicRendition_.fgBlue = 0;
Loading
Loading
@@ -734,6 +759,7 @@ static const int kMaxScreenRows = 4096;
i += 2;
} else if (token.csi->count - i >= 5 && token.csi->p[i + 1] == 2) {
// CSI 38;2;R;G;B m
// Hack for xterm compatibility
// 24-bit color support
graphicRendition_.fgColorCode = token.csi->p[i + 2];
graphicRendition_.fgGreen = token.csi->p[i + 3];
Loading
Loading
Loading
Loading
@@ -1370,7 +1370,10 @@ static iTermController *gSharedInstance;
assert([iTermAdvancedSettingsModel runJobsInServers]);
for (iTermRestorableSession *restorableSession in _restorableSessions) {
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
Loading
@@ -69,6 +69,7 @@ extern const CGFloat kHorizontalTabBarHeight;
@property(nonatomic, readonly) CGFloat tabviewWidth;
 
@property(nonatomic, readonly) CGFloat leftTabBarWidth;
@property(nonatomic, readonly) CGFloat leftTabBarPreferredWidth;
 
- (instancetype)initWithFrame:(NSRect)frame
color:(NSColor *)color
Loading
Loading
@@ -93,4 +94,6 @@ extern const CGFloat kHorizontalTabBarHeight;
 
- (BOOL)tabBarShouldBeVisibleWithAdditionalTabs:(int)numberOfAdditionalTabs;
 
- (void)willShowTabBar;
@end
Loading
Loading
@@ -30,7 +30,6 @@ static const CGFloat kMaximumToolbeltSizeAsFractionOfWindow = 0.5;
@property(nonatomic, retain) SolidColorView *divisionView;
@property(nonatomic, retain) iTermToolbeltView *toolbelt;
@property(nonatomic, retain) iTermDragHandleView *leftTabBarDragHandle;
@property(nonatomic, readonly) CGFloat leftTabBarPreferredWidth;
 
@end
 
Loading
Loading
@@ -293,6 +292,10 @@ static const CGFloat kMaximumToolbeltSizeAsFractionOfWindow = 0.5;
DLog(@"repositionWidgets - Set tab view frame to %@", NSStringFromRect(tabViewFrame));
[self.tabView setFrame:tabViewFrame];
[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 {
// The tabBar control is visible.
DLog(@"repositionWidgets - tabs are visible. Adjusting window size...");
Loading
Loading
@@ -451,16 +454,33 @@ static const CGFloat kMaximumToolbeltSizeAsFractionOfWindow = 0.5;
DLog(@"repositionWidgets - return.");
}
 
- (CGFloat)leftTabBarWidthForPreferredWidth:(CGFloat)preferredWidth {
- (CGFloat)leftTabBarWidthForPreferredWidth:(CGFloat)preferredWidth contentWidth:(CGFloat)contentWidth {
const CGFloat minimumWidth = 50;
const CGFloat maximumWidth = self.bounds.size.width / 3;
return MAX(MIN(maximumWidth, preferredWidth), minimumWidth);
const CGFloat maximumWidth = contentWidth / 3;
return MAX(MIN(maximumWidth, preferredWidth), minimumWidth);
}
- (CGFloat)leftTabBarWidthForPreferredWidth:(CGFloat)preferredWidth {
return [self leftTabBarWidthForPreferredWidth:preferredWidth contentWidth:self.bounds.size.width];
}
 
- (void)setLeftTabBarWidthFromPreferredWidth {
_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
 
- (BOOL)iTermTabBarShouldFlashAutomatically {
Loading
Loading