hvesalai / emacs-sbt-mode

An emacs mode for interacting with scala sbt and projects
GNU General Public License v3.0
126 stars 38 forks source link

How to allow stdin prompts when running an app with runMain? #168

Closed ldeck closed 2 years ago

ldeck commented 2 years ago

If I run sbt via a standard terminal and runMain my.MainObject I can provide stdin if prompted. Doing the same in emacs with sbt-start, once running the app as above the buffer is seemingly read-only. How do you provide input?

hvesalai commented 2 years ago

sbt-mode uses comint for terminal interaction. Comint puts the terminal to read-only when not on a line that has a prompt.

Read about it here: https://www.gnu.org/software/emacs/manual/html_node/emacs/Shell-Prompts.html

So you have some options:

ldeck commented 2 years ago

Thanks @hvesalai for the hints. sbt-clear certainly works, though I wonder: is there also a function to merely clear the read-only status without clearing the buffer?

Setting comint-use-prompt-regexp to nil from t doesn't appear to help, not clearing the regex itself.