!oXgwMHWllugcPDSKTb:matrix.org

sbt

2088 Members
Scala Build Tool5 Servers

Load older messages


SenderMessageTime
16 Mar 2022
Room Avatar Renderer.19:13:59
21 Mar 2022
@sethtisue:matrix.orgsethtisue!discord bridge 632150470000902164 92260005098987528219:07:42
@_discord_bot:t2bot.ioDiscord BridgeI'm asking permission from the guild administrators to make this bridge.19:07:43
@_discord_bot:t2bot.ioDiscord Bridge

I have bridged this room to your channel

19:07:53
@_discord_339308085824847874:t2bot.ioDiogo107 joined the room.19:53:44
@nrktkt:matrix.orgnrktkt left the room.19:56:45
@_discord_358047893724332032:t2bot.ioPatch22 joined the room.21:38:18
22 Mar 2022
@_discord_311748894436622346:t2bot.ioKeshi#0001 joined the room.00:09:01
@_discord_311748894436622346:t2bot.ioKeshi#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
@_discord_510415959480336393:t2bot.ioPotatoe<T + Hobby> joined the room.13:39:18
@_discord_922889943154577459:t2bot.ioJessicaifill joined the room.15:44:50
@_discord_936378159862022144:t2bot.ioMarissaHale-RethinkFirst joined the room.17:47:28
@_discord_234817270709223426:t2bot.ioaeroevan joined the room.22:34:07
23 Mar 2022
@_discord_709863130452459571:t2bot.ioAdam Reith joined the room.10:43:54
@_discord_277102251221450756:t2bot.ioFraignt joined the room.11:06:31
@_discord_711156823490691084:t2bot.iomartingd joined the room.12:45:32
@_discord_711156823490691084:t2bot.iomartingd 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
@_discord_711156823490691084:t2bot.iomartingd 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
@_discord_711156823490691084:t2bot.iomartingd 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
@_discord_711156823490691084:t2bot.iomartingd 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
@_discord_675539789826490368:t2bot.iochungonn joined the room.14:48:14
@_discord_933857105868357663:t2bot.ioraz joined the room.19:37:08
24 Mar 2022
@_discord_367462178703540225:t2bot.ioLucasEmanuel 73 joined the room.03:17:41
@_discord_915174501430468618:t2bot.iosimlei joined the room.10:13:41
@_discord_349350939766947853:t2bot.ioDan | ohkeycaps.com#6915 joined the room.16:07:34
@_discord_349350939766947853:t2bot.ioDan | 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
@_discord_583167330566275072:t2bot.ioSethTisue#7418 joined the room.16:10:39
@_discord_583167330566275072:t2bot.ioSethTisue#7418 yes. iirc they load in alphabetical order 16:10:39
@_discord_349350939766947853:t2bot.ioDan | 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
@_discord_349350939766947853:t2bot.ioDan | ohkeycaps.com#6915 Btw always appreciate your help ty 16:11:46

Show newer messages


Back to Room ListRoom Version: 9