-
-
Notifications
You must be signed in to change notification settings - Fork 67
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
Weird behavior with Pry #136
Comments
It doesn't look like your regexp matches the actual prompt examples. Try it in Try this one: Or the shorter version: |
Ah yes indeed 🤦♂️ Thanks, I’m currently trying different things with Any idea about the echo back thingy? |
And still not working for the regex. I think I don’t get what characters and how it should be double escaped, it doesn’t make sense compared to what I’m used to (not lisp 😅). Sometimes it’s (by the way this one is working in |
As far as I can tell, either of the regexps I showed should match the prompt. If that still doesn't help, of course, we'll have to investigate further. About what to escape or not, Emacs regexps are based on the "basic" syntax. Here you can see some documentation: https://www.gnu.org/software/emacs/manual/html_node/elisp/Regexp-Backslash.html#Regexp-Backslash |
Copied/pasted your last regexp, tried others but the compilation buffer doesn’t switch automatically to ruby inf 😕 This is what I’m using now, tried to make it similar to the one in the wiki: (add-hook 'inf-ruby-mode-hook
(lambda() (let ((p "\\|\\(^[0-9]\\.[0-9]\\.[0-9] ?([^(]+):[0-9]+ ?> *\\)"))
(setq inf-ruby-first-prompt-pattern (concat inf-ruby-first-prompt-pattern p))
(setq inf-ruby-prompt-pattern (concat inf-ruby-prompt-pattern p))))) When I try with the standard pry prompt, it’s automatically detected though. And this isn’t resolving the problem of having the output a bit garbled. |
Which wiki? The extra grouping and alternation and the beginning don't seem to be useful, going by your examples.
That's too bad. But I can't reproduce the problem. Any chance you can post a sample project, with Gemfile.lock and a spec file which triggers this problem for you? |
For the wiki I was trying to follow this one: https://github.com/nonsequitur/inf-ruby/wiki/Adding-new-prompt-patterns Otherwise I did some tests and the problem with the commands being echoed (and having no completion) seems to be related to docker. Completely forgot to say that I’m working with containers, I just didn’t think it could mess up the completion buffer/inf-ruby as it doesn’t make a difference in neovim (using a terminal though that’s surely why). So I used an existing rails project and make the config similar to the one I’m working on. I managed to reduce the biggest annoyances by setting The project is available here: https://github.com/Flink/sample_rails_app I’ve included a I think that’s all 😅 And thanks again for your time! 😊 |
Do you think I will be able to repro without Spacemacs? 😰 |
I’m not sure since I haven’t a big experience with emacs but I’d say it should be possible 😅 The main thing I think is |
OK, I found the time to repro. Indeed, this happens. There are too many layers involved for me to quickly understand where this is coming from, but you can observe the difference in behavior by evaluating To counteract it on the side of Emacs instead, set |
@micdahl Have you seen this before, maybe? |
Hi again! 😬 Some very late investigation results:
(let ((p "[0-9]\\.[0-9]\\.[0-9] ?([^(]+):[0-9]+ ?"))
(setq inf-ruby-first-prompt-pattern (concat p ">"))
(setq inf-ruby-prompt-pattern (concat p "\\(*\\|>\\)"))) But it's not really a healthy solution, to ask everyone to fiddle with their regexps. First I would try to make them more "regular" in that project (does including the Ruby version help much?), but if this format is popular enough, we should look into updating our regexps here. |
With the above tweaks, both input history navigation and completion seem to work. The latter is pretty sluggish, though (EDIT: with the updated prompt regexps above -- not sluggish anymore). |
One more thing. Starting with Emacs 29, Tramp supports docker as one of the connection methods (and for earlier versions, there is a 3rd party package). Logging into an existing container and running the tests in there through Tramp takes care of the echoing as well (alternative solution for item number 2). |
This is done by commenting out the |
Hi!
I’m trying Spacemacs a second time, trying to use it instead of my neovim config and I have a hard time making things work as I want them regarding specs and
binding.pry
.First I found that I had to do
C-x C-q
in the compilation buffer to make it work withruby-inf
but then I have another problem:It seems characters are echoed back by the buffer/ruby-inf/whatever instead of being displayed normally. I have a custom Pry prompt but even when reverting it it still behaves in the same way.
By the way I tried to add a customization for my prompt but to no avail (documentation is a bit hard to follow on this 😅). I’ve put this in my
.spacemacs
config file but it doesn’t work (regex should be valid so it’s weird):Anyone able to help me with these please? 🙂
The text was updated successfully, but these errors were encountered: