@@ -204,7 +204,9 @@ def run(self, edit: sublime.Edit):
204
204
commands_count = SETTINGS ['history_count' ]
205
205
else :
206
206
commands_count = len (HISTORY .data )
207
+
207
208
commands_list = HISTORY .data [0 :commands_count ]
209
+ print ("commands_count: " , commands_count )
208
210
209
211
selection_with_index = [ f'{ index + 1 } . { HISTORY .data [index ]} ' for index in range (len (commands_list ))]
210
212
@@ -284,21 +286,22 @@ def run_command(self, user_input:str, panel_name:str=None):
284
286
cwd = os .path .dirname (self .view .file_name ())
285
287
286
288
# run in new shell window
289
+ run_with_new_window = False
287
290
if user_input [0 ][0 ] in RUN_IN_NEW_WINDOW_PREFIX :
288
291
if user_input [0 ][0 ] == ':' :
289
- pause = True
292
+ run_with_new_window = True
290
293
291
294
if user_input [0 ][0 ] == '$' :
292
- pause = 5
295
+ run_with_new_window = 5
293
296
294
297
commands = str (user_input [1 :]).split (' ' )
295
- shell .run_command (commands , shell = True , pause = pause , cwd = cwd )
298
+ shell .run_command (commands , shell = bool ( run_with_new_window ) , pause = run_with_new_window , cwd = cwd )
296
299
297
300
return
298
301
299
302
# running in sublime exec
300
303
commands = str (user_input ).split (' ' )
301
- res = shell .run_command (commands , shell = False , pause = False , cwd = cwd )
304
+ res = shell .run_command (commands , shell = run_with_new_window , pause = run_with_new_window , cwd = cwd )
302
305
303
306
if res ['success' ]:
304
307
command_res = res ['res' ]
0 commit comments