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

Re: [PATCH] Add support for focus reporting (Xterm/private mode1004) in unix terminals

Expand Messages
  • Bram Moolenaar
    ... Thanks for the patch. I will add it to the todo list. -- hundred-and-one symptoms of being an internet addict: 216. Your pet rock leaves home. /// Bram
    Message 1 of 8 , Apr 23, 2013
      Hayaki Saito wrote:

      > Hello, lists
      >
      > I wrote a patch for adding support for focus reporting mode (Xterm /
      > private mode 1004) which works on xterm compatible terminals.
      >
      > When this feature is enabled by the private mode sequence
      > "\033[?1004h", Some xterm compatible terminals comes to send <Esc>[I
      > (focus in event) and <Esc>[O (focus out event). I think they should be
      > corresponded with FocusGained/FocusLost event and should be handled
      > from VimScript context.
      >
      > According to vim documents, FocusGained/FocusLost event is supported
      > by "Only for the GUI version and a few console versions".
      > These days, the focus reporting feature is supported by some unix
      > terminals such as Xterm, mlterm, TeraTerm, MinTTY, iTerm2, tty.js,
      > RLogin,... and so on. Recently tmux 1.8 also supports this. Please try
      > it on them if you are interested.

      Thanks for the patch. I will add it to the todo list.


      --
      hundred-and-one symptoms of being an internet addict:
      216. Your pet rock leaves home.

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
      \\\ an exciting new programming language -- http://www.Zimbu.org ///
      \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

      --
      --
      You received this message from the "vim_dev" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php

      ---
      You received this message because you are subscribed to the Google Groups "vim_dev" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Daniel Hahler
      Hello Hayaki, hello Bram, I ve came across this patch (via the todo list) and it would be awesome to have this feature, which hopefully works with urxvt then,
      Message 2 of 8 , Jan 6, 2015
        Hello Hayaki, hello Bram,

        I've came across this patch (via the todo list) and it would be awesome to have this feature, which hopefully works with urxvt then, too.

        The patch does not apply anymore cleanly (which is not surprising giving its age), but might be easy to refresh/re-roll.

        @Hayaki: do you have a newer patch available?


        Regards,
        Daniel.

        Am Dienstag, 23. April 2013 22:37:32 UTC+2 schrieb Bram Moolenaar:
        > Hayaki Saito wrote:
        >
        > > Hello, lists
        > >
        > > I wrote a patch for adding support for focus reporting mode (Xterm /
        > > private mode 1004) which works on xterm compatible terminals.
        > >
        > > When this feature is enabled by the private mode sequence
        > > "\033[?1004h", Some xterm compatible terminals comes to send <Esc>[I
        > > (focus in event) and <Esc>[O (focus out event). I think they should be
        > > corresponded with FocusGained/FocusLost event and should be handled
        > > from VimScript context.
        > >
        > > According to vim documents, FocusGained/FocusLost event is supported
        > > by "Only for the GUI version and a few console versions".
        > > These days, the focus reporting feature is supported by some unix
        > > terminals such as Xterm, mlterm, TeraTerm, MinTTY, iTerm2, tty.js,
        > > RLogin,... and so on. Recently tmux 1.8 also supports this. Please try
        > > it on them if you are interested.
        >
        > Thanks for the patch. I will add it to the todo list.
        >
        >
        > --
        > hundred-and-one symptoms of being an internet addict:
        > 216. Your pet rock leaves home.
        >
        > /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        > /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
        > \\\ an exciting new programming language -- http://www.Zimbu.org ///
        > \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

        --
        --
        You received this message from the "vim_dev" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php

        ---
        You received this message because you are subscribed to the Google Groups "vim_dev" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
        For more options, visit https://groups.google.com/d/optout.
      • Hayaki Saito
        ... No, I fear it causes another problems, so now I think this patch should be rewritten entirely. 033[I and 033[O should be introduced as a new keycode
        Message 3 of 8 , Jan 7, 2015
          > @Hayaki: do you have a newer patch available?

          No, I fear it causes another problems, so now I think this patch should be rewritten entirely.
          "\033[I" and "\033[O" should be introduced as a new keycode instead of hardcoding it.

          Note: If you simply apply this patch and use it on tmux, it causes a problem of extra focus event.
          Once I reported this problem to tmux-users (http://sourceforge.net/p/tmux/mailman/message/30825088/).
          After that, I discussed with tmux's maintainer about this issue and proposed a trivial patch, in private messages. But it is rejected.
          We will have to add some workaround to ignore extra focus events of tmux.

          -- Hayaki Saito

          --
          --
          You received this message from the "vim_dev" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php

          ---
          You received this message because you are subscribed to the Google Groups "vim_dev" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
          For more options, visit https://groups.google.com/d/optout.
        • Hayaki Saito
          Hello Daniel, hello lists, I revised the patch. Please check. - avoid modification of the existing code for parsing termresponse. - add the workaround for
          Message 4 of 8 , Jan 9, 2015
            Hello Daniel, hello lists,

            I revised the patch. Please check.

            - avoid modification of the existing code for parsing termresponse.
            - add the workaround for tmux.

            -- Hayaki Saito

            --
            --
            You received this message from the "vim_dev" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php

            ---
            You received this message because you are subscribed to the Google Groups "vim_dev" group.
            To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
            For more options, visit https://groups.google.com/d/optout.
          • Christ van Willegen
            Hi, ... This is just from reading the code, I have no further working knowledge :-) + char_u name[2]; + + name[0] = (int)KS_EXTRA; + + /* handle focus in event
            Message 5 of 8 , Jan 10, 2015
              Hi,

              On Sat, Jan 10, 2015 at 6:00 AM, Hayaki Saito <user@...> wrote:
              > Hello Daniel, hello lists,
              >
              > I revised the patch. Please check.

              This is just from reading the code, I have no further working knowledge :-)

              + char_u name[2];
              +
              + name[0] = (int)KS_EXTRA;
              +
              + /* handle focus in event */
              + name[1] = (int)KE_FOCUSGAINED;
              + add_termcode(name, (char_u *)"\033[I", FALSE);

              Does add_termcode handle a non-zero terminated string?

              Christ van Willegen
              --
              09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0

              --
              --
              You received this message from the "vim_dev" maillist.
              Do not top-post! Type your reply below the text you are replying to.
              For more information, visit http://www.vim.org/maillist.php

              ---
              You received this message because you are subscribed to the Google Groups "vim_dev" group.
              To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
              For more options, visit https://groups.google.com/d/optout.
            • Hayaki Saito
              Hi, ... Yes, in term.c, names of termcode seem to be always treated as fixed size(2byte) data. I confirmed these are always accessed with bracket operators
              Message 6 of 8 , Jan 10, 2015
                Hi,

                > + char_u name[2];
                > +
                > + name[0] = (int)KS_EXTRA;
                > +
                > + /* handle focus in event */
                > + name[1] = (int)KE_FOCUSGAINED;
                > + add_termcode(name, (char_u *)"\033[I", FALSE);
                >
                > Does add_termcode handle a non-zero terminated string?

                Yes, in term.c, names of termcode seem to be always treated as fixed size(2byte) data.
                I confirmed these are always accessed with bracket operators "[]", at least in add_termcode().

                Thanks,

                -- Hayaki Saito

                --
                --
                You received this message from the "vim_dev" maillist.
                Do not top-post! Type your reply below the text you are replying to.
                For more information, visit http://www.vim.org/maillist.php

                ---
                You received this message because you are subscribed to the Google Groups "vim_dev" group.
                To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                For more options, visit https://groups.google.com/d/optout.
              • Christ van Willegen
                ... Ok! Like I said tis was only from looking at the diff, not at the full source code... Christ van Willegen -- 09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88
                Message 7 of 8 , Jan 11, 2015
                  On Sun, Jan 11, 2015 at 5:27 AM, Hayaki Saito <user@...> wrote:
                  > Hi,
                  >
                  >> + char_u name[2];
                  >> +
                  >> + name[0] = (int)KS_EXTRA;
                  >> +
                  >> + /* handle focus in event */
                  >> + name[1] = (int)KE_FOCUSGAINED;
                  >> + add_termcode(name, (char_u *)"\033[I", FALSE);
                  >>
                  >> Does add_termcode handle a non-zero terminated string?
                  >
                  > Yes, in term.c, names of termcode seem to be always treated as fixed size(2byte) data.
                  > I confirmed these are always accessed with bracket operators "[]", at least in add_termcode().

                  Ok! Like I said tis was only from looking at the diff, not at the full
                  source code...

                  Christ van Willegen
                  --
                  09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0

                  --
                  --
                  You received this message from the "vim_dev" maillist.
                  Do not top-post! Type your reply below the text you are replying to.
                  For more information, visit http://www.vim.org/maillist.php

                  ---
                  You received this message because you are subscribed to the Google Groups "vim_dev" group.
                  To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                  For more options, visit https://groups.google.com/d/optout.
                Your message has been successfully submitted and would be delivered to recipients shortly.