@@ -49,8 +49,6 @@ export default class Runtime {
49
49
// * "File Based"
50
50
// input (Optional) - {String} that'll be provided to the `stdin` of the new process
51
51
execute ( argType = 'Selection Based' , input = null , options = null ) {
52
- if ( atom . config . get ( 'script.stopOnRerun' ) ) this . stop ( ) ;
53
- this . emitter . emit ( 'start' ) ;
54
52
55
53
const codeContext = this . codeContextBuilder . buildCodeContext (
56
54
atom . workspace . getActiveTextEditor ( ) , argType ) ;
@@ -62,6 +60,26 @@ export default class Runtime {
62
60
const executionOptions = ! options ? this . scriptOptions : options ;
63
61
const commandContext = CommandContext . build ( this , executionOptions , codeContext ) ;
64
62
63
+
64
+ // Will cooperate with Terminus to allow for inputs, if user has installed.
65
+ try {
66
+ var terminus = require ( '../../terminus/lib/terminus.js' ) . provideTerminus ( ) ;
67
+ } catch ( e ) {
68
+ var terminus = null ;
69
+ console . log ( "Could not find Terminus" ) ;
70
+ }
71
+ if ( terminus != null ) {
72
+ var command = commandContext . command ;
73
+ for ( let i = 0 ; i < commandContext . args . length ; i ++ ) {
74
+ command += ' "' + commandContext . args [ i ] + '"' ;
75
+ }
76
+ terminus . run ( [ 'printf "\\33c\\e[3J" && ' + command ] ) ;
77
+ return ;
78
+ }
79
+
80
+ if ( atom . config . get ( 'script.stopOnRerun' ) ) this . stop ( ) ;
81
+ this . emitter . emit ( 'start' ) ;
82
+
65
83
if ( ! commandContext ) return ;
66
84
67
85
if ( commandContext . workingDirectory ) {
0 commit comments