Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

semicolon output suppression in stream REPL #26320

Open
iwelch opened this issue Mar 5, 2018 · 4 comments
Open

semicolon output suppression in stream REPL #26320

iwelch opened this issue Mar 5, 2018 · 4 comments
Labels
domain:io Involving the I/O subsystem: libuv, read, write, etc. stdlib:REPL Julia's REPL (Read Eval Print Loop)

Comments

@iwelch
Copy link

iwelch commented Mar 5, 2018

refers to https://discourse.julialang.org/t/force-interactive/9479/4.

$ cat > a.jl
x=[1,2,3]
x+22
$ julia -i < a.jl
$ cat a.jl | julia -i
3-element Array{Int64,1}:
 1
 2
 3
3-element Array{Int64,1}:
 23
 24
 25

perhaps related, trailing semi-colon is treated differently in -i batch mode from real interactive mode (where it would suppress output):

$ echo "1+2;;;" | julia -i
3

Another difference between julia -i and true interactive emulation is that exceptions terminate the julia process, while a true REPL prints the exception and then waits for the next input.

@yuyichao
Copy link
Contributor

yuyichao commented Mar 5, 2018

Another difference between julia -i and true interactive emulation is that exceptions terminate the julia process, while a true REPL prints the exception and then waits for the next input.

This one is expected since the input is terminated.

@JeffBezanson
Copy link
Sponsor Member

On master redirect and cat behave the same for me.

@vtjnash
Copy link
Sponsor Member

vtjnash commented Mar 6, 2018

That was fixed by e7a2da7#diff-3779573011725ad47bfa3f6644536342R490. We can still add some form of trailing-semicolon output suppression though.

@JeffBezanson JeffBezanson added domain:io Involving the I/O subsystem: libuv, read, write, etc. stdlib:REPL Julia's REPL (Read Eval Print Loop) labels Mar 6, 2018
@Benoit9
Copy link

Benoit9 commented Sep 7, 2018

Another difference between julia -i and true interactive emulation is that exceptions terminate the julia process, while a true REPL prints the exception and then waits for the next input.

This one is expected since the input is terminated.

Is there any chance this could be changed? It's really handy to be able to examine/change the variables that caused an exception. I do it all the time with python -i

@JeffBezanson JeffBezanson changed the title behavior of 'julia -i' differs when input is from pipe or redirect semicolon output suppression in stream REPL Sep 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:io Involving the I/O subsystem: libuv, read, write, etc. stdlib:REPL Julia's REPL (Read Eval Print Loop)
Projects
None yet
Development

No branches or pull requests

5 participants