<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 04/05/2013 09:20 AM, Chris Larson
      wrote:<br>
    </div>
    <blockquote
cite="mid:CABcZANmero-tncAWaex6xe-1SPn_TYEN5JMdrzcPDdhxPxGwaQ@mail.gmail.com"
      type="cite">
      <meta http-equiv="Context-Type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div class="gmail_extra"><br>
          <div class="gmail_quote">On Fri, Apr 5, 2013 at 6:55 AM, Jason
            Wessel <span dir="ltr">&lt;<a moz-do-not-send="true"
                href="mailto:jason.wessel@windriver.com" target="_blank">jason.wessel@windriver.com</a>&gt;</span>
            wrote:<br>
            <blockquote class="gmail_quote">
              <div class="HOEnZb adM">
                <div class="h5">On 04/04/2013 07:44 PM, Christopher
                  Larson wrote:<br>
                  &gt; From: Christopher Larson &lt;<a
                    moz-do-not-send="true"
                    href="mailto:chris_larson@mentor.com">chris_larson@mentor.com</a>&gt;<br>
                  &gt;<br>
                  &gt; This adds two new Terminal classes. It's
                  separated into two, so that opening<br>
                  &gt; a split inside a tmux window is preferred to the
                  other terminal types, but<br>
                  &gt; opening a tmux session is prioritized only
                  slightly higher than screen.<br>
                  &gt;<br>
                  &gt; - tmuxrunning: Open a new pane in the current
                  running tmux window. Requires<br>
                  &gt;   that the TMUX variable be added to the env
                  whitelist to use it.<br>
                  &gt; - tmux: Open a new tmux session<br>
                  &gt;<br>
                  &gt; Signed-off-by: Christopher Larson &lt;<a
                    moz-do-not-send="true"
                    href="mailto:chris_larson@mentor.com">chris_larson@mentor.com</a>&gt;<br>
                  &gt; ---<br>
                  &gt;  meta/lib/oe/terminal.py | 38
                  ++++++++++++++++++++++++++++++++++++++<br>
                  &gt;  1 file changed, 38 insertions(+)<br>
                  &gt;<br>
                  &gt; diff --git a/meta/lib/oe/terminal.py
                  b/meta/lib/oe/terminal.py<br>
                  &gt; index 2e23d59..e52863f 100644<br>
                  &gt; --- a/meta/lib/oe/terminal.py<br>
                  &gt; +++ b/meta/lib/oe/terminal.py<br>
                  &gt; @@ -142,6 +142,44 @@ class
                  TmuxNewSession(Terminal):<br>
                  &gt;          else:<br>
                  &gt;              logger.warn(msg)<br>
                  &gt;<br>
                  &gt; +class TmuxRunning(Terminal):<br>
                  &gt; +    """Open a new pane in the current running
                  tmux window"""<br>
                  &gt; +    name = 'tmux-running'<br>
                  &gt; +    command = 'tmux split-window {command}'<br>
                  &gt; +    priority = 2.75<br>
                  &gt; +<br>
                  &gt; +    def __init__(self, sh_cmd, title=None,
                  env=None, d=None):<br>
                  &gt; +        if not bb.utils.which(os.getenv('PATH'),
                  'tmux'):<br>
                  &gt; +            raise UnsupportedTerminal('tmux is
                  not installed')<br>
                  &gt; +<br>
                  &gt; +        if not os.getenv('TMUX'):<br>
                  &gt; +            raise UnsupportedTerminal('tmux is
                  not running')<br>
                  &gt; +<br>
                  &gt; +        Terminal.__init__(self, sh_cmd, title,
                  env, d)<br>
                  <br>
                  <br>
                </div>
              </div>
              When we chatted yesterday I didn't fully understand how
              the Tmux Running piece worked.   Now I get it, you run
              tmux and then start a build with in that session and just
              join back to it when the TMUX var is set because that is
              how TMUX does internal communications setup.  I have to
              admit that is pretty slick. :-)<br>
              <br>
              It seems to me we can just fold these two classes together
              and drive it off the TMUX variable.   This way we can just
              have one OE TERMINAL type, and if you don't want the
              behavior to engage of the "split" you just unset TMUX
              before you build.   I believe that this covers all the
              cases you care about, and would allow for the simplistic
              case I care about where I just set OE_TERMINAL=tmux to
              work for both cases. I would recommend we just patch up
              the bitbake.conf BBHASH pieces all in one shot with this
              patch so their is nothing special anyone has to do to make
              use of this.<br>
              <br>
              Would you be ok with that?<br>
              <br>
              Further work that I'll probably consider doing if no one
              else does it first is to add tmux-native so we always have
              it as the fall back for getting to patch failures and such
              on a remote build server.</blockquote>
          </div>
          <br>
          The problem with combining them is they'd be stuck at the same
          priority, which makes 'auto' less useful. In the case where
          DISPLAY and TMUX are both set, I think it makes more sense to
          prefer to interact with the running tmux session rather than
          spawning a new xterm, yet spawning a new tmux session should
          be kept at the same priority as screen to meet user
          expectations.</div>
        <div class="gmail_extra"><br>
        </div>
        <div class="gmail_extra">A decent compromise, to make the
          explicit OE_TERMINAL=tmux case more useful, would be to merge
          the tmuxrunning bits into tmux, but still keep the independent
          tmuxrunning class for the 'auto' case. Thoughts on that?</div>
      </div>
    </blockquote>
    <br>
    <br>
    Based on how the auto list processing works your latest proposed
    solution seems like the most reasonable choice.<br>
    <br>
    Thanks,<br>
    Jason.<br>
  </body>
</html>