Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "Raw coprocess command" to semantic history. #303

Closed
wants to merge 2 commits into from

Conversation

grundprinzip
Copy link

screen shot 2016-09-26 at 1 13 06 pm

This patch adds the possibility to run a script / program as a deferred script. This is necessary to have any interaction back with iTerm.

One use case is for example a small script that will write text
back to iTerm to interact with the remote system while being
logged in via SSH.

This is related to: https://gitlab.com/gnachman/iterm2/issues/5197

This patch adds the possibility to run a script / program
as a deferred script. This is necessary to have any interaction
back with iTerm.

One use case is for example a small script that will write text
back to iTerm to interact with the remote system while being
logged in via SSH.
@grundprinzip
Copy link
Author

I'm absolutely unsure how to deal with the XIB file. I manually edited only the one line needed to add the menu item, but open saving the project the other modifications were added. What's the SOP here?

@gnachman
Copy link
Owner

gnachman commented Oct 1, 2016

Don't worry about the XIB file. They're horrible this way. It looks OK.

DLog(@"Launch coproress with script %@", script);
assert(delegate_);
[delegate_ semanticHistoryLaunchCoprocessWithCommand:script];
return YES;
}

if ([prefs_[kSemanticHistoryActionKey] isEqualToString:kSemanticHistoryCommandAction]) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving the test for fileExistsAtPath:isDirectory: below this changes the Command to run even when the file doesn't exist, which seems like an unnecessary change.

@@ -311,6 +314,13 @@ - (BOOL)openPath:(NSString *)path
return YES;
}

if ([prefs_[kSemanticHistoryActionKey] isEqualToString:kSemanticHistoryCoprocessAction]) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why should coprocess actions not run on directories?

@@ -192,7 +193,8 @@ + (NSDictionary *)tagToActionMap {
@3: kSemanticHistoryEditorAction,
@4: kSemanticHistoryCommandAction,
@5: kSemanticHistoryRawCommandAction,
@6: kSemanticHistoryCoprocessAction };
@7: kSemanticHistoryRawCoprocessAction,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please put the new item last so the numbers are in order.

@@ -262,6 +264,12 @@ - (IBAction)actionChanged:(id)sender
hideCaveat = NO;
hideText = NO;
break;
case 7:
[[text_ cell] setPlaceholderString:@"Enter command"];
[caveat_ setStringValue:@"Coprocess runs when you activate Semantic History on any filename (even if it's not a avlid filename). Use \\1 for filename, \\2 for line number, \\3 for text before click, \\4 for text after click, \\5 for pwd."];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling of "valid"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants