New issue
Advanced search Search tips

Issue 890555 link

Starred by 5 users

Issue metadata

Status: Available
Owner: ----
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

hterm: selecting text across screens hits a crash: Uncaught TypeError: Cannot read property 'rowIndex' of null

Project Member Reported by vapier@chromium.org, Sep 29

Issue description

to reproduce:
- press Ctrl-Shift-k to clear the buffer & scrollback
- run `printf '%s\n' {1..300}`
- use the left mouse to select 280
- while holding left mouse, select the content above
- while holding left mouse, use middle mouse to scroll back
- stop when you get back to 100 and let go of the left mouse
- look at the console and see the traceback:

Uncaught TypeError: Cannot read property 'rowIndex' of null
    at hterm.Terminal.getSelectionText (nassh_deps.concat.js:15693)
    at hterm.Terminal.copySelectionToClipboard (nassh_deps.concat.js:15703)
    at hterm.Terminal.onMouse_ (nassh_deps.concat.js:15904)

nassh_deps.concat.js:15693:
hterm.Terminal.prototype.getSelectionText = function() {
  ...
  var rv = this.getRowsText(selection.startRow.rowIndex,           <-- 15693
                            selection.endRow.rowIndex + 1);
  return lib.wc.substring(rv, startOffset, lib.wc.strWidth(rv) - endOffset);

nassh_deps.concat.js:15703:
hterm.Terminal.prototype.copySelectionToClipboard = function() {
  var text = this.getSelectionText();                              <-- 15703
  if (text != null)
    this.copyStringToClipboard(text);
};

nassh_deps.concat.js:15904:
hterm.Terminal.prototype.onMouse_ = function(e) {
  ...
    if (e.type == 'mouseup' && e.button == 0 && this.copyOnSelect &&
        !this.document_.getSelection().isCollapsed) {
      this.copySelectionToClipboard(this.document_);               <-- 15904
    }
 
 Issue 888041  has been merged into this issue.

Sign in to add a comment