@@ -486,7 +486,7 @@ - (void) openHost:(NSMenuItem *) sender {
486486 }else {
487487 // inTerminal is not null and overrides the default values of open_in
488488 terminalWindow = [objectsFromJSON objectAtIndex: 3 ];
489- if ( ![terminalWindow isEqualToString: @" new" ] && ![terminalWindow isEqualToString: @" current" ] && ![terminalWindow isEqualToString: @" tab" ])
489+ if ( ![terminalWindow isEqualToString: @" new" ] && ![terminalWindow isEqualToString: @" current" ] && ![terminalWindow isEqualToString: @" tab" ] && ![terminalWindow isEqualToString: @" virtual " ] )
490490 {
491491 errorMessage = [NSString stringWithFormat: @" %@%@%@ %@ " ,@" '" ,terminalWindow,@" '" , NSLocalizedString(@" is not a valid value for inTerminal. Please fix this in the JSON file" ,nil )];
492492 errorInfo = NSLocalizedString(@" bad \" inTerminal\" :\" VALUE\" in the JSON settings" ,nil );
@@ -509,6 +509,9 @@ - (void) openHost:(NSMenuItem *) sender {
509509 NSString *terminalCurrentWindow = [[NSBundle mainBundle ] pathForResource: @" terminal-current-window" ofType: @" scpt" ];
510510 NSString *terminalNewTabDefault = [[NSBundle mainBundle ] pathForResource: @" terminal-new-tab-default" ofType: @" scpt" ];
511511
512+ // Set Path to virtual with screen AppleScripts
513+ NSString *terminalVirtualWithScreen = [[NSBundle mainBundle ] pathForResource: @" virtual-with-screen" ofType: @" scpt" ];
514+
512515 // Set the name of the handler that we are passing parameters too in the apple script
513516 NSString *handlerName = @" scriptRun" ;
514517
@@ -555,6 +558,10 @@ - (void) openHost:(NSMenuItem *) sender {
555558 if ( [terminalWindow isEqualToString: @" tab" ] ) {
556559 [self runScript: iTermStableNewTabDefault handler: handlerName parameters: passParameters];
557560 }
561+ // don't spawn a terminal run the command in the background using screen
562+ if ( [terminalWindow isEqualToString: @" virtual" ] ) {
563+ [self runScript: terminalVirtualWithScreen handler: handlerName parameters: passParameters];
564+ }
558565 }
559566 // iTermVersion is not set to "stable" using applescripts Configured for Nightly
560567 if ( [iTermVersionPref isEqualToString: @" nightly" ]) {
@@ -570,6 +577,10 @@ - (void) openHost:(NSMenuItem *) sender {
570577 if ( [terminalWindow isEqualToString: @" tab" ] ) {
571578 [self runScript: iTerm2NightlyNewTabDefault handler: handlerName parameters: passParameters];
572579 }
580+ // don't spawn a terminal run the command in the background using screen
581+ if ( [terminalWindow isEqualToString: @" virtual" ] ) {
582+ [self runScript: terminalVirtualWithScreen handler: handlerName parameters: passParameters];
583+ }
573584 }
574585 }
575586 // If JSON settings are set to use Terminal.app
@@ -578,16 +589,18 @@ - (void) openHost:(NSMenuItem *) sender {
578589 if ( [terminalWindow isEqualToString: @" new" ] ) {
579590 [self runScript: terminalNewWindow handler: handlerName parameters: passParameters];
580591 }
581-
582592 // if we are running in the current terminal Window
583593 if ( [terminalWindow isEqualToString: @" current" ] ) {
584594 [self runScript: terminalCurrentWindow handler: handlerName parameters: passParameters];
585595 }
586-
587596 // we are using the default action of shuttle... The active window in a new tab
588597 if ( [terminalWindow isEqualToString: @" tab" ] ) {
589598 [self runScript: terminalNewTabDefault handler: handlerName parameters: passParameters];
590599 }
600+ // don't spawn a terminal run the command in the background using screen
601+ if ( [terminalWindow isEqualToString: @" virtual" ] ) {
602+ [self runScript: terminalVirtualWithScreen handler: handlerName parameters: passParameters];
603+ }
591604 }
592605}
593606
0 commit comments