Interface IConsoleHistory

The definition of a console history manager object.

interface IConsoleHistory {
    editor: null | CodeEditor.IEditor;
    isDisposed: boolean;
    placeholder: string;
    sessionContext: null | ISessionContext;
    back(placeholder): Promise<string>;
    dispose(): void;
    forward(placeholder): Promise<string>;
    push(item): void;
    reset(): void;
}

Hierarchy

Implemented by

Properties

editor: null | CodeEditor.IEditor

The current editor used by the history widget.

isDisposed: boolean

Test whether the object has been disposed.

Notes

This property is always safe to access.

placeholder: string

The placeholder text that a history session began with.

sessionContext: null | ISessionContext

The session context used by the foreign handler.

Methods

  • Get the previous item in the console history.

    Parameters

    • placeholder: string

      The placeholder string that gets temporarily added to the history only for the duration of one history session. If multiple placeholders are sent within a session, only the first one is accepted.

    Returns Promise<string>

    A Promise for console command text or undefined if unavailable.

  • Dispose of the resources held by the object.

    Notes

    If the object's dispose method is called more than once, all calls made after the first will be a no-op.

    Undefined Behavior

    It is undefined behavior to use any functionality of the object after it has been disposed unless otherwise explicitly noted.

    Returns void

  • Get the next item in the console history.

    Parameters

    • placeholder: string

      The placeholder string that gets temporarily added to the history only for the duration of one history session. If multiple placeholders are sent within a session, only the first one is accepted.

    Returns Promise<string>

    A Promise for console command text or undefined if unavailable.

  • Add a new item to the bottom of history.

    Parameters

    • item: string

      The item being added to the bottom of history.

      Notes

      If the item being added is undefined or empty, it is ignored. If the item being added is the same as the last item in history, it is ignored as well so that the console's history will consist of no contiguous repetitions.

    Returns void