Skip to content
Snippets Groups Projects
Commit 07a0dace authored by George Nachman's avatar George Nachman
Browse files

Add option to use full-height cursor

parent ee4a6b90
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -178,5 +178,6 @@
+ (BOOL)useVirtualKeyCodesForDetectingDigits;
+ (BOOL)excludeBackgroundColorsFromCopiedStyle;
+ (BOOL)useGCDUpdateTimer;
+ (BOOL)fullHeightCursor;
 
@end
Loading
Loading
@@ -127,6 +127,7 @@ DEFINE_BOOL(requireCmdForDraggingText, NO, @"Terminal: To drag images or selecte
DEFINE_BOOL(focusReportingEnabled, YES, @"Terminal: Apps may turn on Focus Reporting.\nFocus reporting causes iTerm2 to send an escape sequence when a session gains or loses focus. It can cause problems when an ssh session dies unexpectedly because it gets left on, so some users prefer to disable it.");
DEFINE_BOOL(useColorfgbgFallback, YES, @"Terminal: Use fallback for COLORFGBG if no exact match found?\nThe COLORFGBG variable indicates the ANSI colors that match the foreground and background colors. If no colors match and this setting is enabled, then the variable will be set to 15;0 to indicate a dark background or 0;15 to indicate a light background.");
DEFINE_BOOL(zeroWidthSpaceAdvancesCursor, YES, @"Terminal: Zero-Width Space (U+200B) advances cursor?\nWhile a zero-width space should not advance the cursor per the Unicode spec, both Terminal.app and Konsole do this, and Weechat depends on it. You must restart iTerm2 after changing this setting.");
DEFINE_BOOL(fullHeightCursor, NO, @"Terminal: Cursor occupies line spacing area.\nIf lines have more than 100% vertical spacing and this setting is enabled the bottom of the cursor will be aligned to the bottom of the spacing area.");
 
#pragma mark Hotkey
DEFINE_FLOAT(hotkeyTermAnimationDuration, 0.25, @"Hotkey: Duration in seconds of the hotkey window animation.\nWarning: reducing this value may cause problems if you have multiple displays.");
Loading
Loading
Loading
Loading
@@ -2209,11 +2209,19 @@ static BOOL iTermTextDrawingHelperIsCharacterDrawable(screen_char_t *c,
 
- (NSRect)cursorFrame {
const int rowNumber = _cursorCoord.y + _numberOfLines - _gridSize.height;
const CGFloat height = MIN(_cellSize.height, _cellSizeWithoutSpacing.height);
return NSMakeRect(floor(_cursorCoord.x * _cellSize.width + [iTermAdvancedSettingsModel terminalMargin]),
rowNumber * _cellSize.height + MAX(0, round((_cellSize.height - _cellSizeWithoutSpacing.height) / 2.0)),
MIN(_cellSize.width, _cellSizeWithoutSpacing.width),
height);
if ([iTermAdvancedSettingsModel fullHeightCursor]) {
const CGFloat height = MAX(_cellSize.height, _cellSizeWithoutSpacing.height);
return NSMakeRect(floor(_cursorCoord.x * _cellSize.width + [iTermAdvancedSettingsModel terminalMargin]),
rowNumber * _cellSize.height,
MIN(_cellSize.width, _cellSizeWithoutSpacing.width),
height);
} else {
const CGFloat height = MIN(_cellSize.height, _cellSizeWithoutSpacing.height);
return NSMakeRect(floor(_cursorCoord.x * _cellSize.width + [iTermAdvancedSettingsModel terminalMargin]),
rowNumber * _cellSize.height + MAX(0, round((_cellSize.height - _cellSizeWithoutSpacing.height) / 2.0)),
MIN(_cellSize.width, _cellSizeWithoutSpacing.width),
height);
}
}
 
- (void)drawCursor {
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment