

def _dispatch_gnome_terminal(self, cmd):
    wid = subprocess.check_output(['xdotool', 'search', '--onlyvisible', '--class', 'gnome-terminal'])
    sid = subprocess.check_output(['xdotool', 'getactivewindow']).decode('utf-8').strip()
    if wid:
        wid = wid.decode('utf-8').strip().split('\n')[(- 1)]
        cmd = (cmd.clean_cmd(cmd) + '\n')
        self.set_clipboard(cmd)
        subprocess.check_output(['xdotool', 'windowfocus', wid])
        subprocess.check_output(['xdotool', 'key', '--clearmodifiers', 'ctrl+shift+v'])
        subprocess.check_output(['xdotool', 'windowfocus', sid])
        self.reset_clipboard()

dataset/ETHPy150Open randy3k/SendTextPlus/textsender.py TextSender._dispatch_gnome_terminal/VarMisuse@85/124 `self`->`cmd`