def run(self, string, current_window_only=True):
"""
Send a string
Args:
string (str): string of characters to send
current_window_only (bool, optional): constrain terminal search to
the current ST window only
"""
if current_window_only:
windows = [self.window]
else:
windows = sublime.windows()
term_view = None
for w in windows:
for v in w.views():
term_view = TerminalViewManager.load_from_id(v.id())
if term_view is not None:
group, index = w.get_view_index(v)
active_view = w.active_view_in_group(group)
if active_view == v:
break
if term_view is None:
utils.ConsoleLogger.log("No terminal found")
return
term_view.send_string_to_shell(string)
评论列表
文章目录