Hi Bram,

> It works correctly for me, setting 'ttymouse' to "sgr" automatically.

Hmm, I checked this problem in Debian squeeze and OSX 10.7 environment.

My $HOME/.vimrc is here:
--
set nocompatible
set mouse=a
--

There are no statements any more.
The environment variable $TERM is "xterm".

I compared changeset 3884 (Patch 698) with 3885 (Patch 699), with configuring 
--with-features=huge.
The details of features are here:
+arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent 
+clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments 
+conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con_gui +diff 
+digraphs +dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi 
+file_in_path +find_in_path +float +folding -footer +fork() +gettext 
-hangul_input +iconv +insert_expand +jumplist +keymap +langmap +libcall 
+linebreak +lispindent +listcmds +localmap -lua +menu +mksession +modify_fname 
+mouse +mouseshape +mouse_dec -mouse_gpm -mouse_jsbterm +mouse_netterm 
+mouse_sgr -mouse_sysmouse +mouse_urxvt +mouse_xterm +multi_byte +multi_lang 
-mzscheme +netbeans_intg +path_extra -perl +persistent_undo +postscript 
+printer +profile -python -python3 +quickfix +reltime +rightleft -ruby 
+scrollbind +signs +smartindent -sniff +startuptime +statusline -sun_workshop 
+syntax +tag_binary +tag_old_static -tag_any_white -tcl +terminfo +termresponse
 +textobjects +title +toolbar +user_commands +vertsplit +virtualedit +visual 
+visualextra +viminfo +vreplace +wildignore +wildmenu +windows +writebackup 
+X11 -xfontset +xim +xsmp_interact +xterm_clipboard -xterm_save 

Yukihiro Nakadaira tested it in Ubuntu 12.10 xterm and gnome-terminal
He also checked Patch 698 and Patch 699.
He says, when He launch vim with "-u NONE -N" option, patch 698 sets 
ttymouse=sgr automatically, but patch 699 sets ttymouse=xterm.

Hirohito Higash tested in Fedora 16 and PuTTY.  $TERM is "xterm".
He checked Patch 698 and Patch 744.
He says, when He launch vim with "-N" option, patch 698 sets ttymouse=xterm2 
automatically, but patch 744 sets ttymouse=xterm.

> For a quick check you can comment out these lines in term.c:
> 
>       if (p != NULL)
>           set_option_value((char_u *)"ttym", 0L, p, 0);
> 
> If that works, then try:
> 
>       if (p != NULL && *p != NUL)
>           set_option_value((char_u *)"ttym", 0L, p, 0);

With commenting out these lines, automatic detection works well.

/*      if (p != NULL)
            set_option_value((char_u *)"ttym", 0L, p, 0); */

but It does not works.

        if (p != NULL && *p != NUL)
            set_option_value((char_u *)"ttym", 0L, p, 0);

I make sure "use_xterm_like_mouse" returns TRUE and "use_xterm_mouse" returns 0.
I think it is a matter of course because I do not set anything to ttymouse.
So the string value "xterm" is set to ttym_flags around there automatically, 
and this condition around term.c:4084 returns FALSE.

                         if (!option_was_set((char_u *)"ttym"))

Thanks.
---
Hayaki Saito
[email protected]

On 2012/12/03, at 1:08, Bram Moolenaar wrote:

> 
> Hayaki Saito wrote:
> 
>> By Patch 7.3.699, this line was added.
>> 
>>> +                   if (!option_was_set((char_u *)"ttym"))
>> 
>> With this condition clause, The ttymouse automatic detection behavior that 
>> had been detected as "xterm2", also seems to be changed.
>> In .vimrc, If we set mouse=a and don't set any value to "ttymouse", this 
>> change is found out.
>> In this case, former vim sets "xterm2" to ttymouse, but new one sets "xterm".
>> 
>> This change affects some terminal emulators that report Pv value(xterm 
>> version) in the specific range(that is more than 95, and less than 20000), 
>> ageinst DA2 query,
>> such as xterm, gnome-terminal, konsole, mlterm, iTerm2, tmux ... etc.
>> 
>> Is this the intended behavior?
> 
> It works correctly for me, setting 'ttymouse' to "sgr" automatically.
> Perhaps your combinations of features is different?  There is one other
> call to set 'ttymouse', if that somehow happens first then it won't be
> set again.  For a quick check you can comment out these lines in term.c:
> 
>       if (p != NULL)
>           set_option_value((char_u *)"ttym", 0L, p, 0);
> 
> If that works, then try:
> 
>       if (p != NULL && *p != NUL)
>           set_option_value((char_u *)"ttym", 0L, p, 0);
> 
> 
> -- 
>> From "know your smileys":
> %     Bike accident.  A bit far-fetched, I suppose; although...
>             o      _     _         _
>     _o     /\_   _ \\o  (_)\__/o  (_)
>   _< \_   _>(_) (_)/<_    \_| \   _|/' \/
>  (_)>(_) (_)        (_)   (_)    (_)'  _\o_
> 
> /// Bram Moolenaar -- [email protected] -- 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 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

Raspunde prin e-mail lui