Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with mouse mode in vim/tmux #95

Closed
tamagokun opened this issue Jul 15, 2016 · 28 comments
Closed

Compatibility with mouse mode in vim/tmux #95

tamagokun opened this issue Jul 15, 2016 · 28 comments
Labels
👀 Awaiting Response Issue or PR is awaiting a response from the author 🤯 Type: Compatibility Issue contains information about a compatibility issue in Hyper

Comments

@tamagokun
Copy link
Contributor

I'm thinking this is just a weird consequence of hterm, but I am experiencing some annoying scrolling behavior while inside of neovim.

Not sure if it matters, but I use a magic mouse which uses smooth scrolling.

  • Scrolling up to the very top is difficult. As soon as I remove my finger from the magic mouse, it tends to scroll back down a few lines.
  • Random insertion of characters. This one is really making it hard to use vim inside of hyperterm. If I am scrolling around in insert mode, sometimes characters will get randomly inserted in the buffer. I've seen ">" "e" and "%" so far.

I'm going to attempt to screen capture this and post to this issue.

@jwhitley
Copy link

I'm observing this same behavior in both neovim (recent HEAD build) and vim (8.0).

In fact, this exact same probem shows up with tmux if the mouse wheel is configured to browse the tmux backscroll history. My tmux scroll configuration is here.

In my replication, I'm also seeing something wierd: the tmux pane to the left of my test pane is running a gulp watcher task. Scrolling in tmux is an action isolated to the pane being scrolled. But when using Hyper, the left, non-scrolling gulp pane is getting character input during scrolling. See the 4's and forward slashes in the following screencap:

tmux

@nerdpad
Copy link

nerdpad commented Nov 2, 2016

Also happens to me when I try to select & drag the mouse. Here is a demonstration.

https://youtu.be/7t-ReyyhtJk

@tamagokun
Copy link
Contributor Author

Maybe mouse events are not 100% supported and Hyper is incorrectly interpreting them?

This is really the only thing preventing me from this app full time

@Fetz Fetz mentioned this issue Dec 12, 2016
2 tasks
@dotcypress
Copy link
Contributor

Fixed in #1111

@flybayer
Copy link
Contributor

This was fixed for me a month or more ago 👍

@ppot ppot closed this as completed Dec 17, 2016
@caesar
Copy link

caesar commented Dec 18, 2016

This is definitely not fixed for me in 1.0.0 (1.0.0.1303).
Or is that commit after the release of 1.0.0?

@ppot
Copy link
Contributor

ppot commented Dec 18, 2016

@caesar yes this will be in 1.0.1 releasing soon!

@caesar
Copy link

caesar commented Dec 18, 2016 via email

@tamagokun
Copy link
Contributor Author

Not fixed as of 1.0.1.

Screen capture of using neovim in Hyper 1.0.1 (no tmux). Trying to scroll while in INSERT mode.

kapture 2017-01-03 at 6 03 18

@ppot ppot reopened this Jan 3, 2017
@tamagokun
Copy link
Contributor Author

I wonder if this is related to #1291

Both seem to indicate that actions that should not insert characters in vim are actually inserting random characters.

@jwhitley
Copy link

jwhitley commented Jan 5, 2017

FWIW, this does appear fixed for me, in both normal and insert modes, using:

  • macOS: 10.12.2
  • Hyper.app: 1.0.1

and any of:

  • vim: 8.0
  • neovim: recent HEAD build at 29e6515
  • tmux in combination with either of the above

However, I do get a "bounce back" effect: scroll using a mac trackpad. The editor will stay on the final line for a moment, then snap down three lines. E.g. if I scroll to the top of the file, line 1 will be at the top of the window, then a moment later, line 4 will snap to the top. Yet this snap-down behavior can occur anywhere in the file. In limited testing, it is very highly repeatable for me, close to 100% in all the combinations listed above. I thought there might have been a separate issue for this problem, but I can't find it now.

For comparison, the bounce-back problem doesn't occur at all in iTerm2 3.0.13.

@tamagokun
Copy link
Contributor Author

@jwhitley I also see the bounce back with my magic mouse. This is because of "elastic scrolling" in the web view. Terminal windows normally don't have that.

As for my screen capture above, I can't reproduce it consistently, only occasionally, which makes it a pain to track down. I've found it happens more often if i'm using splits.

@flxsource
Copy link

I have the same problem (macOS 10.12.3, Hyper 1.1.0.1408) with insertion of character on mouse events (including scrolling and clicking). This only (and always) occurs within tmux. Interestingly, the click event only prints characters when I click on the right hand 3/4 of the screen...

@therealplato
Copy link

this is pretty painful! I observe this without tmux, including the behavior that clicks on the left side work and right side spams junk input.

macOS 10.12.3
Hyper 1.1.0.1408
vim 8.0.0094 installed through brew

@therealplato
Copy link

Still observing this with Hyper 1.3.0.1614 and vim 8.0.0344 and only this vim config (including mouse=a.)

Didn't realize till this bug how much my vim workflow relies on scrolling and mouse input, but it's irritating enough to make me give up on OSX hyper and go back to Terminal.

I'll come back when this gets fixed!

@justsee
Copy link

justsee commented Mar 20, 2017

Yes I've just tried Hyper Version 1.3.1 (1.3.1.1628) as a full-time terminal for a web project, and this is a showstopper in Vim NeoVim 0.1.7

My own brief experiments with the bug yielded similar weirdness as outlined above:

  • split a window into two panes : | Vim | shell |
  • start and stop scrolling in the shell pane
  • move the mouse focus to the vim pane
  • the machine gun of random text input begins firing at vim for as long as the usual scroll deceleration period would be

@therealplato
Copy link

therealplato commented Mar 20, 2017

@justsee well observed - i reproduced that junk input continues during scroll deceleration.

I also observed something i hadnt spotted before:

  • when my cursor is in the left pane, and i click the right pane, the cursor remains in the left pane, and junk input is sent to the left pane

edit - for anyone who looks at fixing this - even when scrolling worked in Hyper it was approximately 2-4x more sensitive than Terminal or xterm, i.e. the same finger movement scrolled lines 4x faster. this plus the "jumps back a few lines after scrolling to top" makes me wonder if the other terminals are getting a raw osx mouse input and hyper is getting signals modified by osx with i.e. deceleration and no-further-scroll stretch

@justsee
Copy link

justsee commented Mar 20, 2017

A workaround (for my workflow at least) is to simply disable the mouse in Vim's config:

set mouse=

Alternatively you could just disable it in insert mode: set mouse=nv, but I still noticed if you scroll/stop in one pane and move mouse focus over to the vim pane it manages to insert a limited number of characters occasionally. It's great to have git and vim undo as protection but I can't be dealing with random character entries when writing code.

I only really need the mouse to focus back on the vim pane when finishing scrolling in a side-by-side webview of the related next.js app, as the webview has focus and so key sequences to switch pane focus don't work.

It's not ideal, and there are other issues (performance, janky window resizing) but I'm giving Hyper a litte more time to explore how far away it is from a usable primary terminal for web work.

Having a side-by-side vim + webview (with no browser chrome) in a terminal is too delightful at the moment not to persist a bit longer.

@tamagokun
Copy link
Contributor Author

As @justsee has said, I can also confirm that this is directly related to using mouse mode in vim. Disabling it results in no problems.

@jkrup
Copy link

jkrup commented Mar 31, 2017

The same issue seems to happen in tmux with the same workaround solution (disabling mouse)

@chabou chabou changed the title Mouse scrolling weirdness inside vim (neovim) Compatibility with mouse mode in vim/tmux Apr 13, 2017
@chabou chabou added the 🤯 Type: Compatibility Issue contains information about a compatibility issue in Hyper label Apr 13, 2017
@apriendeau
Copy link

apriendeau commented May 5, 2017

So I think there is a larger issue here with tmux and mouse because I have a setting that works in terminal and iTerm that allow me to click on an open split pane which does not work in hyper.

I am on 1.3.1 and this maybe separate issue but the mouse reporting into tmux are failing for me.

@wmarbut
Copy link

wmarbut commented May 24, 2017

I can confirm with a very similar config to @jwhitley that the issue isn't fixed on HyperTerm 1.3.3

Scrolling is extremely twitchy
I cannot click on different panes with VIM/NeoVim; which does work inside of iterm2 and terminal

Mac OS 10.12.4 (16E195)
Hyper 1.3.3
NeoVim 0.1.6
Vim 8.0

@veryjos
Copy link

veryjos commented Jul 31, 2017

Same here, tmux with mouse works in iterm2 and not here. Same behavior of pressing a bunch of keys instead of scrolling. Selecting a pane with mouse also doesn't work.

@tamagokun
Copy link
Contributor Author

This appears to be fixed after upgrading to 2.0.0+ which introduced using xterm rather than hterm.

Scrolling is still super touchy/fast, but i've been using mouse mode in neovim for a few days now and have had 0 issues.

@caesar
Copy link

caesar commented Sep 29, 2017

Great! I had eventually switched back to iTerm2, but just gave Hyper 2.0 a try and haven't had any issues with the scrolling so far - apart from still being very sensitive/fast (clearly they are taking the pixel values returned by the mousewheel event and using them without dividing by a suitable factor to make them equivalent to line-based scrolling).

I have to say Hyper is still noticeably slower than iTerm – that's probably inevitable with all the overhead of a browser rendering engine – but at least this showstopper bug has been fixed by the change to xterm. Bravo!

@ntkoopman
Copy link

I still have a weird mouse issue in 2.0.4 in combination with vim. After you hold shift and select text in vim the mouse will start inserting characters when moved. This continuous until there is another vim mouse event.

recording

@chabou chabou added the 👀 Awaiting Response Issue or PR is awaiting a response from the author label Apr 16, 2018
@jbbudzon
Copy link

jbbudzon commented Mar 2, 2019

Any clues as to why scrolling is so twitchy but only inside vim/tmux? This is my last real mouse related issue with hyper I'm trying to track down.

@ppot
Copy link
Contributor

ppot commented Mar 2, 2019

@jbbudzon Frankly this is outdated we aren't on hterm anymore. I will close this issue. Feel free to open new one if relate to xterm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👀 Awaiting Response Issue or PR is awaiting a response from the author 🤯 Type: Compatibility Issue contains information about a compatibility issue in Hyper
Projects
None yet
Development

No branches or pull requests