Loading ...
Sorry, an error occurred while loading the content.

Why copy / paste doesn't work within screen.

Expand Messages
  • IdaRub
    This was killing me, so I spent a bit of time looking at it. It is an Apple specific patch to screen:
    Message 1 of 5 , Sep 3, 2009
    • 0 Attachment
      This was killing me, so I spent a bit of time looking at it. It is an
      Apple specific patch to screen:

      http://opensource.apple.com/source/screen/screen-16/patches/screen.c.diff

      +#ifdef __APPLE__
      + if (_vprocmgr_detach_from_console(0) != NULL)
      + errx(1, "can't detach from console");
      +#endif

      ...

      vproc_err_t
      _vprocmgr_detach_from_console(vproc_flags_t flags __attribute__
      ((unused)))
      {
      return _vprocmgr_switch_to_session
      (VPROCMGR_SESSION_BACKGROUND, 0);
      }

      This means you're no longer attached to login session / context, and
      can't talk to the pasteboard. I am going to try to monkey patch
      screen and see how that works out.

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_mac" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • björn
      ... Hi, I just tried starting MacVim from within screen on Snow Leopard and found that copy and paste _does_ work. Everybody using screen should update
      Message 2 of 5 , Sep 3, 2009
      • 0 Attachment
        2009/9/3 IdaRub:
        >
        > This was killing me, so I spent a bit of time looking at it.  It is an
        > Apple specific patch to screen:
        >
        > http://opensource.apple.com/source/screen/screen-16/patches/screen.c.diff
        >
        > +#ifdef __APPLE__
        > +       if (_vprocmgr_detach_from_console(0) != NULL)
        > +               errx(1, "can't detach from console");
        > +#endif
        >
        > ...
        >
        > vproc_err_t
        > _vprocmgr_detach_from_console(vproc_flags_t flags __attribute__
        > ((unused)))
        > {
        >        return _vprocmgr_switch_to_session
        > (VPROCMGR_SESSION_BACKGROUND, 0);
        > }
        >
        > This means you're no longer attached to login session / context, and
        > can't talk to the pasteboard.  I am going to try to monkey patch
        > screen and see how that works out.

        Hi,

        I just tried starting MacVim from within "screen" on Snow Leopard and
        found that copy and paste _does_ work.

        Everybody using "screen" should update _now_ (that was a joke). :-O

        Björn

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_mac" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • IdaRub
        I haven t tried it yet, but what if you were to call: _vprocmgr_switch_to_session(VPROCMGR_SESSION_LOGINWINDOW, 0); On MacVim startup? ...
        Message 3 of 5 , Sep 3, 2009
        • 0 Attachment
          I haven't tried it yet, but what if you were to call:

          _vprocmgr_switch_to_session(VPROCMGR_SESSION_LOGINWINDOW, 0);

          On MacVim startup?

          On Sep 3, 3:11 pm, björn <bjorn.winck...@...> wrote:
          > 2009/9/3 IdaRub:
          >
          >
          >
          >
          >
          >
          >
          > > This was killing me, so I spent a bit of time looking at it.  It is an
          > > Apple specific patch to screen:
          >
          > >http://opensource.apple.com/source/screen/screen-16/patches/screen.c....
          >
          > > +#ifdef __APPLE__
          > > +       if (_vprocmgr_detach_from_console(0) != NULL)
          > > +               errx(1, "can't detach from console");
          > > +#endif
          >
          > > ...
          >
          > > vproc_err_t
          > > _vprocmgr_detach_from_console(vproc_flags_t flags __attribute__
          > > ((unused)))
          > > {
          > >        return _vprocmgr_switch_to_session
          > > (VPROCMGR_SESSION_BACKGROUND, 0);
          > > }
          >
          > > This means you're no longer attached to login session / context, and
          > > can't talk to the pasteboard.  I am going to try to monkey patch
          > > screen and see how that works out.
          >
          > Hi,
          >
          > I just tried starting MacVim from within "screen" on Snow Leopard and
          > found that copy and paste _does_ work.
          >
          > Everybody using "screen" should update _now_ (that was a joke). :-O
          >
          > Björn
          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_mac" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • björn
          ... I m on Snow Leopard so I can t test it since copy&paste already works. At any rate -- I don t particularly like the idea of patching MacVim to fix a bug in
          Message 4 of 5 , Sep 3, 2009
          • 0 Attachment
            2009/9/3 IdaRub:
            >
            > I haven't tried it yet, but what if you were to call:
            >
            > _vprocmgr_switch_to_session(VPROCMGR_SESSION_LOGINWINDOW, 0);
            >
            > On MacVim startup?

            I'm on Snow Leopard so I can't test it since copy&paste already works.
            At any rate -- I don't particularly like the idea of patching MacVim
            to fix a bug in screen...

            Björn

            --~--~---------~--~----~------------~-------~--~----~
            You received this message from the "vim_mac" maillist.
            For more information, visit http://www.vim.org/maillist.php
            -~----------~----~----~----~------~----~------~--~---
          • IdaRub
            Ok, so one (kinda ugly) thing that works for 10.5. DYLD_INSERT_LIBRARIES=/somewhere/fixcnp_shim /usr/bin/screen compile with gcc -dynamiclib -o fixcnp_shim
            Message 5 of 5 , Sep 3, 2009
            • 0 Attachment
              Ok, so one (kinda ugly) thing that works for 10.5.

              DYLD_INSERT_LIBRARIES=/somewhere/fixcnp_shim /usr/bin/screen

              compile with gcc -dynamiclib -o fixcnp_shim fixcnp_shim.c

              #include <unistd.h>
              #include <stdint.h>

              void* _vprocmgr_move_subset_to_user(uid_t target_user,
              const char *session_type,
              uint64_t flags);

              typedef struct interpose_s {
              void *new_func;
              void *orig_func;
              } interpose_t;

              void* my__vprocmgr_move_subset_to_user(uid_t target_user,
              const char *session_type,
              uint64_t flags) {
              return NULL;
              }

              static const interpose_t interposers[] \
              __attribute__ ((section("__DATA, __interpose"))) = {
              { (void*)my__vprocmgr_move_subset_to_user,
              (void*)_vprocmgr_move_subset_to_user }};


              On Sep 3, 5:36 pm, björn <bjorn.winck...@...> wrote:
              > 2009/9/3 IdaRub:
              >
              >
              >
              > > I haven't tried it yet, but what if you were to call:
              >
              > > _vprocmgr_switch_to_session(VPROCMGR_SESSION_LOGINWINDOW, 0);
              >
              > > On MacVim startup?
              >
              > I'm on Snow Leopard so I can't test it since copy&paste already works.
              >  At any rate -- I don't particularly like the idea of patching MacVim
              > to fix a bug in screen...
              >
              > Björn
              --~--~---------~--~----~------------~-------~--~----~
              You received this message from the "vim_mac" maillist.
              For more information, visit http://www.vim.org/maillist.php
              -~----------~----~----~----~------~----~------~--~---
            Your message has been successfully submitted and would be delivered to recipients shortly.