#Jansi Help
1 messages · Page 1 of 1 (latest)
<@&987246399047479336> please have a look, thanks.
so first
just read this
jasni does two things
- Make ansii escape codes work on windows
- utilities for making strings that use ansii escape code
an ansii escape code is just like
if you do this
public class Main {
public static void main(String[] args) {
System.out.println("\u001b[1;31mHello, World");
}
}
it will print red
so its that magic incantation on the front
Are ansi escape codes universal across all OS's?
\u001b[1;31m
no
but the jasni library will replace System.out and System.err to make them work on windows
and to strip them out when you just cant
sick
Ansi mapAscii = ansi()
.eraseScreen();
so you can think of jansi's ansi type just like a string builder
just with special methods for adding ansi escape codes
like the one that tells your terminal to clear the screen
mapAscii
.fg(RED)
.a("*");
or the one that turns text red
jansi works on linux too?
yes
but it does replace System.out and System.err
which is certainly a choice
there is probably a way to use the library without doing that but i haven't dug
is there a way to use the ansi codes without using jansi? this is for a project, but i do plan to develop it further afterwards. i know for at least the project portion of it it will only be used on windows
yes
oh wait only on windows?
kinda no?
i mean maybe, but its easiest to use jasni to at least do the systemInstall call
ansi codes only work in non-windows terminals usually
jansi does magic to make it work on windows too
ok, i can look into it more, libraries are confusing to me for some reason lol
also completely unrelated, but i code on my laptop and play games on my pc, is there a way to also code on my pc without having a separate workspace than my laptop, so all my stuff can carry over? kind of annoying to have to sit at my desk with my pc by it and code with my laptop when my pc is right in front of me