How to open Julia replica in a specific mode

I want to have a short script that opens Julia REPL in a certain mode, for example, in shell> or C++ > mode (from Cxx.jl). How can this be achieved?

Update : Having received the answer, I created a script to run Julia REPL in Cxx.jl C ++ mode (and pre-run some C ++ code). See here: https://github.com/cdsousa/cxxrepl.jl .

+5
source share
1 answer

Whatever it is useful for ...

The easiest way (without having to dig out the internals of Base.REPL ) is to write the corresponding character in STDIN , for example

 write(STDIN.buffer,'?'); 

If you want to run REPL immediately and go into shell mode, call julia as

 julia -i -e write(STDIN.buffer,';') 
+7
source

Source: https://habr.com/ru/post/1272130/


All Articles