Lines Matching +full:class +full:- +full:d
2 # SPDX-License-Identifier: GPL-2.0-only
12 class UnsupportedTerminal(Exception):
15 class NoSupportedTerminals(Exception):
20 class Registry(oe.classutils.ClassRegistry):
31 class Terminal(Popen, metaclass=Registry):
32 def __init__(self, sh_cmd, title=None, env=None, d=None): argument
51 class XTerminal(Terminal):
52 def __init__(self, sh_cmd, title=None, env=None, d=None): argument
53 Terminal.__init__(self, sh_cmd, title, env, d)
57 class Gnome(XTerminal):
58 command = 'gnome-terminal -t "{title}" -- {command}'
61 def __init__(self, sh_cmd, title=None, env=None, d=None): argument
62 # Recent versions of gnome-terminal does not support non-UTF8 charset:
65 # Once fixed on the gnome-terminal project, this should be removed.
68 XTerminal.__init__(self, sh_cmd, title, env, d)
70 class Mate(XTerminal):
71 command = 'mate-terminal --disable-factory -t "{title}" -x {command}'
74 class Xfce(XTerminal):
75 command = 'xfce4-terminal -T "{title}" -e "{command}"'
78 class Terminology(XTerminal):
79 command = 'terminology -T="{title}" -e {command}'
82 class Konsole(XTerminal):
83 command = 'konsole --separate --workdir . -p tabtitle="{title}" -e {command}'
86 def __init__(self, sh_cmd, title=None, env=None, d=None): argument
91 self.command = 'konsole -T "{title}" -e {command}'
94 self.command = 'konsole --nofork --workdir . -p tabtitle="{title}" -e {command}'
95 XTerminal.__init__(self, sh_cmd, title, env, d)
97 class XTerm(XTerminal):
98 command = 'xterm -T "{title}" -e {command}'
101 class Rxvt(XTerminal):
102 command = 'rxvt -T "{title}" -e {command}'
105 class Screen(Terminal):
106 command = 'screen -D -m -t "{title}" -S devshell {command}'
108 def __init__(self, sh_cmd, title=None, env=None, d=None): argument
110 self.command = "screen -D -m -t \"{title}\" -S %s {command}" % s_id
111 Terminal.__init__(self, sh_cmd, title, env, d)
113 '"screen -r %s"' % s_id
114 if (d):
115 bb.event.fire(bb.event.LogExecTTY(msg, "screen -r %s" % s_id,
116 0.5, 10), d)
120 class TmuxRunning(Terminal):
122 name = 'tmux-running'
123 command = 'tmux split-window -c "{cwd}" "{command}"'
126 def __init__(self, sh_cmd, title=None, env=None, d=None): argument
136 Terminal.__init__(self, sh_cmd, title, env, d)
138 class TmuxNewWindow(Terminal):
140 name = 'tmux-new-window'
141 command = 'tmux new-window -c "{cwd}" -n "{title}" "{command}"'
144 def __init__(self, sh_cmd, title=None, env=None, d=None): argument
151 Terminal.__init__(self, sh_cmd, title, env, d)
153 class Tmux(Terminal):
155 command = 'tmux new -c "{cwd}" -d -s devshell -n devshell "{command}"'
158 def __init__(self, sh_cmd, title=None, env=None, d=None): argument
164 window_name = 'devshell-%i' % os.getpid()
166 self.command = 'tmux new -c "{{cwd}}" -d -s {0} -n {0} "{{command}}"'
168 # `tmux new-session -c` was added in 1.9;
170 self.command = 'tmux new -d -s {0} -n {0} "{{command}}"'
172 Terminal.__init__(self, sh_cmd, title, env, d)
174 attach_cmd = 'tmux att -t {0}'.format(window_name)
175 …msg = 'Tmux started. Please connect in another terminal with `tmux att -t {0}`'.format(window_name)
176 if d:
177 bb.event.fire(bb.event.LogExecTTY(msg, attach_cmd, 0.5, 10), d)
181 class Custom(Terminal):
185 def __init__(self, sh_cmd, title=None, env=None, d=None): argument
186 self.command = d and d.getVar('OE_TERMINAL_CUSTOMCMD')
190 Terminal.__init__(self, sh_cmd, title, env, d)
208 def spawn_preferred(sh_cmd, title=None, env=None, d=None): argument
212 spawn(terminal.name, sh_cmd, title, env, d)
222 def spawn(name, sh_cmd, title=None, env=None, d=None): argument
238 …sh_cmd = bb.utils.which(os.getenv('PATH'), "oe-gnome-terminal-phonehome") + " " + pidfile + " " + …
239 pipe = terminal(sh_cmd, title, env, d)
242 output = output.decode("utf-8")
275 p = sub.Popen('%s list-panes -F "#{?pane_active,#{pane_height},}"' % tmux,
291 cmdversion = '%s --version' % terminalName
293 cmdversion = '%s -V' % terminalName
296 p = sub.Popen(['sh', '-c', cmdversion], stdout=sub.PIPE, stderr=sub.PIPE, env=newenv)
308 vernum = ver.split(' ')[-1]
310 vernum = ver.split(' ')[-1]
312 vernum = ver.split(' ')[-1]
314 vernum = ver.split()[-1]
315 if ver.startswith('tmux next-'):
316 vernum = ver.split()[-1][5:]
321 p = Popen(['lsb_release', '-i'])