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

Have a sanctioned way to modify the REPL's IOContext #20509

Closed
Keno opened this issue Feb 7, 2017 · 3 comments · Fixed by #29249
Closed

Have a sanctioned way to modify the REPL's IOContext #20509

Keno opened this issue Feb 7, 2017 · 3 comments · Fixed by #29249
Labels
display and printing Aesthetics and correctness of printed representations of objects. help wanted Indicates that a maintainer wants help on an issue or pull request REPL Julia's REPL (Read Eval Print Loop)

Comments

@Keno
Copy link
Member

Keno commented Feb 7, 2017

I would like a way to modify the IOContext of the REPL. Right now that's a little hard because everything is buried deep in the REPL code.

Example:

julia> immutable Foo
       end

julia> show(io::IO, x::Foo) = print(io, get(io, :debug, false) ? "Lots of debug info" : "Foo")
show (generic function with 1 method)

julia> Foo
Foo

I'd like some global setting that allows me to put debug=true in the REPL IOContext and print "Lots of debug info" at the REPL.

@Keno Keno added the help wanted Indicates that a maintainer wants help on an issue or pull request label Feb 7, 2017
@ararslan ararslan added display and printing Aesthetics and correctness of printed representations of objects. REPL Julia's REPL (Read Eval Print Loop) labels Feb 7, 2017
@vtjnash
Copy link
Member

vtjnash commented Feb 8, 2017

+1. I suspect we just need to remove the type restrictions from the fields of TTYTerminal.

@KristofferC
Copy link
Member

What's the advantage over using a global or using a proper logging tool?

@TotalVerb
Copy link
Contributor

👍 for IO context configurability in REPL. Configuring the REPL's IOContext is better than using a global because it avoids interfering with any user code; it just affects how things are displayed. I'm not sure what logging has to do with this; IOContext will only affect how things are printed and has nothing to do with logging. I believe what Keno means by "debug info" are object internals.

rfourquet added a commit that referenced this issue Sep 18, 2018
This adds an `iocontext::Dict{Symbol,Any}` field to `LineEditREPL`,
which can be initialized with `atreplinit`, and updated
interactively, e.g. `Base.active_repl.iocontext[:compact] = true`.

Fixes #20509.
rfourquet added a commit that referenced this issue Sep 17, 2019
This adds an `iocontext::Dict{Symbol,Any}` field to `LineEditREPL`,
which can be initialized with `atreplinit`, and updated
interactively, e.g. `Base.active_repl.iocontext[:compact] = true`.

Fixes #20509.
rfourquet added a commit that referenced this issue Sep 25, 2019
This adds an `iocontext::Dict{Symbol,Any}` field to `LineEditREPL`,
which can be initialized with `atreplinit`, and updated
interactively, e.g. `Base.active_repl.iocontext[:compact] = true`.

Fixes #20509.
rfourquet added a commit that referenced this issue Oct 2, 2019
This adds an `iocontext::Dict{Symbol,Any}` field to `LineEditREPL`,
which can be initialized with `atreplinit`, and updated
interactively, e.g. `Base.active_repl.iocontext[:compact] = true`.

Fixes #20509.
rfourquet added a commit that referenced this issue Oct 2, 2019
This adds an `iocontext::Dict{Symbol,Any}` field to `LineEditREPL`,
which can be initialized with `atreplinit`, and updated
interactively, e.g. `Base.active_repl.iocontext[:compact] = true`.

Fixes #20509.
rfourquet added a commit that referenced this issue Oct 30, 2019
This adds an `iocontext::Dict{Symbol,Any}` field to `LineEditREPL`,
which can be initialized with `atreplinit`, and updated
interactively, e.g. `Base.active_repl.iocontext[:compact] = true`.

Fixes #20509.
rfourquet added a commit that referenced this issue Nov 1, 2019
This adds an `iocontext::Dict{Symbol,Any}` field to `LineEditREPL.options`,
which can be initialized with `atreplinit`, and updated
interactively, e.g. `Base.active_repl.options.iocontext[:compact] = true`.

Fixes #20509.
rfourquet added a commit that referenced this issue Nov 16, 2019
This adds an `iocontext::Dict{Symbol,Any}` field to `LineEditREPL.options`,
which can be initialized with `atreplinit`, and updated
interactively, e.g. `Base.active_repl.options.iocontext[:compact] = true`.

Fixes #20509.
KristofferC pushed a commit that referenced this issue Apr 11, 2020
This adds an `iocontext::Dict{Symbol,Any}` field to `LineEditREPL.options`,
which can be initialized with `atreplinit`, and updated
interactively, e.g. `Base.active_repl.options.iocontext[:compact] = true`.

Fixes #20509.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
display and printing Aesthetics and correctness of printed representations of objects. help wanted Indicates that a maintainer wants help on an issue or pull request REPL Julia's REPL (Read Eval Print Loop)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants