-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Conversation
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.
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? |
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]) { |
There was a problem hiding this comment.
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]) { |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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."]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spelling of "valid"
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