Commits on Aug 2, 2012
  1. wrapper: show the program's name in major messages

    Since this wrapper program is typically used in an "automatic"
    (non-interactive) way, it may be helpful to the user to include the
    program's name in some of the messages it prints.
    Add the program's name to the following messages:
     * The "unsupported old/new OS" messages may appear by themselves
       (e.g. before the wrapper is updated to handle a new OS X release).
     * The message after the reattach_failed label will also be issued
       after any earlier message (except the old/new OS message).
     * The message for a failed exec.
    Suggested-By: #14
    committed Aug 2, 2012
  2. wrapper: handle malloc() errors for -l processing

    Handle malloc() errors that might come up while doing "login"
    processing (massaging the new command's argv[0] when the "-l" option
    is used).
    Skip the string/argument manipulation and just use the strings that
    were given in the wrapper's argv. The new program will not find that
    its argv[0] starts with a dash, but we will at least give it
    a chance to try to run (although it may also face serious problems).
    committed Aug 2, 2012
  3. wrapper: make errors fall through to exec()

    Above the declaration of _vprocmgr_move_subset_to_user() in
    10.8's launchd-442.21/liblaunch/vproc_priv.h there is a comment that
    > One day, we'll be able to get rid of this...
    This caused me to consider the situation where the function is no
    longer available (whether or not some other workaround is required
    to (e.g.) gain access to the pasteboard).
    The original behavior of this wrapper program is to immediately
    abort on all errors. This is acceptable behavior for programs that
    are used interactively where the user can decide what to do next
    (e.g. try again without the wrapper).
    However, this wrapper is not typically used interactively, but more
    "automatically" (e.g. via default-command in tmux; as I described in
    the README). The abort-on-error behavior is much less acceptable in
    this situation (it would appear that tmux was unable to create
    (default) sessions, windows, or panes). For "automatic" uses, it
    would be much nicer to always attempt to run the specified program
    (after printing an appropriate message that describes the reason we
    failed to reattach to the user bootstrap namespace).
    Therefore, adjust the error handling so that we always fall through
    to the code that does the exec() (while still issuing informative
    committed Aug 1, 2012
Commits on Jul 30, 2012
  1. wrapper: explicitly warn about unknown options

    Reported as item #1 here:
    committed Jul 29, 2012
  2. wrapper: simplify arg copying

    The "-l" processing that was hoisted up in the previous commit made
    the "arg" variable effectively a constant. Replace it and the
    associated "ofs" variable with inline constants.
    committed Jul 29, 2012
  3. wrapper: account for -l when checking argc

    If "-l" is the first argument, record the fact in a variable and
    adjust argv and argc as if had not been present. This lets the
    existing "minimum arguments" check to handle the case where "-l" is
    the only argument.
    Previously, if "-l" was the only argument, we would end up with
    a segmentation fault from accidentally doing strlen(argv[argc])
    (i.e. strlen(NULL)) in the dash-prefixing code.
    Reported as item #2 here:
    committed Jul 29, 2012
  4. wrapper: tweak comments for 10.8

    A couple of comments mentioning "10.7" as the latest release were
    not updated in the previous Mountain Lion commit. Update them to
    just refer to "newer" instead of a specific version.
    committed Jul 29, 2012
Commits on Jul 22, 2012
  1. wrapper: 10.8 "Mountain Lion" support

    There has been some promising feedback regarding Mountain Lion.
    Update the wrapper code to not issue a warning about an "unsupported
    new OS" when run on Mountain Lion.
    There may be further changes once Apple publishes the 10.8 launchd
    sources (e.g. if the signature of the relevant function is changed
    as it was between 10.5 and 10.6).
    committed Jun 18, 2012
Commits on Aug 19, 2011
  1. wrapper: 10.7 "Lion" support

    Several users have reported "no problems" using the wrapper with
    Lion (although all using iTerm or iTerm2).
    Update the wrapper code to not issue a warning about an "unsupported
    new OS" when run on Lion.
    The signature of _vprocmgr_move_subset_to_user matches the one from
    10.6 (see libvproc.c or vproc_priv.h in the launchd source code).
    committed Jul 24, 2011
  2. wrapper: clarify use of 'os' variable

    The 'os' variable switches midway from representing the converted
    Mac OS X major release number to representing the "reattach
    variation" that we will are about to use. The former is (more or
    less) a number, but the latter is really more of an enum.
    committed Jul 24, 2011
Commits on Jul 22, 2011
  1. Revert "wrapper: provisional 10.7 "Lion" support"

    A user has reported kernel panics (!) with possible associations
    with tmux and the wrapper.
    Go back to warning on 10.7 until I hear some better-sounding reports
    (or get some first-hand experience with Lion)..
    This reverts commit 8c5ea5f.
    committed Jul 22, 2011
Commits on Jul 21, 2011
  1. wrapper: provisional 10.7 "Lion" support

    Update the wrapper code to not issue a warning about an "unsupported
    new OS" when run on Lion.
    This change is provisional because I have not tested it on a 10.7
    machine. The evidence seems to indicate that the "10.6 method" will
    also work on 10.7.
    Specifically, The signature of _vprocmgr_move_subset_to_user matches
    the one from 10.6 (see libvproc.c or vproc_priv.h in the launchd
    source code).
    Wikipedia's Darwin article says 10.7 is Darwin 11.0.0, so I assume
    that is what uname reports for ustname.release.
    committed Jul 21, 2011
Commits on Jun 26, 2011
  1. protect emphasis before right single quote

    redcarpet in rdiscount mode (RedcarpetCompat) renders
    literally instead of providing emphasis.
    If I write the right single quote as an entity:
    then rdiscount, redcarpet and RedcarpetCompat all render the
    This problem did show up in GitHub’s rendering of
    Thanks to Trevor for pointing out redcarpet and RedcarpetCompat:
        #2 (comment)
    committed Jun 26, 2011
  2. escape "bare" underscores

    Even though some Markdown interpreters do not give special meaning
    to these particular underscores (because they were inside
    asterisks?), they should be escaped so that some other Markdown
    interpreter (e.g. redcarpet in its "native" mode) will not interpret
    them as emphasis/strong delimiters.
    Tested with rdiscount, redcarpet and RedcarpetCompat.
    This problem did NOT show up when GitHub renders (they use
    RedCarpetCompat?), but it is probably good to fix it anyway since it
    does confuse the default redcarpet.
    committed Jun 26, 2011
  3. Merge branch 'tw/develop'

    My comments on Trevor's changes:
      Makefile: remove ppc from default arches
        This also makes sense since PPC binaries seems unlikely to be
        supported in the next release of Mac OS X (10.7 Lion, due next
  indentation fixes
        These are correct.
        My local rdiscount-based rendering did not require the extra
        spaces to achieve the desired output, but GitHub was rendering
        them differently. These changes make GitHub's output match my
        local output (at least for the modified section).
  add `tmux kill-server`
        Good idea. However, given the context ("restart your server"),
        I think we should explicitly warn about its effects. I appended
        a commit.
    committed Jun 26, 2011
  4. be explicit about kill-server

    I would not want someone to think that `tmux kill-server` could be
    used to simply "Restart [their] *tmux* server" (i.e. the topic of
    the list item) without losing all of their existing sessions,
    windows, panes, processes, etc.
    Also, kill trailing whitespace introduced in the commit that
    introduced `kill-server`.
    committed Jun 26, 2011
Commits on Jun 25, 2011
  1. @trevor

    minor doc styling

    trevor committed Jun 25, 2011
  2. @trevor

    minor doc styling

    trevor committed Jun 25, 2011
  3. @trevor

    resolve make error when llvm doesn't have powerpc

    % make
    cc -Wall -Wextra -ansi -pendantic -arch i386 -arch ppc -arch x86_64 -mmacosx-version-min=10.5   -c -o test.o test.c
    llvm-gcc-4.2: error trying to exec '/usr/bin/../llvm-gcc-4.2/bin/powerpc-apple-darwin10-llvm-gcc-4.2': execvp: No such file or directory
    lipo: can't figure out the architecture type of: /var/folders/MT/MTdESo89GBCaGM7Hevp5+E+++TI/-Tmp-//ccG0JJrt.out
    make: *** [test.o] Error 255
    trevor committed Jun 25, 2011
Commits on Apr 1, 2011
Commits on Mar 30, 2011
  1. standardize static strings

    Since I never change the characters or reassign the pointers, they
    might as well all be static, const char arrays.
    committed Mar 30, 2011
Commits on Mar 29, 2011
  1. test: const-ize (struct cmd).func

    cmd_func is also redefined as the function type itself instead of
    a pointer to a function; we can now use it to declare the functions.
    committed Mar 29, 2011
  2. test: clean up struct cmd strings

    There is no good reason to have the strings be arrays. The compiler
    would probably warn if the strings got too big, but it might not
    warn if there the only thing that would fit was the trailing '\0'.
        char foo[8] = "abcdefgh";  /* might not be '\0' terminated */
    committed Mar 29, 2011
  3. test: delete junk typedef

    committed Mar 29, 2011
  4. test: internal functions should be static

    Nothing else uses the object file, but we might as well make our
    "private" functions static.
    committed Mar 29, 2011
  5. wrapper: proper free if exec and die fail

    This is unlikely, but we might as well fix it so that we are not
    freeing things we did not allocate.
    A development version of 1d62824 (wrapper: learn the "-l" option,
    2011-03-18) worked something like this, but it was lost to reworking
    before the final commit.
    valgrind will point out of the problem if we arrange for die_errno
    to not actually exit.
    committed Mar 29, 2011
  6. Crank up and fix warnings

    committed Mar 29, 2011
  7. NOTES: clean ups; summary

    Found this in a stash; it was supposed to be part of
    351e829 (, 2011-03-26).
    committed Mar 29, 2011
Commits on Mar 27, 2011
  1. msg.h: license

    committed Mar 27, 2011
Commits on Mar 26, 2011
  1. LICENSE: Simplified BSD

    committed Mar 26, 2011

    committed Mar 26, 2011
  3. add usage/help

    committed Mar 26, 2011
  4. Makefile: universal compilation

    Set the minimum Mac OS X version to 10.5.
    It is possible to compile these programs on Mac OS X 10.4, however
    none of the useful private API functions are available there.
    committed Mar 25, 2011
Commits on Mar 25, 2011