-
-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow the console to contain "Error" (or even a backtrace) on startup #88
Comments
Hi! Thanks for the report, but I'd expect fixing this will require some major changes. We're looking for the string Its goal is to protect against looping infinitely when something goes wrong (see e.g. #9 (comment)). Most of the time, this approach works better than the obvious alternative (using timeouts). Even if we create a file upon successful launch, that would happen after the error backtrace is printed to the REPL. So either we don't wait and declare the command as failed, or wait for... some?.. amount of time to see The easiest workaround for you would be to launch the REPL and Robe server separately: first Going a bit more advanced route, we could try to process all the output coming from the REPL's startup first, before launching Robe, like: diff --git a/robe.el b/robe.el
index dbe84f8..ddf6da0 100644
--- a/robe.el
+++ b/robe.el
@@ -120,7 +120,10 @@ project."
(when (buffer-live-p ruby-buffer)
(kill-buffer ruby-buffer))
(inf-ruby-console-auto)
- (set-window-configuration conf))
+ (set-window-configuration conf)
+ (while (not (buffer-local-value 'comint-last-prompt
+ (get-buffer inf-ruby-buffer)))
+ (accept-process-output (inf-ruby-proc))))
(error "Aborted"))))
(when (not robe-running)
(let* ((proc (inf-ruby-proc)) The downside: if the REPL has a prompt that doesn't match |
Actually, I also tried to launch REPL and Robe separately, but it is very annoying. diff --git a/a/lib/robe.rb b/b/lib/robe.rb
index 8208e3d..a1e254f 100644
--- a/a/lib/robe.rb
+++ b/b/lib/robe.rb
@@ -6,7 +6,7 @@ module Robe
attr_accessor :server
def start(port = 0)
- return if @server
+ return "robe on #{@server.port}" if @server
@server = Server.new(Sash.new, port) Without this modification, emacs will hang forever when re-using ruby REPL created by previous |
Good idea, pushed. |
Robe checks the initialization of subprocess with text of subprocess'
stdout
. It checks the existence of word that ends with"Error"
. But some projects print initial message (before the robe starts), they can print the word"Error"
to thestdout
.For example,
In this case, the robe was started normally in ruby process, but emacs-side's robe thinks that it was not started well.
Using external file like
.robe-port
would be possible solutionThe text was updated successfully, but these errors were encountered: