About mouse selection in a cmd console

Andy Koppe andy.koppe@gmail.com
Wed Aug 4 18:46:00 GMT 2010


On 2 August 2010 12:05, JOHNER Jean 066030 wrote:
> Note that, when 'Quick Edit' is not checked, right
> click to access to "Mark" is not enabled when you launch Cygwin.bat
> (why?).

Because Cygwin's console driver sets the ENABLE_MOUSE_INPUT flag on
the console (using SetConsoleMode(), see also
http://msdn.microsoft.com/en-us/library/ms686033.aspx).

This flag ensures that mouse events, including right clicks, are
placed into the console input buffer rather than triggering window
actions. That's in case an application activates xterm-style mouse
reporting. Yep, the Cygwin console driver does indded support that,
but vim doesn't know that, so you need to tell it via .vimrc:

set mouse=a
set ttymouse=xterm2


> 3/ Launch Cygwin.bat in a 'Quick Edit' cmd console, put "set mouse=a" in
> .vimrc then type vi file1.
> Result: file1 is opened. When you click somewhere in the file, the vim
> cursor is NOT moved. In the same way, you cannot select a word to delete
> it nor select a range of lines to do some specific operation. That is
> the reason why I wrote that mouse selection does not work in a bash cmd
> console.

Apparently quick edit mode overrides mouse input mode, so the console
driver never gets to see those mouse events.


> 4/ If you have Window vim installed (in C:\Program
> Files\vim\vim72\vim.exe) and launch a cmd console (without launching
> Cygwin.bat), using vim file1 opens file1. Clicking somewhere DOES move
> the vim cursor.

With quick edit mode enabled? It might be (temporarily) disabling that.

Andy

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list