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

Add an advanced pref to set the man page viewer command.

parent 76c6ef05
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -12,6 +12,8 @@
#import "DebugLogging.h"
#import "NSDictionary+iTerm.h"
#import "NSImage+iTerm.h"
#import "NSStringITerm.h"
#import "iTermAdvancedSettingsModel.h"
#import "iTermColorPresets.h"
#import "iTermKeyBindingMgr.h"
#import "iTermRootTerminalView.h"
Loading
Loading
@@ -171,7 +173,9 @@ ITERM_IGNORE_PARTIAL_BEGIN
button.title = word;
button.imagePosition = NSImageLeft;
button.enabled = YES;
button.keyBindingAction = @{ @"command": [NSString stringWithFormat:@"man %@", [word stringWithEscapedShellCharactersIncludingNewlines:YES]] };
NSString *manCommand = [NSString stringWithFormat:[iTermAdvancedSettingsModel viewManPageCommand],
[word stringWithEscapedShellCharactersIncludingNewlines:YES]];
button.keyBindingAction = @{ @"command": manCommand };
}
} else if (button.enabled) {
button.title = @"";
Loading
Loading
@@ -465,6 +469,8 @@ ITERM_IGNORE_PARTIAL_BEGIN
- (void)manPageTouchBarItemSelected:(iTermTouchBarButton *)sender {
NSString *command = sender.keyBindingAction[@"command"];
if (command) {
NSString *escapedCommand = [command stringWithEscapedShellCharactersIncludingNewlines:YES];
command = [NSString stringWithFormat:@"sh -c \"%@\"", escapedCommand];
[[iTermController sharedInstance] launchBookmark:nil
inTerminal:nil
withURL:nil
Loading
Loading
Loading
Loading
@@ -188,5 +188,6 @@
+ (BOOL)detectPasswordInput;
+ (BOOL)disablePasswordManagerAnimations;
+ (BOOL)focusNewSplitPaneWithFocusFollowsMouse;
+ (NSString *)viewManPageCommand;
 
@end
Loading
Loading
@@ -157,6 +157,7 @@ DEFINE_INT(terminalMargin, 5, @"General: Width of left and right margins in term
DEFINE_INT(terminalVMargin, 2, @"General: Height of top and bottom margins in terminal panes\nHow much space to leave between the top and bottom edges of the terminal.\nYou must restart iTerm2 after modifying this property. Saved window arrangements should be re-created.");
DEFINE_BOOL(zippyTextDrawing, YES, @"General: Use zippy text drawing algorithm?\nThis draws non-ASCII text more quickly but with lower fidelity. This setting is ignored if ligatures are enabled in Prefs > Profiles > Text.");
DEFINE_BOOL(useVirtualKeyCodesForDetectingDigits, YES, @"General: On keyboards that require a modifier to press a digit, do not require that modifier for switching between windows, tabs, and panes by number.\nFor example, AZERTY requires you to hold down Shift to enter a number. To switch tabs with Cmd+Number on an AZERTY keyboard, you must enable this setting. Then, for example, Cmd-& switches to tab 1. When this setting is enabled, some user-defined shortcuts may become unavailable because the tab/window/pane switching behavior takes precedence.");
DEFINE_STRING(viewManPageCommand, @"man %@", @"General: Command to view man pages.\nUsed when you press the man page button on the touch bar. %@ is replaced with the command.");
 
#pragma mark - Semantic History
DEFINE_BOOL(ignoreHardNewlinesInURLs, NO, @"Semantic History: Ignore hard newlines for the purposes of locating URLs and file names for Semantic History.\nIf a hard newline occurs at the end of a line then cmd-click will not see it all unless this setting is turned on. This is useful for some interactive applications. Turning this on will remove newlines from the \\3 and \\4 substitutions.");
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