arsd.terminalemulator

FIXME: writing a line in color then a line in ordinary does something wrong.

huh if i do underline then change color it undoes the underline

FIXME: make shift+enter send something special to the application and shift+space, etc. identify itself somehow too for client extensions ctrl+space is supposed to send char 0.

ctrl+click on url pattern could open in browser perhaps

FIXME: scroll stuff should be higher level in the implementation. so like scroll Rect, DirectionAndAmount

There should be a redraw thing that is given batches of instructions in here that the other thing just implements.

FIXME: the save stack stuff should do cursor style too

This is an extendible unix terminal emulator and some helper functions to help actually implement one.

You'll have to subclass TerminalEmulator and implement the abstract functions as well as write a drawing function for it.

See nestedterminalemulator.d or main.d for how I did it.

Constructors

this
this(int width, int height)

construct

Members

Classes

TerminalEmulator
class TerminalEmulator

An abstract class that does terminal emulation. You'll have to subclass it to make it work.

Functions

cls
void cls()

clear the screen

doNothing
void doNothing()

you can pass this as PtySupport's arguments when you just don't care

sendRawInput
void sendRawInput(ubyte[] datain)

sends raw input data to the terminal as if the application printf()'d it or it echoed or whatever

startChild
void startChild(string program, string[] args)

this is good

startChild
void startChild(string program, string commandLine)

this is good. best to call it with plink.exe so it can talk to unix note that plink asks for the password out of band, so it won't actually work like that. thus specify the password on the command line or better yet, use a private key file e.g. startChild!something("plink.exe", "plink.exe user@server -i key.ppk \"/home/user/terminal-emulator/serverside\"");

writeScrollbackToDelegate
void writeScrollbackToDelegate(void delegate(dchar c) dg)

Writes the text in the scrollback buffer to the given delegate, one character at a time.

writeScrollbackToFile
void writeScrollbackToFile(string filename)

Writes the text in the scrollback buffer to the given file.

Mixin templates

ForwardVirtuals
mixintemplate ForwardVirtuals(alias writer)

Implementation of TerminalEmulator's abstract functions that forward them to output

PtySupport
mixintemplate PtySupport(alias resizeHelper)

You must implement a function called redraw() and initialize the members in your constructor

Structs

CursorPosition
struct CursorPosition

Cursor position, zero based. (0,0) == upper left. (0, 1) == second row, first column.

Variables

nonCharacterDataStore
NonCharacterData nonCharacterDataStore;

iff hasNonCharacterData

Meta