TerminalIsolate class
The TerminalIsolate class hosts an Isolate that runs a Terminal. It handles all the communication with and from the Terminal and implements TerminalUiInteraction as well as the terminal and therefore can simply be exchanged with a Terminal. This class is the preferred use of a Terminal as the Terminal logic and all the communication with the backend are happening outside the UI thread.
There is a special constraints in using this class: The given backend has to be built so that it can be passed into an Isolate.
This means in particular that it is not allowed to have any closures in its object graph. It is a good idea to move as much instantiation as possible into the TerminalBackend.init method that gets called after the backend instance has been passed and is therefore allowed to instantiate parts of the object graph that do contain closures.
- Implemented types
- Mixed in types
Constructors
- TerminalIsolate({TerminalBackend? backend, BellHandler onBell = _defaultBellHandler, TitleChangeHandler onTitleChange = _defaultTitleHandler, IconChangeHandler onIconChange = _defaultIconHandler, PlatformBehavior platform = PlatformBehaviors.unix, TerminalTheme theme = TerminalThemes.defaultTheme, Duration minRefreshDelay = const Duration(milliseconds: 16), required int maxLines})
Properties
- backend → TerminalBackend?
-
final
-
backendExited
→ Future<
int> -
Future that fires when the backend has exited
no setteroverride
- backgroundColor → int
-
color code for the background
no setteroverride
- bufferHeight → int
-
the total buffer height
no setteroverride
- composingString → String
-
returns the current composing string. '' when there is no composing going on
no setteroverride
- currentLine → BufferLine?
-
current line
no setteroverride
- currentSearchHit ↔ int?
-
gets the current search hit
getter/setter pairoverride
- cursorColor → int
-
color code for the cursor
no setteroverride
- cursorX → int
-
cursor x coordinate
no setteroverride
- cursorY → int
-
cursor y coordinate
no setteroverride
- dirty → bool
-
flag that indicates if the terminal is dirty (since the last time this
flag has been queried)
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- invisibleHeight → int
-
the part of the buffer that is not visible (scrollback)
no setteroverride
- isReady → bool
-
flag that indicates if the Terminal is ready
no setteroverride
- isTerminated → bool
-
flag that indicates if the backend is already terminated
no setteroverride
- isUserSearchActive ↔ bool
-
gets if a user search is active
getter/setter pairoverride
- lastState → TerminalState?
-
no setter
-
listeners
→ Set<
_VoidCallback> -
finalinherited
- maxLines → int
-
final
- minRefreshDelay → Duration
-
final
- numberOfSearchHits → int
-
gets the number of search hits
no setteroverride
- onBell → BellHandler
-
final
- onIconChange → IconChangeHandler
-
final
- onTitleChange → TitleChangeHandler
-
final
- platform → PlatformBehavior
-
platform behavior for this terminal
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollOffsetFromBottom → int
-
the ViewPort scroll offset from the bottom
no setteroverride
- scrollOffsetFromTop → int
-
the ViewPort scroll offset from the top
no setteroverride
- selectedText → String?
-
selected text defined by selection
no setteroverride
- selection → Selection?
-
object that describes details about the current selection
no setteroverride
- showCursor → bool
-
true
when the cursor shall be shown, otherwisefalse
no setteroverride - terminalHeight → int
-
terminal height (view port)
no setteroverride
- terminalWidth → int
-
terminal width (view port)
no setteroverride
- theme → TerminalTheme
-
The theme associated with this Terminal
final
- userSearchOptions ↔ TerminalSearchOptions
-
gets the current user search options
getter/setter pairoverride
- userSearchPattern ↔ String?
-
the search pattern of a currently active search or
null
getter/setter pairoverride - userSearchResult → TerminalSearchResult
-
returns the list of search hits
no setteroverride
Methods
-
addListener(
_VoidCallback listener) → void -
inherited
-
clearSelection(
) → void -
clears the selection
override
-
convertViewLineToRawLine(
int viewLine) → int -
converts the given view line (view port line) index to its position in the
overall buffer
override
-
getVisibleLines(
) → List< BufferLine> -
returns the visible lines
override
-
keyInput(
TerminalKey key, {bool ctrl = false, bool alt = false, bool shift = false, bool mac = false, String? character}) → void -
notifies the Terminal about key input
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
inherited
-
onMouseDoubleTap(
Position position) → void -
notify the Terminal about a mouse double tap
override
-
onMouseTap(
Position position) → void -
notify the Terminal about a mouse tap
override
-
onPanStart(
Position position) → void -
notify the Terminal about a pan start
override
-
onPanUpdate(
Position position) → void -
notify the Terminal about a pan update
override
-
paste(
String data) → void -
paste clipboard content to the Terminal
override
-
poll(
) → void -
raiseOnInput(
String text) → void -
notifies the Terminal about user input
override
-
refresh(
) → void -
refreshes the Terminal (notifies listeners and sets it to dirty)
override
-
removeListener(
_VoidCallback listener) → void -
inherited
-
resize(
int newWidth, int newHeight, int newPixelWidth, int newPixelHeight) → void -
notifies the Terminal about a resize that happened. The Terminal will
do any resize / reflow logic and notify the backend about the resize
override
-
selectAll(
) → void -
select the whole buffer
override
-
setScrollOffsetFromBottom(
int offset) → void -
sets the scroll offset from bottom (scrolling)
override
-
start(
{bool testingDontWaitForBootup = false}) → Future< void> -
stop(
) → void -
terminateBackend(
) → void -
terminates the backend. If already terminated, nothing happens
override
-
toString(
) → String -
A string representation of this object.
inherited
-
updateComposingString(
String value) → void -
update the composing string. This gets called by the input handling
part of the terminal
override
-
write(
String text) → void -
writes data to the Terminal
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited