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

[patch] Correctly handle URXVT mouse in set/del_mouse_termcode

Expand Messages
  • James McCoy
    Since the urxvt mouse handling was added, certain actions in Vim would cause the mouse to get disabled even all the setting still indicated it should be
    Message 1 of 3 , Nov 2, 2011
      Since the urxvt mouse handling was added, certain actions in Vim would
      cause the mouse to get disabled even all the setting still indicated
      it should be enabled. When running Vim in xterm,
      check_mouse_termcode() calls set_mouse_termcode(KS_MOUSE, ...) to
      enable xterm handling as well as del_mouse_termcode(KS_URXVT_MOUSE,
      ...) to turn off URXVT handling. However, since del_mouse_termcode()
      doesn't handle URXVT specifically that had the effect of disabling
      KS_MOUSE, effectively setting has_mouse_termcode to 0. So, any later
      action which would have cause to temporarily disable the mouse (e.g.,
      the warning message when starting to edit a read-only file or using
      <C-z> to background Vim) would not know to re-enable the mouse since
      setmouse() returns early if has_mouse_termcode is 0.

      Attached patch adds the URXVT handling to set/del_mouse_termcode.

      Cheers,
      --
      James
      GPG Key: 1024D/61326D40 2003-09-02 James McCoy <jamessan@...>

      --
      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
    • Taylor Hedberg
      I noticed that problem myself, but it went away when I set ttymouse=urxvt rather than its default (in urxvt), which is xterm2. Not that your patch isn t
      Message 2 of 3 , Nov 3, 2011
        I noticed that problem myself, but it went away when I set
        ttymouse=urxvt rather than its default (in urxvt), which is xterm2. Not
        that your patch isn't worthwhile, but setting the option appropriately
        can serve as a workaround in the interim.

        Also, the urxvt setting for 'ttymouse' isn't documented, so it's
        difficult to discover right now. I sent a tiny patch a few days ago
        adding a mention of it in options.txt, but more/better documentation is
        really needed.

        --
        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
      • James McCoy
        ... The problem my patch is addressing is ensuring the mouse is still usable when ttymouse is set to something other than xterm/xterm2 (which are correct
        Message 3 of 3 , Nov 3, 2011
          On Thu, Nov 03, 2011 at 09:57:01AM -0400, Taylor Hedberg wrote:
          > I noticed that problem myself, but it went away when I set
          > ttymouse=urxvt rather than its default (in urxvt), which is xterm2. Not
          > that your patch isn't worthwhile, but setting the option appropriately
          > can serve as a workaround in the interim.

          The problem my patch is addressing is ensuring the mouse is still usable
          when 'ttymouse' is set to something other than xterm/xterm2 (which are
          correct values in my case, since I use xterm).

          As of 7.3.343, ttymouse gets set to xterm2 in urxvt and in 7.3.353 it
          gets set to xterm. So, it looks like the auto-detection still needs
          some work.

          > Also, the urxvt setting for 'ttymouse' isn't documented, so it's
          > difficult to discover right now. I sent a tiny patch a few days ago
          > adding a mention of it in options.txt, but more/better documentation is
          > really needed.

          Well, ideally people wouldn't have to know about 'ttymouse' and the
          detection Just Works. :)

          --
          James
          GPG Key: 1024D/61326D40 2003-09-02 James McCoy <jamessan@...>
        Your message has been successfully submitted and would be delivered to recipients shortly.