Change output destination with JUNO. Main document vs REPL


#1

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.


#2

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):


#3

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?


#4

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


#5

Where do I find this tab in juno?


#6

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.


#7

Thanks.


#8

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?


#9

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

#10

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


#11

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.