Patch 8.1.1267

54 views
Skip to first unread message

Bram Moolenaar

unread,
May 4, 2019, 11:35:16 AM5/4/19
to vim...@googlegroups.com

Patch 8.1.1267
Problem: Cannot check if GPM mouse support is working.
Solution: Add the "mouse_gpm_enable" feature.
Files: src/evalfunc.c, src/os_unix.c, src/proto/os_unix.pro,
runtime/doc/eval.txt


*** ../vim-8.1.1266/src/evalfunc.c 2019-05-04 15:47:25.629423511 +0200
--- src/evalfunc.c 2019-05-04 17:14:45.007701328 +0200
***************
*** 6810,6815 ****
--- 6810,6819 ----
else if (STRICMP(name, "netbeans_enabled") == 0)
n = netbeans_active();
#endif
+ #ifdef FEAT_MOUSE_GPM
+ else if (STRICMP(name, "mouse_gpm_enabled") == 0)
+ n = gpm_enabled();
+ #endif
#if defined(FEAT_TERMINAL) && defined(MSWIN)
else if (STRICMP(name, "terminal") == 0)
n = terminal_enabled();
*** ../vim-8.1.1266/src/os_unix.c 2019-05-04 16:58:41.617537336 +0200
--- src/os_unix.c 2019-05-04 17:32:01.574164411 +0200
***************
*** 7022,7028 ****
}
#endif /* !HAVE_RENAME */

! #ifdef FEAT_MOUSE_GPM
/*
* Initializes connection with gpm (if it isn't already opened)
* Return 1 if succeeded (or connection already opened), 0 if failed
--- 7022,7028 ----
}
#endif /* !HAVE_RENAME */

! #if defined(FEAT_MOUSE_GPM) || defined(PROTO)
/*
* Initializes connection with gpm (if it isn't already opened)
* Return 1 if succeeded (or connection already opened), 0 if failed
***************
*** 7059,7070 ****
}

/*
* Closes connection to gpm
*/
static void
gpm_close(void)
{
! if (gpm_flag && gpm_fd >= 0) /* if Open */
Gpm_Close();
}

--- 7059,7079 ----
}

/*
+ * Returns TRUE if the GPM mouse is enabled.
+ */
+ int
+ gpm_enabled(void)
+ {
+ return gpm_flag && gpm_fd >= 0;
+ }
+
+ /*
* Closes connection to gpm
*/
static void
gpm_close(void)
{
! if (gpm_enabled())
Gpm_Close();
}

*** ../vim-8.1.1266/src/proto/os_unix.pro 2019-04-28 22:50:36.157248454 +0200
--- src/proto/os_unix.pro 2019-05-04 17:16:15.015180036 +0200
***************
*** 72,77 ****
--- 72,78 ----
int mch_has_exp_wildcard(char_u *p);
int mch_has_wildcard(char_u *p);
int mch_rename(const char *src, const char *dest);
+ int gpm_enabled(void);
int mch_libcall(char_u *libname, char_u *funcname, char_u *argstring, int argint, char_u **string_result, int *number_result);
void setup_term_clip(void);
void start_xterm_trace(int button);
*** ../vim-8.1.1266/runtime/doc/eval.txt 2019-05-04 15:47:25.633423491 +0200
--- runtime/doc/eval.txt 2019-05-04 17:33:42.425616784 +0200
***************
*** 10470,10475 ****
--- 10532,10538 ----
mouse Compiled with support mouse.
mouse_dec Compiled with support for Dec terminal mouse.
mouse_gpm Compiled with support for gpm (Linux console mouse)
+ mouse_gpm_enabled GPM mouse is working
mouse_netterm Compiled with support for netterm mouse.
mouse_pterm Compiled with support for qnx pterm mouse.
mouse_sysmouse Compiled with support for sysmouse (*BSD console mouse)
*** ../vim-8.1.1266/src/version.c 2019-05-04 17:30:02.502806618 +0200
--- src/version.c 2019-05-04 17:31:16.134410093 +0200
***************
*** 769,770 ****
--- 769,772 ----
{ /* Add new patch number below this line */
+ /**/
+ 1267,
/**/

--
LAUNCELOT: Isn't there a St. Aaaaarrrrrrggghhh's in Cornwall?
ARTHUR: No, that's Saint Ives.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

/// Bram Moolenaar -- Br...@Moolenaar.net -- 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 ///

lilydjwg

unread,
May 6, 2019, 2:33:33 AM5/6/19
to vim...@googlegroups.com
On Sat, May 04, 2019 at 05:35:06PM +0200, Bram Moolenaar wrote:
>
> Patch 8.1.1267
> Problem: Cannot check if GPM mouse support is working.
> Solution: Add the "mouse_gpm_enable" feature.
> Files: src/evalfunc.c, src/os_unix.c, src/proto/os_unix.pro,
> runtime/doc/eval.txt

This patch breaks "set mouse=a" in tmux for me.

--
Best regards,
lilydjwg

Bram Moolenaar

unread,
May 6, 2019, 9:54:22 AM5/6/19
to vim...@googlegroups.com, lilydjwg
That is not possible. Perhaps it was an earlier patch?

--
A special law prohibits unmarried women from parachuting on Sunday or she
shall risk arrest, fine, and/or jailing.
[real standing law in Florida, United States of America]

lilydjwg

unread,
May 10, 2019, 2:37:45 AM5/10/19
to Bram Moolenaar, vim...@googlegroups.com
On Mon, May 06, 2019 at 03:54:14PM +0200, Bram Moolenaar wrote:
>
> > On Sat, May 04, 2019 at 05:35:06PM +0200, Bram Moolenaar wrote:
> > >
> > > Patch 8.1.1267
> > > Problem: Cannot check if GPM mouse support is working.
> > > Solution: Add the "mouse_gpm_enable" feature.
> > > Files: src/evalfunc.c, src/os_unix.c, src/proto/os_unix.pro,
> > > runtime/doc/eval.txt
> >
> > This patch breaks "set mouse=a" in tmux for me.
>
> That is not possible. Perhaps it was an earlier patch?

git bisect finds this. However I tried again and it finds 1265. Perhaps
I need to clean the workspace between each run. So I tried again and it
finds 1265 again. And reverting that patch (including 1-1264, 1266-1312)
the issue is gone.

Also I notice that 'set ttymouse=xterm' restores mouse support, although
it was already xterm.

--
Best regards,
lilydjwg

Linux Vim Python 我的博客:
https://blog.lilydjwg.me/
--
A: Because it obfuscates the reading.
Q: Why is top posting so bad?

Bram Moolenaar

unread,
May 10, 2019, 3:57:18 PM5/10/19
to vim...@googlegroups.com, lilydjwg

> On Mon, May 06, 2019 at 03:54:14PM +0200, Bram Moolenaar wrote:
> >
> > > On Sat, May 04, 2019 at 05:35:06PM +0200, Bram Moolenaar wrote:
> > > >
> > > > Patch 8.1.1267
> > > > Problem: Cannot check if GPM mouse support is working.
> > > > Solution: Add the "mouse_gpm_enable" feature.
> > > > Files: src/evalfunc.c, src/os_unix.c, src/proto/os_unix.pro,
> > > > runtime/doc/eval.txt
> > >
> > > This patch breaks "set mouse=a" in tmux for me.
> >
> > That is not possible. Perhaps it was an earlier patch?
>
> git bisect finds this. However I tried again and it finds 1265. Perhaps
> I need to clean the workspace between each run. So I tried again and it
> finds 1265 again. And reverting that patch (including 1-1264, 1266-1312)
> the issue is gone.
>
> Also I notice that 'set ttymouse=xterm' restores mouse support, although
> it was already xterm.

Strange. So, what is broken, how to reproduce? Start with "vim
--clean".

--
An SQL statement walks into a bar. He approaches two tables
and says, "Mind if I join you?"

lilydjwg

unread,
May 11, 2019, 6:06:00 AM5/11/19
to Bram Moolenaar, vim...@googlegroups.com
On Fri, May 10, 2019 at 09:57:09PM +0200, Bram Moolenaar wrote:
> > git bisect finds this. However I tried again and it finds 1265. Perhaps
> > I need to clean the workspace between each run. So I tried again and it
> > finds 1265 again. And reverting that patch (including 1-1264, 1266-1312)
> > the issue is gone.
> >
> > Also I notice that 'set ttymouse=xterm' restores mouse support, although
> > it was already xterm.
>
> Strange. So, what is broken, how to reproduce? Start with "vim
> --clean".

That's simple:

1. be inside tmux
2. vim --clean -c 'set mouse=a'

The mouse support is not enabled.

3. :set ttymouse=xterm

The mouse support is now enabled.

tmux 2.9a running inside gnome-terminal 3.32.2 on Arch Linux.

This is my vim --version:

VIM - Vi IMproved 8.1 (2018 May 18, compiled May 7 2019 19:54:58)
Included patches: 1-1290
Huge version with GTK3 GUI. Features included (+) or not (-):
+acl +extra_search +mouse_netterm -tag_old_static
+arabic -farsi +mouse_sgr -tag_any_white
+autocmd +file_in_path -mouse_sysmouse -tcl
+autochdir +find_in_path +mouse_urxvt +termguicolors
-autoservername +float +mouse_xterm +terminal
+balloon_eval +folding +multi_byte +terminfo
+balloon_eval_term -footer +multi_lang +termresponse
+browse +fork() -mzscheme +textobjects
++builtin_terms +gettext +netbeans_intg +textprop
+byte_offset -hangul_input +num64 +timers
+channel +iconv +packages +title
+cindent +insert_expand +path_extra +toolbar
+clientserver +job +perl/dyn +user_commands
+clipboard +jumplist +persistent_undo +vartabs
+cmdline_compl +keymap +postscript +vertsplit
+cmdline_hist +lambda +printer +virtualedit
+cmdline_info +langmap +profile +visual
+comments +libcall +python/dyn +visualextra
+conceal +linebreak +python3/dyn +viminfo
+cryptv +lispindent +quickfix +vreplace
+cscope +listcmds +reltime +wildignore
+cursorbind +localmap +rightleft +wildmenu
+cursorshape +lua/dyn +ruby/dyn +windows
+dialog_con_gui +menu +scrollbind +writebackup
+diff +mksession +signs +X11
+digraphs +modify_fname +smartindent -xfontset
+dnd +mouse +startuptime +xim
-ebcdic +mouseshape +statusline -xpm
+emacs_tags +mouse_dec -sun_workshop +xsmp_interact
+eval +mouse_gpm +syntax +xterm_clipboard
+ex_extra -mouse_jsbterm +tag_binary -xterm_save
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
system gvimrc file: "$VIM/gvimrc"
user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
defaults file: "$VIMRUNTIME/defaults.vim"
system menu file: "$VIMRUNTIME/menu.vim"
fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/lib/libffi-3.2.1/include -I/usr/include/fribidi -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/uuid -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/gio-unix-2.0 -I/usr/include/libdrm -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -pthread -D_FORTIFY_SOURCE=2 -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -L. -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.28/core_perl/CORE -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -L/usr/local/lib -Wl,--as-needed -o vim -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lSM -lICE -lXt -lX11 -lXdmcp -lSM -lICE -lm -ltinfo -lelf -lnsl -lacl -lattr -lgpm -ldl -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.28/core_perl/CORE -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -fstack-protector-strong -L/usr/local/lib -L/usr/lib/perl5/5.28/core_perl/CORE -lperl -lpthread -ldl -lm -lcrypt -lutil -lc

--
Best regards,
lilydjwg

Bram Moolenaar

unread,
May 11, 2019, 7:10:14 AM5/11/19
to vim...@googlegroups.com, lilydjwg
I'm using the same mouse features, and for me it does not happen.
What is $TERM set to? It should be "screen" or "tmux".

--
The most powerful force in the universe is gossip.

lilydjwg

unread,
May 11, 2019, 10:15:05 AM5/11/19
to vim...@googlegroups.com
weird. It's tmux-256color.

The following patch will fix the issue:

diff --git a/src/os_unix.c b/src/os_unix.c
index a6d1a12d1..d656e298f 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -3817,10 +3817,7 @@ check_mouse_termcode(void)
&& !gui.in_use
# endif
)
- set_mouse_termcode(KS_GPM_MOUSE,
- (char_u *)IF_EB("\033MG", ESC_STR "MG"));
- else
- del_mouse_termcode(KS_GPM_MOUSE);
+ set_mouse_termcode(KS_MOUSE, (char_u *)IF_EB("\033MG", ESC_STR "MG"));
# endif

# ifdef FEAT_SYSMOUSE

--
Best regards,
lilydjwg

Bram Moolenaar

unread,
May 11, 2019, 3:39:32 PM5/11/19
to vim...@googlegroups.com, lilydjwg

> On Sat, May 11, 2019 at 01:10:04PM +0200, Bram Moolenaar wrote:
> >
> > > On Fri, May 10, 2019 at 09:57:09PM +0200, Bram Moolenaar wrote:
> > > > > git bisect finds this. However I tried again and it finds 1265. Perhaps
> > > > > I need to clean the workspace between each run. So I tried again and it
> > > > > finds 1265 again. And reverting that patch (including 1-1264, 1266-1312)
> > > > > the issue is gone.
> > > > >
> > > > > Also I notice that 'set ttymouse=xterm' restores mouse support, although
> > > > > it was already xterm.
> > > >
> > > > Strange. So, what is broken, how to reproduce? Start with "vim
> > > > --clean".
> > >
> > > That's simple:
> > >
> > > 1. be inside tmux
> > > 2. vim --clean -c 'set mouse=a'
> > >
> > > The mouse support is not enabled.
> > >
> > > 3. :set ttymouse=xterm
> > >
> > > The mouse support is now enabled.
> > >
> > > tmux 2.9a running inside gnome-terminal 3.32.2 on Arch Linux.
> > >
> > > This is my vim --version:
> > >
> > > VIM - Vi IMproved 8.1 (2018 May 18, compiled May 7 2019 19:54:58)
> > > Included patches: 1-1290

[...]

> > I'm using the same mouse features, and for me it does not happen.
> > What is $TERM set to? It should be "screen" or "tmux".
>
> weird. It's tmux-256color.
>
> The following patch will fix the issue:
>
> diff --git a/src/os_unix.c b/src/os_unix.c
> index a6d1a12d1..d656e298f 100644
> --- a/src/os_unix.c
> +++ b/src/os_unix.c
> @@ -3817,10 +3817,7 @@ check_mouse_termcode(void)
> && !gui.in_use
> # endif
> )
> - set_mouse_termcode(KS_GPM_MOUSE,
> - (char_u *)IF_EB("\033MG", ESC_STR "MG"));
> - else
> - del_mouse_termcode(KS_GPM_MOUSE);
> + set_mouse_termcode(KS_MOUSE, (char_u *)IF_EB("\033MG", ESC_STR "MG"));
> # endif
>
> # ifdef FEAT_SYSMOUSE

Thanks for the hint. I think the actual fix is inside
set_mouse_termcode() and del_mouse_termcode(). Please try again after
the next patch.

--
The problem with political jokes is that they get elected.

lilydjwg

unread,
May 13, 2019, 1:38:52 AM5/13/19
to Bram Moolenaar, vim...@googlegroups.com
> > [...]
>
> Thanks for the hint. I think the actual fix is inside
> set_mouse_termcode() and del_mouse_termcode(). Please try again after
> the next patch.

It's fixed, thanks!

--
Best regards,
lilydjwg
Reply all
Reply to author
Forward
0 new messages