terminus.effect

package terminus.effect

Members list

Type members

Classlikes

Attributes

Source
AlternateScreenMode.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
Self type
F
object AnsiCodes

The codes for controlling terminal functionality, commonly known as ANSI escape codes. See:

Attributes

Source
AnsiCodes.scala
Supertypes
class Object
trait Matchable
class Any
Self type
AnsiCodes.type
trait ApplicationMode[+F <: Effect]

Attributes

Source
ApplicationMode.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
Self type
F
object Ascii

Ascii character codes and Ascii related extension methods. See: https://www.ascii-code.com/

Ascii character codes and Ascii related extension methods. See: https://www.ascii-code.com/

Attributes

Source
Ascii.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Ascii.type
trait Color[+F <: Writer] extends WithStack[F]

Attributes

Source
Color.scala
Supertypes
trait WithStack[F]
class Object
trait Matchable
class Any
Known subtypes
Self type
F
trait Cursor extends Writer

Functionality for manipulating the terminal's cursor.

Functionality for manipulating the terminal's cursor.

Attributes

Source
Cursor.scala
Supertypes
trait Writer
trait Effect
class Object
trait Matchable
class Any
Known subtypes
trait Dimensions extends Effect

Functionalities related to the dimensions of the terminal

Functionalities related to the dimensions of the terminal

Attributes

Source
Dimensions.scala
Supertypes
trait Effect
class Object
trait Matchable
class Any
Known subtypes
trait Effect

Marker trait for Terminus effect traits. All effect traits should have this as a super-trait.

Marker trait for Terminus effect traits. All effect traits should have this as a super-trait.

Attributes

Source
Effect.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Dimensions
trait Terminal
trait KeyReader
trait Peeker
trait Reader
trait Writer
trait Cursor
trait Erase
trait Scroll
Show all
trait Erase extends Writer

Functionality for clearing contents on the terminal.

Functionality for clearing contents on the terminal.

Attributes

Source
Erase.scala
Supertypes
trait Writer
trait Effect
class Object
trait Matchable
class Any
Known subtypes
trait Format[+F <: Writer] extends WithStack[F], WithToggle[F]

Terminal effects that can change character formatting properties.

Terminal effects that can change character formatting properties.

Attributes

Source
Format.scala
Supertypes
trait WithToggle[F]
trait WithStack[F]
class Object
trait Matchable
class Any
Known subtypes
Self type
F
trait KeyReader extends Effect

Attributes

Source
KeyReader.scala
Supertypes
trait Effect
class Object
trait Matchable
class Any
Known subtypes
trait NonBlockingReader extends Effect

Attributes

Source
NonBlockingReader.scala
Supertypes
trait Effect
class Object
trait Matchable
class Any
Known subtypes
trait Peeker extends Effect

Attributes

Source
Peeker.scala
Supertypes
trait Effect
class Object
trait Matchable
class Any
Known subtypes
trait RawMode[+F <: Effect]

Attributes

Source
RawMode.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
Self type
F
trait Reader extends Effect

Attributes

Source
Reader.scala
Supertypes
trait Effect
class Object
trait Matchable
class Any
Known subtypes
trait Scroll extends Writer

Functionality for scrolling the terminal.

Functionality for scrolling the terminal.

Attributes

Source
Scroll.scala
Supertypes
trait Writer
trait Effect
class Object
trait Matchable
class Any
final case class Stack(reset: String)

A Stack handles stack for Terminal effects that overwrite each other within nested blocks. The canoncial example is color. There can only be one foreground or background color in use at any one time, but the color revert to that of the surrounding block when a given block exits. This is handles by storing a stack of color codes, and doing the appropriate actions on entering a block (a push) and exiting a block (a pop).

A Stack handles stack for Terminal effects that overwrite each other within nested blocks. The canoncial example is color. There can only be one foreground or background color in use at any one time, but the color revert to that of the surrounding block when a given block exits. This is handles by storing a stack of color codes, and doing the appropriate actions on entering a block (a push) and exiting a block (a pop).

Value parameters

`reset`:

The escape code to emit when there are no elements left on the stack.

Attributes

Source
Stack.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

A Reader that reads input from the given String. Mostly useful for testing.

A Reader that reads input from the given String. Mostly useful for testing.

Attributes

Source
StringBufferReader.scala
Supertypes
trait KeyReader
trait Reader
trait Effect
class Object
trait Matchable
class Any
Show all
final case class TerminalDimensions(columns: Int, rows: Int)

Attributes

Source
Dimensions.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

An implementation of KeyReader that interprets the standard terminal escape codes for key presses. The timeout is how long we wait between an escape being pressed and another key before we decide they are separate key presses.

An implementation of KeyReader that interprets the standard terminal escape codes for key presses. The timeout is how long we wait between an escape being pressed and another key before we decide they are separate key presses.

Attributes

Source
TerminalKeyReader.scala
Supertypes
trait KeyReader
trait Effect
class Object
trait Matchable
class Any
Known subtypes
Self type
final class Toggle(set: String, reset: String)

A Toggle stores state for Terminal effects that involve turning on some state within a block of code and turning it off when that block exits. A typical example is text styling: we have a block where we want invert styling enabled, and when the block finishes we want inverted styling turned off. A complication arises when we can nest blocks. An inverted block might be nested inside another inverted block. It's only when the outer block exits that the styling should be turned off. A Toggle handles this with a counter. Only when the counter hits zero do we emit the reset escape code.

A Toggle stores state for Terminal effects that involve turning on some state within a block of code and turning it off when that block exits. A typical example is text styling: we have a block where we want invert styling enabled, and when the block finishes we want inverted styling turned off. A complication arises when we can nest blocks. An inverted block might be nested inside another inverted block. It's only when the outer block exits that the styling should be turned off. A Toggle handles this with a counter. Only when the counter hits zero do we emit the reset escape code.

Value parameters

`reset`:

The escape code to emit when exiting a block.

`set`:

The escape code to emit when entering a block.

Attributes

Source
Toggle.scala
Supertypes
class Object
trait Matchable
class Any
trait WithEffect[+F <: Writer]

Attributes

Source
WithEffect.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
Self type
F
trait WithStack[+F <: Writer]

Utility trait for working with Stack.

Utility trait for working with Stack.

Attributes

Source
WithStack.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait Color[F]
trait Terminal
trait Format[F]
Show all
Self type
F
trait WithToggle[+F <: Writer]

Utility trait for working with Toggle.

Utility trait for working with Toggle.

Attributes

Source
WithToggle.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
Self type
F
trait Writer extends Effect

Interface for writing to a console.

Interface for writing to a console.

Attributes

Source
Writer.scala
Supertypes
trait Effect
class Object
trait Matchable
class Any
Known subtypes
trait Cursor
trait Terminal
trait Erase
trait Scroll
Show all