Closed jclosure closed 9 years ago
Does inf-ruby
work fine when not using Pry?
Does pry
work okay in M-x term
?
inf-ruby works fine with the defaults (irb). It's only with pry that it freezes.
To answer your question about M-x term, that doesn't work in Windows.
See these references on the topic:
https://lists.gnu.org/archive/html/bug-gnu-emacs/2008-03/msg00098.html
http://theanswerweb.com/data9/2015/07/24/bash-m-x-term-with-emacs-on-ms-windows-error-spawning-child-process-invalid-argument/
In win, we typically use: M-x shell or M-x eshell.
term and ansi-term are broken in Win.
use case context:
without (setq inf-ruby-default-implementation "pry") I do inf-ruby IRB prompt comes up. then I type puts "Hello" Hello is printed and returns to irb prompt
with (setq inf-ruby-default-implementation "pry") i do M-x inf-ruby Pry prompt comes up. then I type: puts "Hello" Hangs
Wonder why irb works but pry doesn't in inf-ruby. Interestingly, pry works fine from a plain cmd.exe session.
I have same issue, I'm using Arch Linux, and tried [M-x term]
+ pry
. It can work. and inf-ruby use ruby
implement works good. same issue, pry freezed. And when I toggle-debug-on-quit
, it shows nothing.
I reduced the repro setup to this:
Debugger entered--Lisp error: (quit) accept-process-output(#process ruby) comint-send-input() call-interactively(comint-send-input nil nil) command-execute(comint-send-input)
2.3.2? Where did you get that? Please try the code from this repo, directly or through MELPA.
I got 2.3.2 from Marmalade.
However, I also just tested the version in Melpa (inf-ruby-20150813.1848). It also exhibits same hanging behavior.
On Wed, Sep 23, 2015 at 10:18 PM, Dmitry Gutov notifications@github.com wrote:
2.3.2? Where did you get that? Please try the code from this repo, directly or through MELPA.
— Reply to this email directly or view it on GitHub https://github.com/nonsequitur/inf-ruby/issues/75#issuecomment-142793854 .
Ok, looks like a Readline issue with Pry + Emacs.
I got it working by putting this into my ~.pryrc:
class Emacsable def self.readline(prompt) print prompt (gets || '').chomp end end Pry.config.input = Emacsable
Now, when I run inf-ruby with pry, it no longer hangs and the repl behaves as expected.
I figured it might be related to Readline... however, what does trigger the freeze exactly? Is there no prompts after => ...
? Or the prompt is preceded with spaces? @stardiviner might be the best positioned to answer this: just try it in pry
under M-x term
.
@jclosure Have you tried installing rb-readline
instead? Like previous versions of Pry suggested: https://github.com/pry/pry/commit/c80c2031aa6bf27e5824d7b5f0b9ebd795b3c506
@dgutov here is what I get when I run pry
under M-x term
.
And another one is I run inf-ruby with pry
implement (without @jclosure's config).
And when I first time input puts "hello"
, then press [RET]
, no reponse, just move to next line, and I input puts "hello"
again, still no output.
@stardiviner I see, thank you. Alas, the M-x term
history looks normal, so it doesn't tell me much.
I've encountered the same error, and doing @jclosure solution fixed it. Could you consider adding this to the bottom of the README alongside the other bug fixes? took me two hours to figure out what the problem was (spent most of it thinking I just installed the dependencies wrong 😋😋😋). Anyways, thnx for resolving the issue.
That sounds like working around an actual bug (and one I don't fully understand).
Shouldn't someone file a bug report at an appropriate place first?
Using inf-ruby on Windows causes an immediate freeze.
Emacs Version: 24.5 (both) Ruby Version: ruby 2.2.2p95 (2015-04-13 revision 50295) [x64-mingw32]. Windows version installed with the Ruby installer from Ruby website. Also has DevKit installed.
I have pry set default as follows:
(require 'inf-ruby) (add-to-list 'inf-ruby-implementations' ("pry". "Pry")) (setq inf-ruby-default-implementation "pry")
Steps to reproduce:
Open Emacs (runemacs in mingw terminal or runemacs.exe from NTEmacs)
M-x, inf-ruby (In Pry) puts "Hello" Emacs should freeze here
Using toggle-debug-on-quit and pressing C-g after freezing produces the following trace:
Debugger entered--Lisp error: (quit) accept-process-output(#) comint-send-input()
(comint-send-input nil nil)
ad-Advice-call-interactively(# comint-send-input nil nil) apply(ad-Advice-call-interactively # (comint-send-input nil nil)) call-interactively(comint-send-input nil nil) command-execute(comint-send-input)
Using pry from cmd.exe works fine:
cmd.exe: pry [1] pry(main)> puts "Hi" Hi => nil