Skip to content

Conversation

eatkins
Copy link
Contributor

@eatkins eatkins commented Oct 6, 2020

Fixes #5936

There were a few issues with line reading with jEdit. One was the console prompt was not displayed because the console prompt was disabled when System.console == null. The other was that we in some cases did not read any input from System.in when System.console == null. To fix the latter, I needed to add some explicit handling for dumb terminals. After these changes, the sbt shell worked fine in the jEdit console on my computer.

A user reported that no prompt was displayed when they used sbt from the
jEdit console. The reason no prompt was displayed was because
System.console was null which caused the ConsoleChannel to be
initialized with its prompt set to NoPrompt. I don't remember why it was
doing this but this bug seems worse than whatever it was trying to
address.
On my computer with jEdit, input is not read because the console input
stream was overridden to be a blocking input stream that never returned
input. While debugging the server test hangs, I added some logic to
prevent us from trying to read from System.in when System.console ==
null but I now realize that was a mistake because of situations like
ides or editors launching an sbt shell.
@eed3si9n eed3si9n merged commit 42e8c93 into sbt:develop Oct 6, 2020
@eatkins eatkins deleted the no-prompt branch October 8, 2020 02:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sbt 1.4.0: prompt is missing in the jEdit console on ubuntu
2 participants