Skip to main content
Deno 2 is finally here ๐ŸŽ‰๏ธ
Learn more
Module

x/denops_std/option/vim/mod.ts>ttymouse

๐Ÿ“š Standard module for denops.vim
Latest
variable ttymouse
import { ttymouse } from "https://deno.land/x/denops_std@v6.5.1/option/vim/mod.ts";

Name of the terminal type for which mouse codes are to be recognized. Currently these strings are valid:

xterm xterm-like mouse handling. The mouse generates "<Esc>[Mscr", where "scr" is three bytes: "s" = button state "c" = column plus 33 "r" = row plus 33 This only works up to 223 columns! See "dec", "urxvt", and "sgr" for solutions. xterm2 Works like "xterm", but with the xterm reporting the mouse position while the mouse is dragged. This works much faster and more precise. Your xterm must at least at patchlevel 88 / XFree 3.3.3 for this to work. See below for how Vim detects this automatically.

netterm NetTerm mouse handling. A left mouse click generates "<Esc>}r,c<CR>", where "r,c" are two decimal numbers for the row and column. No other mouse events are supported.

dec DEC terminal mouse handling. The mouse generates a rather complex sequence, starting with "<Esc>[". This is also available for an Xterm, if it was configured with "--enable-dec-locator".

jsbterm JSB term mouse handling.

pterm QNX pterm mouse handling.

urxvt Mouse handling for the urxvt (rxvt-unicode) terminal. The mouse works only if the terminal supports this encoding style, but it does not have 223 columns limit unlike "xterm" or "xterm2".

sgr Mouse handling for the terminal that emits SGR-styled mouse reporting. The mouse works even in columns beyond 223. This option is backward compatible with "xterm2" because it can also decode "xterm2" style mouse codes.

The mouse handling must be enabled at compile time +mouse_xterm +mouse_dec +mouse_netterm +mouse_jsbterm +mouse_urxvt +mouse_sgr. Only "xterm"(2) is really recognized. NetTerm mouse codes are always recognized, if enabled at compile time. DEC terminal mouse codes are recognized if enabled at compile time, and 'ttymouse' is not "xterm", "xterm2", "urxvt" or "sgr" (because dec mouse codes conflict with them). This option is automatically set to "xterm", when the 'term' option is set to a name that starts with "xterm", "mlterm", "screen", "tmux", "st" (full match only), "st-" or "stterm", and 'ttymouse' is not set already. If the terminfo/termcap entry "XM" exists and the first number is "1006" then 'ttymouse' will be set to "sgr". This works for many modern terminals. Additionally, if vim is compiled with the +termresponse feature and t_RV is set to the escape sequence to request the xterm version number, more intelligent detection is done. The "xterm2" value will be set if the xterm version is reported to be from 95 to 276. The "sgr" value will be set if Vim detects Mac Terminal.app, iTerm2 or mintty, and when the xterm version is 277 or higher. If you do not want 'ttymouse' to be set to "xterm2" or "sgr" automatically, set t_RV to an empty string:

:set t_RV=

(default depends on 'term')

only in Unix and VMS, doesn't work in the GUI; not available when compiled without +mouse