M mbenam Member Sep 20, 2021 #1 Hi all, is there any library for creating colored text or GUI on the terminal or console similar to the Rich library in python? Any pointer on how to achieve this on windows would be appreciated as well. Thanks.
Hi all, is there any library for creating colored text or GUI on the terminal or console similar to the Rich library in python? Any pointer on how to achieve this on windows would be appreciated as well. Thanks.
Erel B4X founder Staff member Licensed User Longtime User Sep 20, 2021 #2 Currently there is no such library. Upvote 0
M mbenam Member Sep 20, 2021 #3 Thanks Erel. How would I add an ANSI escape sequence like this \x1b[1;31m in front of a string and then do a log statement. I believe this sets the output as bold red. \x1b is the Control key, 1 sets it as bold and 31 sets it as red. Thanks. Upvote 0
Thanks Erel. How would I add an ANSI escape sequence like this \x1b[1;31m in front of a string and then do a log statement. I believe this sets the output as bold red. \x1b is the Control key, 1 sets it as bold and 31 sets it as red. Thanks.
M mbenam Member Sep 21, 2021 #4 I figured it out. B4X: Copy Sub AppStart (Args() As String) 'Dim bc As ByteConverter Dim s As String s = Chr(27) & "[1;31m" Log(s & "Hello") End Sub Upvote 1
I figured it out. B4X: Copy Sub AppStart (Args() As String) 'Dim bc As ByteConverter Dim s As String s = Chr(27) & "[1;31m" Log(s & "Hello") End Sub
Gandalf Member Licensed User Longtime User Sep 22, 2021 #5 mbenam said: I figured it out. Click to expand... Just tried it - doesn't work on Win10, but works on Linux Mint 20. Did it work for you on Windows? Upvote 0
mbenam said: I figured it out. Click to expand... Just tried it - doesn't work on Win10, but works on Linux Mint 20. Did it work for you on Windows?
M mbenam Member Sep 22, 2021 #6 I tested in Gitbash on windows. You can try to install PowerShell 7. It has capability to emulate ANSI terminal. You can google for it. Involves changing registry setting. Without changing registry setting you can also try to run your file like this which may work. B4X: Copy java -jar myProgram.jar | Out-Host Upvote 0
I tested in Gitbash on windows. You can try to install PowerShell 7. It has capability to emulate ANSI terminal. You can google for it. Involves changing registry setting. Without changing registry setting you can also try to run your file like this which may work. B4X: Copy java -jar myProgram.jar | Out-Host