Change output destination with JUNO. Main document vs REPL

Hello.

When using Juno how can I control where the output of a command is produced?
Some commands such as 1+1 produce an output on the right side of the line on the main document,inlined.
Some other output the result only on the REPL, for example versioninfo().

How can I force Juno to change it?
For example I want the result of 1+1 (executed at the main document) on the REPL, and I want the result ot versioninfo() (executed on the main document) on the main document.

The difference you’re seeing is between printing results to stdout (which is what e.g. versioninfo() does), and returning a result (which is what 1+1 does).

You can change how results are shown via the “Result Display Mode” option:

You can also print to a string with sprint and return that like so (the Text is just so it’s shown a bit nicer):

1 Like

OK, thanks.

Is there any command or macro that let you change the display mode of an specific line without going to the settings page?

@show will always print to stdout, regardless of where results are displayed.

Where do I find this tab in juno?

Either like this:


or by typing “Julia Settings” into the command palette or by pressing Ctrl-J Ctr-, or by going to Settings > Packages > julia-client.

1 Like

Thanks.

One question.
if I want to hide the output of a line, I put semicolon at the end of a line in Julia REPL or Jupyter notebook. This doesnot seem to work in Juno. Any workaround?

It does:
image

Again, this is the difference between printing to stdout and displaying a returned object. Same goes for the REPL:

julia> 1+1
2

julia> 1+1;

julia> print(1+1);
2

I get it. This happens only when the Result Display Mode is next to code and not otherwise.

Ok, there was a bug with the “Display results in the console” mode that caused the result to be displayed always (which is what you were getting at, I guess). Should be fixed with this commit.

Maybe I am looking at the wrong place. Could you let me know where you find the “Result Display Mode” option?

Go to Settings > Packages > julia-client > UI Options: