@@ -49,8 +49,6 @@ export default class Runtime {
4949 // * "File Based"
5050 // input (Optional) - {String} that'll be provided to the `stdin` of the new process
5151 execute ( argType = 'Selection Based' , input = null , options = null ) {
52- if ( atom . config . get ( 'script.stopOnRerun' ) ) this . stop ( ) ;
53- this . emitter . emit ( 'start' ) ;
5452
5553 const codeContext = this . codeContextBuilder . buildCodeContext (
5654 atom . workspace . getActiveTextEditor ( ) , argType ) ;
@@ -62,6 +60,26 @@ export default class Runtime {
6260 const executionOptions = ! options ? this . scriptOptions : options ;
6361 const commandContext = CommandContext . build ( this , executionOptions , codeContext ) ;
6462
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+
6583 if ( ! commandContext ) return ;
6684
6785 if ( commandContext . workingDirectory ) {
0 commit comments