@@ -229,7 +229,7 @@ def __init__(self, **kwargs):
2292290 ]+ "\\ dyalog.exe"
230230CloseKey (dyalogKey )
231231CloseKey (lastKey )
232- self .dyalog_subprocess = subprocess .Popen ([dyalogPath ,"RIDE_SPAWNED=1" ,"DYALOGQUIETUCMDBUILD=1" ,'RIDE_INIT=SERVE::' + str (
232+ self .dyalog_subprocess = subprocess .Popen ([dyalogPath ,"RIDE_SPAWNED=1" ,"DYALOGQUIETUCMDBUILD=1" ,"Dyalog_LineEditor_Mode=1" , 'RIDE_INIT=SERVE::' + str (
233233self ._port ).strip (),'LOG_FILE=nul' ,os .path .dirname (os .path .abspath (__file__ ))+ '/init.dws' ])
234234else :
235235# linux, darwin... etc
@@ -239,6 +239,7 @@ def __init__(self, **kwargs):
239239dyalog_env ['DYALOGQUIETUCMDBUILD' ]= '1'
240240dyalog_env ['ENABLE_CEF' ]= '0'
241241dyalog_env ['LOG_FILE' ]= '/dev/null'
242+ dyalog_env ['DYALOG_LINEEDITOR_MODE' ]= '1'
242243if sys .platform .lower ()== "darwin" :
243244for d in sorted (os .listdir ('/Applications' )):
244245if re .match ('^Dyalog-\d+\.\d+\.app$' ,d ):
@@ -336,7 +337,6 @@ def do_execute(self, code, silent, store_history=True, user_expressions=None,
336337if self .connected :
337338lines = code .split ('\n ' )
338339match = re .search ('^%suspend\s+(\w+)$' ,lines [0 ].lower (),re .IGNORECASE )
339- nsmatch = re .match ('^\\ s*:namespace|:class|:interface' ,lines [0 ].lower ())
340340if match :
341341suspend = match .group (1 )
342342if suspend == 'on' :
@@ -354,26 +354,11 @@ def do_execute(self, code, silent, store_history=True, user_expressions=None,
354354self .out_error (
355355'JUPYTER NOTEBOOK: UNDEFINED ARGUMENT TO %suspend, USE EITHER on OR off' )
356356lines = lines [1 :]
357- elif re .match ('^\\ s*∇' ,lines [0 ]):
358- if not re .match ('\\ s*∇$' ,lines [- 1 ]):
359- self .out_error ('DEFN ERROR: Missing closing ∇' )
360- else :
361- lines [0 ]= re .sub ('^\\ s*∇' ,'' ,lines [0 ])
362- lines = lines [:- 1 ]
363- self .define_function (lines )
364- lines = []
365357elif lines [0 ].lower ()== ']dinput' :
366- self .define_function (lines [1 :])
367- lines = []
368- elif nsmatch :
369- if not re .match (":end" + re .sub ("^\\ s*:" ,'' ,nsmatch .group (0 )),lines [- 1 ].lower ()):
370- self .out_error ("DEFN ERROR: No " + ":End" + re .sub ("^\\ s*:" ,'' ,nsmatch .group (0 )))
371- lines = []
372- else :
373- self .define_function (lines )
374- lines = []
358+ lines = lines [1 :]
375359try :
376360# the windows interpreter can only handle ~125 chacaters at a time, so we do one line at a time
361+ pt = None
377362for line in lines :
378363line = line + '\n '
379364self .execute_line (line )
@@ -393,7 +378,7 @@ def do_execute(self, code, silent, store_history=True, user_expressions=None,
393378received = dq .pop ()
394379
395380if received [0 ]== 'AppendSessionOutput' :
396- if not PROMPT_AVAILABLE :
381+ if ( not PROMPT_AVAILABLE ) and ( received [ 1 ]. get ( 'type' ) != 14 ) :
397382data_collection = data_collection + \
398383received [1 ].get ('result' )
399384elif received [0 ]== 'SetPromptType' :
@@ -413,6 +398,8 @@ def do_execute(self, code, silent, store_history=True, user_expressions=None,
413398self .execute_line ("→\n " )
414399raise ValueError (
415400'JUPYTER NOTEBOOK: Input through ⎕ is not supported' )
401+ elif pt == 3 :
402+ break
416403elif pt == 4 :
417404time .sleep (1 )
418405raise ValueError (
@@ -434,6 +421,14 @@ def do_execute(self, code, silent, store_history=True, user_expressions=None,
434421self .ride_send (
435422 ["ReplyOptionsDialog" , {"index" :- 1 ,"token" :received [1 ].get ('token' )}])
436423# self.pa(received[1].get('input'))
424+ if pt == 3 :
425+ self .ride_send (["WeakInterrupt" , {}])#should be StrongInterrupt, which is not working
426+ if not SUSPEND :
427+ self .execute_line ("→\n " )
428+ self .out_error ('INPUT INTERRUPT: Incomplete code block' )
429+ self .ride_receive_wait ()
430+ dq .clear ()
431+
437432except KeyboardInterrupt :
438433self .ride_send (["StrongInterrupt" , {}])
439434if not SUSPEND :