reddit / emacs

Projectile interactive run mode.

MarcellM888 · 2022-09-11 12:32
Hello, I would like to ask for help about projectile and projectile-run-project command. When I run the command on a rust project it compiles the project and run it, but I cannot type into the window any text, because it's not interactive. I found a pull request on projectile's github page, but couldn't make it work. Can somebody might show me how to enable it? Projectile config in my init.el: (use-package projectile :ensure t :config (define-key projectile-mode-map (kbd "C-x p") 'projectile-command-map) (define-key projectile-mode-map (kbd "C-x C-r") 'projectile-ripgrep) (projectile-mode +1))
PriorOutcome · 2022-09-11 13:40
I'm guessing this: [https://github.com/bbatsov/projectile/pull/1672](https://github.com/bbatsov/projectile/pull/1672) is the PR you're referring to, if that's so, I think you just need `(setq projectile-run-use-comint-mode t)`, so: (use-package projectile :ensure t :config (define-key projectile-mode-map (kbd "C-x p") 'projectile-command-map) (define-key projectile-mode-map (kbd "C-x C-r") 'projectile-ripgrep) (projectile-mode +1) (setq projectile-run-use-comint-mode t))
MarcellM888 · 2022-09-11 13:45
Yeah, that's working, thanks! New to emacs, so didn't know that I had to use setq, thanks you!
PriorOutcome · 2022-09-11 14:09
No problem, happy I could help (:
deaddyfreddy · 2022-09-11 15:28
not related, but `use-package` has `:bind` keyword which you can use instead of `define-key`, it's less verbose and can help to avoid to `require` the library (of course, if there's no other stuff in `:config`) which is good for speeding up the startup.
MarcellM888 · 2022-09-11 15:29
I will try it out, thanks for the information! :)