Skip to content

Uncaught TypeError: Cannot read property 'stopScrolling' of undefined #104

@calebmeyer

Description

@calebmeyer

Steps to Reproduce

  1. Add the following to your init.coffee:
atom.commands.add 'atom-text-editor',  
  'custom:run-rspec-for-line': (event) ->
    target = atom.views.getView(atom.workspace)
    atom.commands.dispatch(target, 'termination:new')
    atom.commands.dispatch(target, 'termination:insert-custom-text-1')
  1. Set custom text 1 in the settings to:
    rspec $D/$F:$L
  2. Call your new custom command (probably using the command palette, though I've tried both with the palette and a keybind)

Notes

I think I understand why this is. When I create the new terminal (via dispatching the new command), I don't wait for it to be done creating before I try to send text to it.

What I'd really like to do:

  • Have a way to create or reuse a terminal (probably toggle)
  • Then wait for the terminal to be available
  • Then paste in the text from one of the custom texts

One way to solve this would be to make the "insert custom text" commands create a new terminal if there isn't one available (maybe that could be a new option).

Atom: 1.41.0 x64
Electron: 4.2.7
OS: Mac OS X 10.15.1
Thrown From: termination package 0.7.6

Stack Trace

Uncaught TypeError: Cannot read property 'stopScrolling' of undefined

At /Users/cm022291/.dotfiles/atom/packages/termination/lib/view.coffee:479

TypeError: Cannot read property 'stopScrolling' of undefined
    at TerminationView.module.exports.TerminationView.insertSelection (/packages/termination/lib/view.coffee:479:17)
    at /packages/termination/lib/status-bar.coffee:64:72
    at StatusBar.module.exports.StatusBar.runInActiveView (/packages/termination/lib/status-bar.coffee:280:14)
    at /packages/termination/lib/status-bar.coffee:64:47)
    at CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:349392)
    at CommandRegistry.dispatch (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:347867)
    at HTMLElement.custom:run-rspec-for-line (/Users/cm022291/.dotfiles/atom/init.coffee:39:19)
    at CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:349392)
    at KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:1252536)
    at KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:1248670)
    at WindowEventHandler.handleDocumentKeyEvent (/Applications/Atom.app/Contents/Resources/app/static/<embedded>:11:284598)

Commands

     -3:47.4.0 line-ending-selector:convert-to-LF (atom-text-editor.editor.vim-mode-plus.normal-mode)
     -3:47.4.0 editor:fold-at-indent-level-2 (atom-text-editor.editor.vim-mode-plus.normal-mode)
     -3:47.4.0 line-ending-selector:convert-to-LF (atom-text-editor.editor.vim-mode-plus.normal-mode)
     -3:47.4.0 editor:fold-at-indent-level-2 (atom-text-editor.editor.vim-mode-plus.normal-mode)
     -3:31.9.0 custom:run-rspec-for-line (input.hidden-input)
     -3:31.9.0 termination:new (atom-workspace.workspace.scrollbars-visible-when-scrolling.theme-rainglow.theme-one-dark-ui)
     -3:31.9.0 termination:insert-custom-text-1 (atom-workspace.workspace.scrollbars-visible-when-scrolling.theme-rainglow.theme-one-dark-ui)
     -3:07.3.0 command-palette:toggle (input.hidden-input)
     -3:06.4.0 editor:consolidate-selections (input.hidden-input)
     -3:06.4.0 core:cancel (input.hidden-input)
     -3:05.5.0 custom:run-rspec-for-line (input.hidden-input)
     -3:05.5.0 termination:new (atom-workspace.workspace.scrollbars-visible-when-scrolling.theme-rainglow.theme-one-dark-ui)
     -3:05.5.0 termination:insert-custom-text-1 (atom-workspace.workspace.scrollbars-visible-when-scrolling.theme-rainglow.theme-one-dark-ui)

Non-Core Packages

advanced-open-file 0.16.8 
ariake-dark-syntax 0.2.1 
atom-panda-syntax 0.18.0 
auto-detect-indentation 1.3.0 
auto-update-plus 0.5.8 
busy-signal 2.0.1 
city-lights-syntax 1.1.8 
city-lights-ui 1.5.3 
css-declaration-sorter 1.2.3 
dark-one-dark-syntax 2.3.0 
duotone-dark-amethyst-syntax 2.0.4 
duotone-dark-earth-syntax 2.1.0 
duotone-dark-forest-syntax 2.1.0 
duotone-dark-sea-syntax 2.1.0 
duotone-snow 2.2.0 
file-icons 2.1.36 
gist-it 0.9.2 
git-blame 1.8.0 
git-links 0.3.3 
git-plus 8.7.1 
git-time-machine 2.1.0 
gradient-syntax-theme 0.2.0 
inline-git-diff 2.4.0 
intentions 1.1.5 
jumpy 5.0.2 
language-aspx 0.5.0 
language-csv 1.1.2 
language-diff 0.7.0 
language-docker 1.1.8 
language-fish-shell 1.1.0 
language-haml 0.32.1 
language-powershell 5.0.0 
language-rust 0.4.12 
linter 2.3.1 
linter-eslint 8.5.5 
linter-ui-default 1.8.0 
monokai 0.24.0 
nebula-syntax 0.4.5 
nebula-ui 0.9.3 
nord-atom-syntax 0.10.0 
nord-atom-ui 0.12.0 
northem-dark-atom-syntax 2.1.0 
process-palette 0.17.0 
pure-ui 1.0.4 
rainbow-csv 0.4.2 
rainglow 1.5.5 
react 0.18.0 
set-syntax 0.4.0 
spacemacs-dark-syntax 0.5.0 
split-diff 1.6.1 
status-bar-blame 2.0.3 
sync-settings 0.8.6 
termination 0.7.6 
vim-mode-plus 1.36.2 
vim-mode-plus-exchange 0.4.0 
vim-mode-plus-keymaps-for-surround 0.2.1 
Zen 0.18.0 

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions