JunoLab / atom-ink

IDE toolkit for Atom
MIT License
228 stars 40 forks source link

Uncaught Error: Need to attach a pty before pasting. #169

Closed kbeckmann closed 5 years ago

kbeckmann commented 5 years ago

First of all sorry if this is a duplicate - didn't find anything obvious after a quick look on the open issues.

Steps to reproduce:

  1. Open the Julia REPL.
  2. Get Julia to terminate somehow (in my case because I didn't have the Atom package installed, but ctrl-d also works).
  3. Paste text in the Julia REPL when no command is running.
  4. Exception.

Additional info:

I had just installed Julia (v1.0, perhaps too new?), then Atom, then the uber-juno package. I pressed Enter in the Julia REPL, which failed and printed the following:

Starting Julia...
ERROR: LoadError: ArgumentError: Package Atom not found in current path:
- Run `Pkg.add("Atom")` to install the Atom package.

Stacktrace:
 [1] require(::Module, ::Symbol) at ./loading.jl:817
 [2] top-level scope at /Users/konradbeckmann/.atom/packages/julia-client/script/boot_repl.jl:13
 [3] include at ./boot.jl:317 [inlined]
 [4] include_relative(::Module, ::String) at ./loading.jl:1038
 [5] include(::Module, ::String) at ./sysimg.jl:29
 [6] exec_options(::Base.JLOptions) at ./client.jl:229
 [7] _start() at ./client.jl:421
in expression starting at /Users/konradbeckmann/.atom/packages/julia-client/script/boot_repl.jl:1

Julia has exited. Press Enter to start a new session.

So I copied Pkg.add("Atom") to my clipboard using cmd-C, then when I tried to paste it in the REPL I got the exception and stack trace. Note that I didn't press Enter to start a new session - this might be reason for to the bug since there is no active command running.

Atom: 1.29.0 x64 Electron: 2.0.5 OS: Mac OS X 10.13.6 Thrown From: ink package 0.9.2

Stack Trace

Uncaught Error: Need to attach a pty before pasting.

At /Users/konradbeckmann/.atom/packages/ink/lib/console2/console.js:194

Error: Need to attach a pty before pasting.
    at InkTerminal.paste (/packages/ink/lib/console2/console.js:194:13)
    at HTMLElement.inkTerminalPaste (/packages/ink/lib/console2/console.js:36:16)
    at CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:384:49)
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:621:22)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:412:28)
    at WindowEventHandler.handleDocumentKeyEvent (/Applications/Atom.app/Contents/Resources/app/src/window-event-handler.js:110:40)

Commands

     -3:04.8.0 window:increase-font-size (atom-pane.pane.active)
     -2:56.2.0 settings-view:open (atom-pane.pane.active)
     -1:18.8.0 editor:join-lines (atom-workspace.workspace.scrollbars-visible-when-scrolling.theme-one-dark-syntax.theme-one-dark-ui)
     -1:18.4.0 window:reset-font-size (atom-workspace.workspace.scrollbars-visible-when-scrolling.theme-one-dark-syntax.theme-one-dark-ui)
  4x -1:16.3.0 editor:join-lines (atom-workspace.workspace.scrollbars-visible-when-scrolling.theme-one-dark-syntax.theme-one-dark-ui)
     -0:29.2.0 julia-client:open-console (atom-pane.pane.active)
  7x -0:25.8.0 core:close (textarea.xterm-helper-textarea)
     -0:07.8.0 ink-terminal:copy (textarea.xterm-helper-textarea)
     -0:07.4.0 ink-terminal:paste (textarea.xterm-helper-textarea)

Non-Core Packages

indent-detective 0.2.2 
ink 0.9.2 
julia-client 0.7.1 
language-julia 0.16.0 
latex-completions 0.3.5 
tool-bar 1.1.7 
uber-juno 0.2.0 
pfitzseb commented 5 years ago

This should be fixed in the latest version. Let me know (and reopen this) if not.

AlbinaGiliazova commented 5 years ago

Hello! I have just installed JuliaPro 1.0.3.1 and I get this error when I try to paste a text into REPL window in Atom editor. In the REPL window it is written 'Press Enter to start Julia.' but it does not react to pressing Enter or other keys. [Windows 7 64 bit]

Uncaught Error: Need to attach a pty before pasting. C:\JuliaPro-1.0.3.1.atom\packages\ink\lib\console2\console.js:220 Hide Stack Trace Error: Need to attach a pty before pasting. at InkTerminal.paste (file:///C:/JuliaPro-1.0.3.1/.atom/packages/ink/lib/console2/console.js:220:13) at HTMLElement.inkTerminalPaste (file:///C:/JuliaPro-1.0.3.1/.atom/packages/ink/lib/console2/console.js:38:16) at CommandRegistry.handleCommandEvent (C:\JuliaPro-1.0.3.1\app-1.32.2\resources\app\static\:11:347327) at CommandRegistry.dispatch (C:\JuliaPro-1.0.3.1\app-1.32.2\resources\app\static\:11:345802) at AtomEnvironment.dispatchContextMenuCommand (C:\JuliaPro-1.0.3.1\app-1.32.2\resources\app\static\:1:652922) at EventEmitter.t (C:\JuliaPro-1.0.3.1\app-1.32.2\resources\app\static\:1:660389) at emitThree (events.js:136:13) at EventEmitter.emit (events.js:217:7) The error was thrown from the ink package. This issue has already been reported.

pfitzseb commented 5 years ago

You might very well be running into the same/a very similar problem as the OP, but I'm not too sure what Juno version is shipped with your JuliaPro version.

AlbinaGiliazova commented 5 years ago

I get the same error on another computer with JuliaPro 1.0.3.1 (Julia 1.1 was previously installed, then uninstalled, it didn't do difference).

I don't know where to find the version of Juno. Atom version is 1.32.2 ia32 (Electron 2.0.9, Chrome 61.0.3163.100, Node 8.9.3).

Actually I don't even know how to use Julia if I get errors at the very start. Also I get an error when pressing Interrupt Julia button (Ctrl+C):

Can't interrupt Julia without a Julia client running. Start Julia using Packages → Julia → Start Julia.

Starting Julia from Packages doesn't do anything.