public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* mintty mouse behavior with vim
@ 2023-05-11 15:24 Jose Isaias Cabrera
  2023-05-11 18:23 ` Brian Inglis
  2023-05-12  2:16 ` mintty " Duncan Roe
  0 siblings, 2 replies; 14+ messages in thread
From: Jose Isaias Cabrera @ 2023-05-11 15:24 UTC (permalink / raw)
  To: Jim Garrison via Cygwin

[-- Attachment #1: Type: text/plain, Size: 667 bytes --]


Greetings.

In mintty, while using vim, I would like to highlight a few lines, and have vim tell me how many lines have been highlighted. Is this a possibility? For example:

0
1
->2
->3
->4
->5
6
7
8
9

If I highlight lines 2 through 5, I would like vim to tell me that 4 lines have been highlighted. It works fine with the windows vim, but it does not want to do it through mintty. Thoughts? Thanks.

José

PS: The real problem is that I am ssh'ing to an ubuntu box which I am using vim, but the mouse is not being acknowledged. Although, I can highlight and copy/paste, but clicking to a word to move the cursor there, it's not acknowledged.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: mintty mouse behavior with vim
  2023-05-11 15:24 mintty mouse behavior with vim Jose Isaias Cabrera
@ 2023-05-11 18:23 ` Brian Inglis
  2023-05-11 18:44   ` Jose Isaias Cabrera
  2023-05-12  2:16 ` mintty " Duncan Roe
  1 sibling, 1 reply; 14+ messages in thread
From: Brian Inglis @ 2023-05-11 18:23 UTC (permalink / raw)
  To: cygwin; +Cc: Jose Isaias Cabrera, Jim Garrison via Cygwin

On 2023-05-11 09:24, Jose Isaias Cabrera via Cygwin wrote:
> In mintty, while using vim, I would like to highlight a few lines, and have vim tell me how many lines have been highlighted. Is this a possibility? For example:
> 
> 0
> 1
> ->2
> ->3
> ->4
> ->5
> 6
> 7
> 8
> 9
> 
> If I highlight lines 2 through 5, I would like vim to tell me that 4 lines have been highlighted. It works fine with the windows vim, but it does not want to do it through mintty. Thoughts? Thanks.
> 
> José
> 
> PS: The real problem is that I am ssh'ing to an ubuntu box which I am using vim, but the mouse is not being acknowledged. Although, I can highlight and copy/paste, but clicking to a word to move the cursor there, it's not acknowledged.

If I select columns or lines in vim, then the statusline at the bottom of the 
window shows the number of columns or lines selected before the cursor line and 
column numbers and percentage thru the file, or the modeline if multiple windows 
are visible e.g.

-- SELECT --				4	7,2		All
or
-- SELECT --						4

-- 
Take care. Thanks, Brian Inglis              Calgary, Alberta, Canada

La perfection est atteinte                   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retirer     but when there is no more to cut
                                 -- Antoine de Saint-Exupéry

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: mintty mouse behavior with vim
  2023-05-11 18:23 ` Brian Inglis
@ 2023-05-11 18:44   ` Jose Isaias Cabrera
  2023-05-11 21:25     ` Gary Johnson
  2023-05-12 16:38     ` Brian Inglis
  0 siblings, 2 replies; 14+ messages in thread
From: Jose Isaias Cabrera @ 2023-05-11 18:44 UTC (permalink / raw)
  To: cygwin


On May 11, 2023 2:24 PM, Brian Inglis  expressed:

> If I select columns or lines in vim, then the statusline at the bottom of the window
> shows the number of columns or lines selected before the cursor line and column
> numbers and percentage thru the file, or the modeline if multiple windows are
> visible e.g.
> 
> -- SELECT --				4	7,2		All
> or
> -- SELECT --						4

That's the problem. It's not doing it for me on vim on the cygwin xterm, nor on a connection to an ubuntu server through cygwin mintty. I have gvim for windows, and that works perfectly. But, when I use the cygwin terminal, and an ssh'ed connection to ubuntu, the mouse does not work. I will try to see what are my .vimrc settings for Windows, cygwin and ubuntu and try to match it. I may need to join the vim email support. Thanks.

josé

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: mintty mouse behavior with vim
  2023-05-11 18:44   ` Jose Isaias Cabrera
@ 2023-05-11 21:25     ` Gary Johnson
  2023-05-12 16:38     ` Brian Inglis
  1 sibling, 0 replies; 14+ messages in thread
From: Gary Johnson @ 2023-05-11 21:25 UTC (permalink / raw)
  To: cygwin

On 2023-05-11, Jose Isaias Cabrera via Cygwin wrote:
> 
> On May 11, 2023 2:24 PM, Brian Inglis  expressed:
> 
> > If I select columns or lines in vim, then the statusline at the
> > bottom of the window shows the number of columns or lines
> > selected before the cursor line and column numbers and
> > percentage thru the file, or the modeline if multiple windows
> > are visible e.g.
> > 
> > -- SELECT --				4	7,2		All
> > or
> > -- SELECT --						4
> 
> That's the problem. It's not doing it for me on vim on the cygwin
> xterm, nor on a connection to an ubuntu server through cygwin
> mintty. I have gvim for windows, and that works perfectly. But,
> when I use the cygwin terminal, and an ssh'ed connection to
> ubuntu, the mouse does not work. I will try to see what are my
> .vimrc settings for Windows, cygwin and ubuntu and try to match
> it. I may need to join the vim email support. Thanks.

It may be that the 'mouse' option is not set on your Ubuntu vim when
using ssh.  Try

    :set mouse=a

and see if that works.  If not, then check that the version of vim
on Ubuntu supports the mouse.  Execute

    :version

and check that it is not the tiny or small version and that +mouse
and not -mouse appears in the list of features.  I know that
Ubuntu's standard vim does not support X, but other than that,
I don't know what Ubuntu vim package supports what.  I always
install vim-gtk so I have everything.

Regards,
Gary


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: mintty mouse behavior with vim
  2023-05-11 15:24 mintty mouse behavior with vim Jose Isaias Cabrera
  2023-05-11 18:23 ` Brian Inglis
@ 2023-05-12  2:16 ` Duncan Roe
  2023-05-12  2:42   ` René Berber
  1 sibling, 1 reply; 14+ messages in thread
From: Duncan Roe @ 2023-05-12  2:16 UTC (permalink / raw)
  To: cygwin

On Thu, May 11, 2023 at 03:24:18PM +0000, cygwin wrote:
>
> Greetings.
>
> In mintty, while using vim, I would like to highlight a few lines, and
> have vim tell me how many lines have been highlighted. Is this a
> possibility? For example:
>
> 0
> 1
> ->2
> ->3
> ->4
> ->5
> 6
> 7
> 8
> 9
>
> If I highlight lines 2 through 5, I would like vim to tell me that 4
> lines have been highlighted. It works fine with the windows vim, but it
> does not want to do it through mintty. Thoughts? Thanks.
>
> José
>
> PS: The real problem is that I am ssh'ing to an ubuntu box which I am
> using vim, but the mouse is not being acknowledged. Although, I can
> highlight and copy/paste, but clicking to a word to move the cursor
> there, it's not acknowledged.
>
You expect too much of ssh. ssh is a text utility, not an X one. The remote vim
never sees your mouse actions: it's mintty that performs select / paste.

Cheers ... Duncan.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: mintty mouse behavior with vim
  2023-05-12  2:16 ` mintty " Duncan Roe
@ 2023-05-12  2:42   ` René Berber
  2023-05-12  3:04     ` Brian Inglis
  2023-05-12 14:02     ` [EXTERNAL] " Lavrentiev, Anton (NIH/NLM/NCBI) [C]
  0 siblings, 2 replies; 14+ messages in thread
From: René Berber @ 2023-05-12  2:42 UTC (permalink / raw)
  To: cygwin

On 5/11/2023 8:16 PM, Duncan Roe via Cygwin wrote:

> You expect too much of ssh. ssh is a text utility, not an X one. The remote vim
> never sees your mouse actions: it's mintty that performs select / paste.

Are you sure?

man ssh:

"     -X      Enables X11 forwarding.  This can also be specified on a 
per-host basis in a configuration file."
-- 
R.B.


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: mintty mouse behavior with vim
  2023-05-12  2:42   ` René Berber
@ 2023-05-12  3:04     ` Brian Inglis
  2023-05-12 14:02     ` [EXTERNAL] " Lavrentiev, Anton (NIH/NLM/NCBI) [C]
  1 sibling, 0 replies; 14+ messages in thread
From: Brian Inglis @ 2023-05-12  3:04 UTC (permalink / raw)
  To: cygwin; +Cc: René Berber

On 2023-05-11 20:42, René Berber via Cygwin wrote:
> On 5/11/2023 8:16 PM, Duncan Roe via Cygwin wrote:
>> You expect too much of ssh. ssh is a text utility, not an X one. The remote vim
>> never sees your mouse actions: it's mintty that performs select / paste.
> Are you sure?
> man ssh:
> "     -X      Enables X11 forwarding.  This can also be specified on a per-host 
> basis in a configuration file."

In recents decades it is more common to use:

	-Y	Enables trusted X11 forwarding. Trusted X11 forwardings are not
		subjected to the X11 SECURITY extension controls.

-- 
Take care. Thanks, Brian Inglis              Calgary, Alberta, Canada

La perfection est atteinte                   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retirer     but when there is no more to cut
                                 -- Antoine de Saint-Exupéry

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: [EXTERNAL] Re: mintty mouse behavior with vim
  2023-05-12  2:42   ` René Berber
  2023-05-12  3:04     ` Brian Inglis
@ 2023-05-12 14:02     ` Lavrentiev, Anton (NIH/NLM/NCBI) [C]
  1 sibling, 0 replies; 14+ messages in thread
From: Lavrentiev, Anton (NIH/NLM/NCBI) [C] @ 2023-05-12 14:02 UTC (permalink / raw)
  To: René Berber, cygwin

> > You expect too much of ssh. ssh is a text utility, not an X one. The remote vim
> > never sees your mouse actions: it's mintty that performs select / paste.
> 
> Are you sure?
> 
> man ssh:
> 
> "     -X      Enables X11 forwarding.  This can also be specified on a
> per-host basis in a configuration file."

X11 forwarding has nothing to do with mouse tracking on the Cygwin terminal window.
Rather, it's a tunnel for the X applications (running on the remote host) that
allows them to use a local X11 server (XFree86, XWin32, MobaXTerm etc),
which in turn can display the application's window on your PC's desktop
(such as an xterm window with the remote host's shell in it)

HTH,

Anton Lavrentiev
Contractor NIH/NLM/NCBI


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: mintty mouse behavior with vim
  2023-05-11 18:44   ` Jose Isaias Cabrera
  2023-05-11 21:25     ` Gary Johnson
@ 2023-05-12 16:38     ` Brian Inglis
  2023-05-12 22:22       ` Jose Isaias Cabrera
  1 sibling, 1 reply; 14+ messages in thread
From: Brian Inglis @ 2023-05-12 16:38 UTC (permalink / raw)
  To: cygwin; +Cc: Jose Isaias Cabrera

On 2023-05-11 12:44, Jose Isaias Cabrera via Cygwin wrote:
> 
> On May 11, 2023 2:24 PM, Brian Inglis  expressed:
> 
>> If I select columns or lines in vim, then the statusline at the bottom of the window
>> shows the number of columns or lines selected before the cursor line and column
>> numbers and percentage thru the file, or the modeline if multiple windows are
>> visible e.g.
>>
>> -- SELECT --				4	7,2		All
>> or
>> -- SELECT --						4
> 
> That's the problem. It's not doing it for me on vim on the cygwin xterm, nor on a connection to an ubuntu server through cygwin mintty. I have gvim for windows, and that works perfectly. But, when I use the cygwin terminal, and an ssh'ed connection to ubuntu, the mouse does not work. I will try to see what are my .vimrc settings for Windows, cygwin and ubuntu and try to match it. I may need to join the vim email support. Thanks.

If you're running Cygwin/X (installed xinit) you should install Cygwin gvim(/X) 
for local use and run gvim clients from remote systems on your X server e.g.

	$ ssh -f -Y ubuntu-remote gvim ...

I moved everything under VIM=$HOME/.vim with VIMRUNTIME=/usr/share/vim/vim82 and 
cygpath -w equivalent under Windows in the user environment with 
VIMRUNTIME='C:\Program Files\Vim\vim90', also hardlinks from $HOME to $VIM 
files, as I used Windows gvim under Cygwin before installing Cygwin/X and gvim, 
with EDITOR=vim and VISUAL='gvim -f', and still use Windows gvim on the desktop.

-- 
Take care. Thanks, Brian Inglis              Calgary, Alberta, Canada

La perfection est atteinte                   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retirer     but when there is no more to cut
                                 -- Antoine de Saint-Exupéry


^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: mintty mouse behavior with vim
  2023-05-12 16:38     ` Brian Inglis
@ 2023-05-12 22:22       ` Jose Isaias Cabrera
  2023-05-18 14:21         ` Jose Isaias Cabrera
  0 siblings, 1 reply; 14+ messages in thread
From: Jose Isaias Cabrera @ 2023-05-12 22:22 UTC (permalink / raw)
  To: cygwin


On May 12, 2023 12:39 PM, Brian Inglis  expressed:
> 
> If you're running Cygwin/X (installed xinit) you should install Cygwin gvim(/X) for local use and run gvim clients from remote systems on your X server e.g.
> 
> $ ssh -f -Y ubuntu-remote gvim ...
> 
WOW!! THANKS!!

I didn't know that one could do this.  Works exactly as I wanted. I appreciate it, Brian.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: mintty mouse behavior with vim
  2023-05-12 22:22       ` Jose Isaias Cabrera
@ 2023-05-18 14:21         ` Jose Isaias Cabrera
  2023-05-18 21:12           ` Brian Inglis
  0 siblings, 1 reply; 14+ messages in thread
From: Jose Isaias Cabrera @ 2023-05-18 14:21 UTC (permalink / raw)
  To: cygwin


Greetings!

On May 12, 2023 6:23 PM, Jose Isaias Cabrera expressed:
> 
> 
> On May 12, 2023 12:39 PM, Brian Inglis  expressed:
> >
> > If you're running Cygwin/X (installed xinit) you should install Cygwin gvim(/X) for local use and run gvim clients from remote systems on your X server e.g.
> >
> > $ ssh -f -Y ubuntu-remote gvim ...
> >
> WOW!! THANKS!!
> 
> I didn't know that one could do this.  Works exactly as I wanted. I appreciate it, Brian.

So, this is working great, with the exception that the cygwin xterm font display is so much sharper that the GVim display. It's the same .vimrc, but the difference is GVim is from running this command,

$ ssh -f -Y jic@web gvim w/default.website/Musicos.html

and the other that looks good is doing,

ssh jic@web
password:

$ vim w/default.website/Musicos.html

This latter displays so much clearer and colorful, while the GVim under X is ugly, dark and the font is not sharp. Any thoughts/suggestions/help would is appreciated. Thanks.

josé

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: mintty mouse behavior with vim
  2023-05-18 14:21         ` Jose Isaias Cabrera
@ 2023-05-18 21:12           ` Brian Inglis
  2023-05-18 22:11             ` Jose Isaias Cabrera
  0 siblings, 1 reply; 14+ messages in thread
From: Brian Inglis @ 2023-05-18 21:12 UTC (permalink / raw)
  To: cygwin; +Cc: Jose Isaias Cabrera

On 2023-05-18 08:21, Jose Isaias Cabrera via Cygwin wrote:
> On May 12, 2023 6:23 PM, Jose Isaias Cabrera expressed:
>> On May 12, 2023 12:39 PM, Brian Inglis  expressed:
>>> If you're running Cygwin/X (installed xinit) you should install Cygwin gvim(/X) for local use and run gvim clients from remote systems on your X server e.g.
>>> $ ssh -f -Y ubuntu-remote gvim ...

>> WOW!! THANKS!!
>> I didn't know that one could do this.  Works exactly as I wanted. I appreciate it, Brian.

> So, this is working great, with the exception that the cygwin xterm font 
> display is so much sharper that the GVim display. It's the same .vimrc, but
> the difference is GVim is from running this command,
> $ ssh -f -Y jic@web gvim w/default.website/Musicos.html

That will depend on the client installed on the remote host!
Get them to upgrade to gvim 9 as on Windows ;^>

> and the other that looks good is doing,
> ssh jic@web
> password:
> $ vim w/default.website/Musicos.html
> This latter displays so much clearer and colorful, while the GVim under X is 
> ugly, dark and the font is not sharp. Any thoughts/suggestions/help would is 
> appreciated. Thanks.

That is just running on the default remote terminal ...xterm... something.
Check what your ssh is running under, then specify that in your remote command, 
before your vim command.

-- 
Take care. Thanks, Brian Inglis              Calgary, Alberta, Canada

La perfection est atteinte                   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retirer     but when there is no more to cut
                                 -- Antoine de Saint-Exupéry


^ permalink raw reply	[flat|nested] 14+ messages in thread

* RE: mintty mouse behavior with vim
  2023-05-18 21:12           ` Brian Inglis
@ 2023-05-18 22:11             ` Jose Isaias Cabrera
  2023-05-19  7:53               ` Thomas Wolff
  0 siblings, 1 reply; 14+ messages in thread
From: Jose Isaias Cabrera @ 2023-05-18 22:11 UTC (permalink / raw)
  To: cygwin


On May 18, 2023 5:12 PM, Brian Inglis  expressed:
> 
> That will depend on the client installed on the remote host!
> Get them to upgrade to gvim 9 as on Windows ;^>

I don't think that will do anything. :-) 
This is the ubuntu version:
jic@web:~/w/default.website$ gvim --version
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Apr 18 2023 11:40:57)
Included patches: 1-3995, 4563, 4646, 4774, 4895, 4899, 4901, 4919
Modified by team+vim@tracker.debian.org
Compiled by team+vim@tracker.debian.org
Huge version with GTK3 GUI.  Features included (+) or not (-):

This is the cygwin version:
$ gvim --version
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Feb 13 2022 22:00:24)
Included patches: 1-4372
Modified by <cygwin@cygwin.com>
Compiled by <cygwin@cygwin.com>
Huge version with GTK3 GUI.  Features included (+) or not (-):

I think it's a font issue. The ubunty server just has the bare minimun for X. It's probably just defaulting to the lowest fonts resolution available.

 
> > and the other that looks good is doing, ssh jic@web
> > password:
> > $ vim w/default.website/Musicos.html
> > This latter displays so much clearer and colorful, while the GVim
> > under X is ugly, dark and the font is not sharp. Any
> > thoughts/suggestions/help would is appreciated. Thanks.
> 
> That is just running on the default remote terminal ...xterm... something.
> Check what your ssh is running under, then specify that in your remote command, before your vim command.

Hmmmmm... ok. Thanks.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: mouse behavior with vim
  2023-05-18 22:11             ` Jose Isaias Cabrera
@ 2023-05-19  7:53               ` Thomas Wolff
  0 siblings, 0 replies; 14+ messages in thread
From: Thomas Wolff @ 2023-05-19  7:53 UTC (permalink / raw)
  To: cygwin

[just removing mintty from the mail topic as it's quite obviously not 
related to it]

Am 19.05.2023 um 00:11 schrieb Jose Isaias Cabrera via Cygwin:
> On May 18, 2023 5:12 PM, Brian Inglis  expressed:
>> That will depend on the client installed on the remote host!
>> Get them to upgrade to gvim 9 as on Windows ;^>
> I don't think that will do anything. :-)
> This is the ubuntu version:
> jic@web:~/w/default.website$ gvim --version
> VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Apr 18 2023 11:40:57)
> Included patches: 1-3995, 4563, 4646, 4774, 4895, 4899, 4901, 4919
> Modified by team+vim@tracker.debian.org
> Compiled by team+vim@tracker.debian.org
> Huge version with GTK3 GUI.  Features included (+) or not (-):
>
> This is the cygwin version:
> $ gvim --version
> VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Feb 13 2022 22:00:24)
> Included patches: 1-4372
> Modified by <cygwin@cygwin.com>
> Compiled by <cygwin@cygwin.com>
> Huge version with GTK3 GUI.  Features included (+) or not (-):
>
> I think it's a font issue. The ubunty server just has the bare minimun for X. It's probably just defaulting to the lowest fonts resolution available.
>
>   
>>> and the other that looks good is doing, ssh jic@web
>>> password:
>>> $ vim w/default.website/Musicos.html
>>> This latter displays so much clearer and colorful, while the GVim
>>> under X is ugly, dark and the font is not sharp. Any
>>> thoughts/suggestions/help would is appreciated. Thanks.
>> That is just running on the default remote terminal ...xterm... something.
>> Check what your ssh is running under, then specify that in your remote command, before your vim command.
> Hmmmmm... ok. Thanks.
>


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2023-05-19  7:54 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-11 15:24 mintty mouse behavior with vim Jose Isaias Cabrera
2023-05-11 18:23 ` Brian Inglis
2023-05-11 18:44   ` Jose Isaias Cabrera
2023-05-11 21:25     ` Gary Johnson
2023-05-12 16:38     ` Brian Inglis
2023-05-12 22:22       ` Jose Isaias Cabrera
2023-05-18 14:21         ` Jose Isaias Cabrera
2023-05-18 21:12           ` Brian Inglis
2023-05-18 22:11             ` Jose Isaias Cabrera
2023-05-19  7:53               ` Thomas Wolff
2023-05-12  2:16 ` mintty " Duncan Roe
2023-05-12  2:42   ` René Berber
2023-05-12  3:04     ` Brian Inglis
2023-05-12 14:02     ` [EXTERNAL] " Lavrentiev, Anton (NIH/NLM/NCBI) [C]

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).