]> granicus.if.org Git - vim/commitdiff
patch 8.1.2226: cannot use system copy/paste in non-xterm terminals v8.1.2226
authorBram Moolenaar <Bram@vim.org>
Sun, 27 Oct 2019 17:50:25 +0000 (18:50 +0100)
committerBram Moolenaar <Bram@vim.org>
Sun, 27 Oct 2019 17:50:25 +0000 (18:50 +0100)
Problem:    Cannot use system copy/paste in non-xterm terminals.
Solution:   Instead of setting 'mouse' to "a" set it to "nvi" in defaults.vim.

runtime/defaults.vim
runtime/doc/options.txt
runtime/doc/term.txt
src/version.c

index 255b67b470ccea668ae1e279714df0f66823f8a6..e7929eacd451ff0c2e64794a5643b43d00cf1fe9 100644 (file)
@@ -75,8 +75,14 @@ inoremap <C-U> <C-G>u<C-U>
 
 " In many terminal emulators the mouse works just fine.  By enabling it you
 " can position the cursor, Visually select and scroll with the mouse.
+" Only xterm can grab the mouse events when using the shift key, for other
+" terminals use ":", select text and press Esc.
 if has('mouse')
-  set mouse=a
+  if &term =~ 'xterm'
+    set mouse=a
+  else
+    set mouse=nvi
+  endif
 endif
 
 " Switch syntax highlighting on when the terminal has colors or when using the
index 6e4ff1d6f51d36113f647a94df16733872ad5156..82cac9df12d91da9d96872c10286e132a33acc32 100644 (file)
@@ -5191,12 +5191,11 @@ A jump table for the options with a short description can be found at |Q_op|.
 
                                                *'mouse'* *E538*
 'mouse'                        string  (default "", "a" for GUI, MS-DOS and Win32,
-                                                set to "a" in |defaults.vim|)
+                                       set to "a" or "nvi" in |defaults.vim|)
                        global
-       Enable the use of the mouse.  Only works for certain terminals
-       (xterm, MS-DOS, Win32 |win32-mouse|, QNX pterm, *BSD console with
-       sysmouse and Linux console with gpm).  For using the mouse in the
-       GUI, see |gui-mouse|.
+       Enable the use of the mouse.  Works for most terminals (xterm, MS-DOS,
+       Win32 |win32-mouse|, QNX pterm, *BSD console with sysmouse and Linux
+       console with gpm).  For using the mouse in the GUI, see |gui-mouse|.
        The mouse can be enabled for different modes:
                n       Normal mode and Terminal modes
                v       Visual mode
@@ -5207,7 +5206,15 @@ A jump table for the options with a short description can be found at |Q_op|.
                r       for |hit-enter| and |more-prompt| prompt
        Normally you would enable the mouse in all five modes with: >
                :set mouse=a
-<      When the mouse is not enabled, the GUI will still use the mouse for
+<      If your terminal can't overrule the mouse events going to the
+       application, use: >
+               :set mouse=nvi
+<      The you can press ":", select text for the system, and press Esc to go
+       back to Vim using the mouse events.
+       In |defaults.vim| "nvi" is used if the 'term' option is not matching
+       "xterm".
+
+       When the mouse is not enabled, the GUI will still use the mouse for
        modeless selection.  This doesn't move the text cursor.
 
        See |mouse-using|.  Also see |'clipboard'|.
index 133d0e991b47037257e637e5dcfe1aab65d71f40..0a0f647781dbf8d8c34a85a028710185049b5d7f 100644 (file)
@@ -746,12 +746,21 @@ jump to tags).
 Whether the selection that is started with the mouse is in Visual mode or
 Select mode depends on whether "mouse" is included in the 'selectmode'
 option.
-
+                                                       *terminal-mouse*
 In an xterm, with the currently active mode included in the 'mouse' option,
 normal mouse clicks are used by Vim, mouse clicks with the shift or ctrl key
 pressed go to the xterm.  With the currently active mode not included in
 'mouse' all mouse clicks go to the xterm.
 
+For terminals where it is not possible to have the mouse events be used by the
+terminal itself by using a modifier, a workaround is to not use mouse events
+for Vim in command-line mode: >
+       :set mouse=nvi
+Then to select text with the terminal, use ":" to go to command-line mode,
+select and copy the text to the system, then press Esc.
+
+Another way is to temporarily use ":sh" to run a shell, copy the text, then
+exit the shell.  'mouse' can remain set to "a" then.
                                                        *xterm-clipboard*
 In the Athena and Motif GUI versions, when running in a terminal and there is
 access to the X-server (DISPLAY is set), the copy and paste will behave like
index 3f36958a692582b2e8fd151d627cf1ab74d40595..f5bc809acadb3c41b035ea46af8fb60173646225 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2226,
 /**/
     2225,
 /**/