Julia REPL -- Legacy Console Mode Issue - julia

I've had trouble using Julia in Windows Terminal for the last few releases because the ANSI escapes refuse to render properly unless I enable Legacy Console Mode which helps in CMD prompts, but not in Windows Terminal.
When launched in Terminal, it looks like this:
When launched with --color=no, it looks like this:
Which is marginally more useful, but both the inputs and outputs are muddled by the ANSI escapes, which makes the REPL effectively useless.
My workaround has been to enable the "Legacy Console" and use an alias to launch julia in a separate CMD-based window when I need REPL functionality, but this is disruptive.
I have tried various combinations of (multiple releases of) Windows Terminal (stable and dev), Powershell (stable and dev), and Legacy Console mode. There must be a configuration issue on my machine that I just can't nail down because no one else seems to have this issue.
What am I missing?

Can you file this over at https://github.com/microsoft/terminal/issues?
By all accounts, this should work. Seeing the literal escapes in the buffer like that makes me think that Julia isn't enabling ENABLE_VIRTUAL_TERMINAL_PROCESSING, which they would need for escape sequences to work. Though, if you're on a version of julia from 2021, I would presume that they're aware of that and would be setting that mode by now. (That flag was added in like, 2016)
Hopefully we can help diagnose more over at the Terminal repo ☺️

Related

Console on windows-subsystem-for-linux slow when entering text

I'm using the windows-subsystem-for-linux console. Recently it sometimes pauses when typing text, the typed text appears after a few seconds. In the past it worked fine.
I'm searching for what causes this and how I can fix it.
I thought it might be caused by the command completion in bash together with the environment from the Visual Studio Developer Command Prompt (see this question's history)
This seems not to be the case:
The delays happen without the environment from the Visual Studio Developer command prompt.
The delays also happen when I type an answer to a prompt from git add --patch.
Perhaps it is tmux (I'm using version 1.8) or byobu (version 5.74) in combination with the windows conconsole?
What causes this problem?
How can I make bash responsive again?

basic emacs commands not working preventing saving of files

I am operating in a linux environment (not familiar to me) and I am handling a bunch of files in django. Bit embarrassing but I seem to have done something subtle to the server that disallows me from setting up separate work stations from my terminal... i.e. emacs file.py & won't work for me; it just says that the emacs window is loading but it won't actually appear - I've waited 5 minutes.
It's not a big deal as emacs file.py works fine and I can "Reset terminal" once I'm done editing the file. However, saving the file could be a problem as the saving options are different between the "&" and "without &" versions of the command. It's such a basic thing that there seems to be no info on it online... any tips?
NOTE: it all started when I mistakenly typed emacs file.py and forgot the & and now something seems to be irreversibly changed that logging in and out again doesn't fix...
When using emacs in a text terminal, start it without the &, you need to run it in foreground. To save a file, use the standard C-xC-s (if your terminal interprets the keystrokes differently, you have to configure the terminal). After saving the file, you can get back to the shell by pressing C-z. It would stop emacs, but you can get back in by typing fg or %em or similar.
To quit emacs, use C-xC-c.

Input from STDIN in Light Table Juno

I recently came across with this awesome IDE, Juno for Julia. I have setup the IDE properly and it is successfully connecting to Julia. However, I'm facing with a small problem: How am I supposed to get data from STDIN in Juno using say, readline(STDIN)?
Appreciated!
Lighttable / Juno doesn't supply an input console. But the Julia REPL (command line version) does. I find it best to have both open. In asyncronous mode you can put trow-away code, shell commands (";") and command help ("?") in REPL and keep-code in Juno, and they share variables. You just can't run async in this case, since you want Juno to stop and wait.
On Windows default setting, you need to Evaluation -> Kill Julia
and then Ctrl+Space -> Julia: Connect to a running session. Leave out just '#async' when you want to wait for input.
If there is a better way already, I'd like to know too. Source: http://discuss.junolab.org/t/how-to-read-user-input-for-julia/110

Google NaCl on OS X: How do I get any debugging information at all?

Having compiled and linked a NaCl module I am now attempting to debug why it seemingly won't run. Unfortunately the platform is not passing on ANY information about why nothing is happening.
I can't believe I'm asking something this basic but what do you have to do to get a single printf() statement to appear in stdout/stderr? Or in the Javascript console?
Yes I've read the SDK page about Debugging and enabled all the dozens of environment variables and flags, I've turned the logging verbosity up to max, and absolutely none of it makes the blindest bit of difference. No information whatsoever appears anywhere.
Occasionally the JS console will print the line "ServiceRuntime::Start (start failed)" (which also appears in stdout) but it's far more often that I get nothing at all.
NaCl SDK version is 28, am running Chrome 30 on OS X Mavericks.
Command used to start Chrome with the Graphics 3D example in the SDK:
export NACL_EXE_STDERR=~/nacl_stderr.log
export NACL_EXE_STDOUT=~/nacl_stdout.log
open -a "Google Chrome" http://localhost:5103/api/graphics_3d/ --args --enable-logging --no-sandbox --vmodule=ppb*=4
This should generate a ton of logging but the log files are never created.
As discussed on the mailing list, the solution is to make sure you invoke chrome (e.g. from the command line) using the actual path to the Chrome binary (for example, "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome") instead of using the open shell command, because open does not give you the stdout/stderr streams from the application it launches.

Is there a library for Visual C++ that renders math formulas?

I've been looking all over, but I can't find anything free that will let me simply display math formulas on a window. I found one for Visual C++.net, but no APIs. Are there any out there?
What format are the Math formulas in?
My first impulse would be to try and find a LaTeX library for C++ which will let you render out LaTeX to an image. That way you could display most basic formulas, but the formulas would have to be in the LaTeX format.
Try ReforMath (http://reformath.webnode.com). Runs under both Windows and Linux. It is unfinished though, but can render a number of elements.
What a great question! Yes, there is now: latexpp.
You'll have to install VS 2017 Community first with the minimal amount of C++ features checked (so it doesn't take all day).
Then you install Boost using the binary (try the latest).
But you still have to build boost. By using the VS > Tools > Visual Studio Command Prompt. CD to your boost directory and run .\bootstrap.bat, then .\bjam.exe. This will take all day.
Good news is it seems to be working so far on Windows 7, 64-bit with VS 2017 community and the latest boost 1.6.x.
The Latex library has other requirements, and I still haven't tried it but will post my notes here if any hickups.
Make sure all your directories are short, such as C:\VisualStudio2017. However, boost will then fail if you use your regular windows command prompt unless you do the vcvarsall.bat trick. The VS Command Prompt does that for you, so that boost can find your MSVC stuff. Boost would still probably fail if you used the default directory and didn't use the VS command prompt.
So, again, my boost is in C:\boost_{blah version} which you should shorten to C:\boost assuming you'll only use one version of boost.
One reason is that if you have to add the respective /bin directories to your system Path, then you won't fail by maxing out the length of Path value (yes, it has a max length). Also stuff is easy to find and especially from the command line so you can cd quickly there. If you don't want everything in C:\ then make a C:\__TOOLS or something short.
I will post my notes here when I've gotten LaTeX rendered.
Notes
When building boost with bjam, if it seemingly hangs for more than 10 mins on one item, then hit ctrl-C at the command line once. This seems to unhang it without canceling the install.
TODO

Resources