16 Mar 2022 |
| Room Avatar Renderer. | 19:13:59 |
21 Mar 2022 |
sethtisue | !discord bridge 632150470000902164 922600050989875282 | 19:07:42 |
Discord Bridge | I'm asking permission from the guild administrators to make this bridge. | 19:07:43 |
Discord Bridge | I have bridged this room to your channel
| 19:07:53 |
| Diogo107 joined the room. | 19:53:44 |
| nrktkt left the room. | 19:56:45 |
| Patch22 joined the room. | 21:38:18 |
22 Mar 2022 |
| Keshi#0001 joined the room. | 00:09:01 |
Keshi#0001 | I just tried this: it starts up and runs and connects, and shows previous and ongoing stdout, but it doesn't seem to let me send any commands to the server so it is only functioning as an output viewer. Only interacting with the main instance does anything. Which is actually better than what my windows pc does, where the client mode sbt connects then immediately gives a bunch of errors and disconnects 😅 | 00:09:01 |
| Potatoe<T + Hobby> joined the room. | 13:39:18 |
| Jessicaifill joined the room. | 15:44:50 |
| MarissaHale-RethinkFirst joined the room. | 17:47:28 |
| aeroevan joined the room. | 22:34:07 |
23 Mar 2022 |
| Adam Reith joined the room. | 10:43:54 |
| Fraignt joined the room. | 11:06:31 |
| martingd joined the room. | 12:45:32 |
martingd | It is a known problem that when asking sbt to fork at run:
Compile / run / fork := true,
stdin is not connected to the running process so things like
val line = Console.in.readLine
doesn't work. This is easily fixed (as documented in the sbt docs) with:
run / connectInput := true,
However, using Java's Console does not work and this code causes a null pointer exception:
val password = System.console.readPassword
even with the above fix because System.console is null. Is there a way to fix that or a better way to read a password from Scala that works with sbt run ? | 12:45:33 |
martingd | Hmm, it seems like the problem is sbt does not connect stdin to the new process in a way so it is still a tty so the java.io.Console constructor returns. null :
public Console console() {
if (istty()) {
if (cons == null)
cons = new Console();
return cons;
}
return null;
} | 12:54:40 |
martingd | Here is the native code behind the native method istty() :
JNIEXPORT jboolean JNICALL
Java_java_io_Console_istty(JNIEnv *env, jclass cls)
{
return isatty(fileno(stdin)) && isatty(fileno(stdout));
}
So basically, System.console in Scala will be null if one of stdin or stdout (or both) are not connected to a terminal. | 13:03:25 |
martingd | So the problem is that sbt only connects stdin to the new forked process using Java's ProcessBuilder.redirectInput(Redirect.INHERIT) so stdout is not connected and thus java.io.Console will be null because both stdin and stdout must be a tty. Any workaround to that? | 13:10:42 |
| chungonn joined the room. | 14:48:14 |
| raz joined the room. | 19:37:08 |
24 Mar 2022 |
| LucasEmanuel 73 joined the room. | 03:17:41 |
| simlei joined the room. | 10:13:41 |
| Dan | ohkeycaps.com#6915 joined the room. | 16:07:34 |
Dan | ohkeycaps.com#6915 | If there are multiple .sbt files in the base directory, do they just get added together? I have a project with many sbt files, like one for gitlab, one for beanstalk, etc. | 16:07:34 |
| SethTisue#7418 joined the room. | 16:10:39 |
SethTisue#7418 | yes. iirc they load in alphabetical order | 16:10:39 |
Dan | ohkeycaps.com#6915 | SethTisue it's annoying (imo) to have them all in the base dir, how would I go about making another dir to put them all in, and making sure they all get used? | 16:11:25 |
Dan | ohkeycaps.com#6915 | Btw always appreciate your help ty | 16:11:46 |