Hyper: Copy/paste broken in Vim/Tmux + Text selection broken in tmux

Created on 4 Oct 2016  路  11Comments  路  Source: vercel/hyper

Clicking and dragging on text in tmux, such as a directory listing, does nothing.

Copy & paste also does nothing in tmux. I can paste all day long in a non-tmux pane but never in a tmux pane.

This is a show-stopper for me :sob:

_I'm on Ubuntu 14.04_

Most helpful comment

I'll add that this _used_ to work, but it is no longer working.

All 11 comments

I'll add that this _used_ to work, but it is no longer working.

I agree. I've used hyper/hyperterm daily for a couple of months now and it was basically a total replacement for iterm2 for me, but this is a showstopper. Tmux is an essential part of my workflow.

With the console open, whenever I move the mouse in tmux, I get hundreds of errors similar to the following:

bundle.js:34037 Uncaught InvalidStateError: Failed to execute 'collapseToEnd' on 'Selection': there is no selection.hterm.Terminal.onMouse_ @ bundle.js:34037

I've also noticed that I can no longer select a tmux pane with the mouse.

Ditto here - this used to work, but no longer works. Can't copy paste, and I can't navigate with the mouse to Tmux panes either.

  • I tried bringing the session active in iTerm2, and it works fine (paste and pane navigation).
  • go back to hyper.app, fails (nothing pasted)
  • try in hyper.app without tmux, paste works.

Note on a mac, I can manually paste by expanding a subshell $(pbpaste), but that's super cumbersome of course!

and FWIW, I'm on Mac OSX El Capitan

The breaking commit is a7595c1a45bf584c9baee490e6c3bffc04732183 (split-panes)

@ekmartin why did you add this code to lib/hterm.js? It's the culprit. Everything seems to work fine when I take it out.

// sine above we're no longer relying on `preventDefault`
// to avoid selections, we use css instead, so that
// focus is not lost, but selections are still not possible
// when the appropiate VT mode is set
hterm.VT.prototype.__defineSetter__('mouseReport', function (val) {
  this.mouseReport_ = val;
  const rowNodes = this.terminal.scrollPort_.rowNodes_;
  if (rowNodes) {
    if (val === this.MOUSE_REPORT_DISABLED) {
      rowNodes.style.webkitUserSelect = 'text';
    } else {
      rowNodes.style.webkitUserSelect = 'none';
    }
  }
});

hterm.VT.prototype.__defineGetter__('mouseReport', function () {
  return this.mouseReport_;
});

from here: https://github.com/zeit/hyper/blob/master/lib/hterm.js#L210-L228

:point_up_2: that's also the cause of #789

@flybayer: @rauchg implemented that to fix an issue where applications such as htop weren't getting focused correctly when clicked. Seems like we'll have to look for another work around though!

@ekmartin would it be ok to revert this for now? I think more people want to paste with tmux/vim than use htop :smile:

Yes, I agree that makes sense. Do you want to send a PR?

This has been fixed in 0.8.2.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

leo picture leo  路  3Comments

hxnt picture hxnt  路  3Comments

aem picture aem  路  3Comments

ConstantinChirila picture ConstantinChirila  路  3Comments

cooperpellaton picture cooperpellaton  路  3Comments