General Control Functions

ConsoleCodes.nextstopFunction
nextstop()

Goes to the next tab stop or to the end of the line if there is no earlier tab stop.

ConsoleCodes.escFunction
esc(v)

Write control bytes v following the start of a console escape sequence.

ConsoleCodes.savestateFunction
savestate()

Save the current console state, includes cursor coordinates, attributes and character sets. The state is saved to an internal OS register that can be restored with restorestate but is otherwise inaccessible.

ConsoleCodes.controlFunction
control(c, args...)

Insert a console control sequence with control character c and arguments args.

Each argument is inserted into the stream with print, so typically Integer types should be provided as arguments.

ConsoleCodes.deleteFunction
delete(n)

Delete n characters on the current line using a console escape sequence.

ConsoleCodes.withstyleFunction
withstyle(𝒻, io::IO, ss...;
          color=nothing, bold=false, italic=false, strike=false, blink=false,
          reverse=false, underline=false, background=nothing,
          reset=true
         )

Call 𝒻(io, ss...) writing console graphics formatting control sequences before and after as specified.

Note that saving the console state does not save graphic attributes, so the console state prior to printing is lost. If reset=true, the console graphical reset Graphics.reset() will be called, completely erasing whatever state the console may have had both prior to and during printing with printstyled.

Foreground color is specified with color, background color is specified with background. If nothing, the console color state will remain unchanged. Colors can be specified with any of

  • An integer between 0 and 255 (256-color)
  • A 3-tuple of integers, each between 0 and 255 (24-bit color).
  • One of the following Symbols: :default, :black, :red, :green, :brown, :blue, :magenta, :cyan, :white.
ConsoleCodes.printstyledFunction
printstyled(io::IO, ss...; kw...)
printstyled(ss...; kw...)

Print arguments ss with graphical styling provided by console control codes. Similar to Base.prinstyled but with more features.

If no io is specified, stdout will be used.

Internally uses withstyle, see the documentation of that function for a description of all available options.