Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
/**
* A terminal contribution that gets created whenever a terminal is created. A contribution has
* access to the process manager through the constructor and provides a method for when xterm.js has
* been initialized.
*/
export
interface
ITerminalContribution
extends
IDisposable
{
?
(
:
&
{
:
}
,
:
)
:
void
;
?
(
:
&
{
:
}
)
:
void
;
?
(
:
&
{
:
}
)
:
void
;
?
(
:
)
:
<
{
:
boolean
}
|
void
>
;
}
/**
* A service used to create instances or fetch backends, this services allows services that
* ITerminalService depends on to also create instances.
*
* **This service is intended to only be used within the terminal contrib.**
*/
export
interface
ITerminalInstanceService
{
readonly
:
undefined
;
/**
* An event that's fired when a terminal instance is created.
*/
readonly
:
<
>
;
/**
* An event that's fired when a new backend is registered.
*/
readonly
:
<
>
;
/**
* Helper function to convert a shell launch config, a profile or undefined into its equivalent
* shell launch config.
* @paramshellLaunchConfigOrProfile A shell launch config, a profile or undefined
* @paramcwd A cwd to override.
*/
convertProfileToShellLaunchConfig
(
?
:
|
,
?
:
string
|
URI
)
:
;
/**
* Create a new terminal instance.
* @paramlaunchConfig The shell launch config.
* @paramtarget The target of the terminal.
*/
createInstance
(
:
,
:
,
?
:
)
:
;
/**
* Gets the registered backend for a remote authority (undefined = local). This is a convenience
* method to avoid using the more verbose fetching from the registry.
* @paramremoteAuthority The remote authority of the backend.
*/
getBackend
(
?
:
string
)
:
Promise
<
|
undefined
>
;
getRegisteredBackends
(
)
:
<
>
;
didRegisterBackend
(
:
)
:
void
;
}
/**
* A lightweight command detection source for terminals connected via the Agent Host Protocol.
* Provides a subset of {@link ICommandDetectionCapability} driven by AHP protocol actions
* (`terminal/commandExecuted`, `terminal/commandFinished`) rather than local shell integration.
*/
export
interface
IAhpTerminalCommandSource
extends
IDisposable
{
readonly
:
readonly
[
]
;
readonly
:
|
undefined
;
readonly
:
<
>
;
readonly
:
<
>
;
getCommandById
(
:
string
)
:
|
undefined
;
}
/**
* Service enabling communication between the chat tool implementation in terminal contrib and workbench contribs.
* Acts as a communication mechanism for chat-related terminal features.
*/
export
interface
IChatTerminalToolProgressPart
{
readonly
:
number
;
readonly
:
number
;
readonly
:
string
|
undefined
;
focusTerminal
(
)
:
Promise
<
void
>
;
toggleOutputFromKeyboard
(
)
:
Promise
<
void
>
;
toggleOutputFromAction
(
)
:
Promise
<
void
>
;
continueInBackground
(
)
:
void
;
didRegisterOutputSource
(
:
string
)
:
void
;
markContinuedInBackground
(
)
:
void
;
focusOutput
(
)
:
void
;
getCommandAndOutputAsText
(
)
:
string
|
undefined
;
}
/** A read-only output stream rendered by chat without a workbench terminal instance. */
export
interface
IChatTerminalOutputSource
{
readonly
:
<
void
>
;
readonly
:
string
;
/**
* Whether the underlying command has finished. A command can exit without
* reporting an {@link exitCode}, so completion must be read from here
* rather than inferred from the code being present.
*/
readonly
:
boolean
;
readonly
:
number
|
undefined
;
}
export
interface
ITerminalChatService
{
readonly
:
undefined
;
/**
* Fired when a terminal instance is registered for a tool session id. This can happen after
* the chat UI first renders, enabling late binding of the focus action.
*/
readonly
:
<
>
;
/**
* Associate a tool session id with a terminal instance. The association is automatically
* cleared when the instance is disposed.
*/
registerTerminalInstanceWithToolSession
(
:
string
|
undefined
,
:
)
:
void
;
/**
* Resolve a terminal instance by its tool session id.
* @paramterminalToolSessionId The tool session id provided in toolSpecificData.
* If no tool session ID is provided, we do nothing.
*/
getTerminalInstanceByToolSessionId
(
:
string
)
:
Promise
<
|
undefined
>
;
/**
* Associate a terminal execution id (the per-invocation id used by `RunInTerminalTool`)
* with a terminal instance. The association is automatically cleared when the instance is
* disposed or when the returned disposable is disposed.
*/
registerTerminalInstanceWithExecutionId
(
:
string
,
:
)
:
;
/**
* Resolve a terminal instance by its execution id (the per-invocation id used by
* `RunInTerminalTool`). Returns undefined if no active execution exists for the id.
*/
getTerminalInstanceByExecutionId
(
:
string
)
:
|
undefined
;
/**
* Returns the list of terminal instances that have been registered with a tool session id.
* This is used for surfacing tool-driven/background terminals in UI (eg. quick picks).
*/
getToolSessionTerminalInstances
(
?
:
boolean
)
:
readonly
[
]
;
/**
* Returns the tool session ID for a given terminal instance, if it has been registered.
* @paraminstance The terminal instance to look up
* @returns The tool session ID if found, undefined otherwise
*/
getToolSessionIdForInstance
(
:
)
:
string
|
undefined
;
/**
* Associate a chat session with a terminal instance. This is used to retrieve the chat
* session title for display purposes.
* @paramchatSessionResource The chat session resource URI
* @paraminstance The terminal instance
*/
registerTerminalInstanceWithChatSession
(
:
URI
,
:
)
:
void
;
/**
* Returns the chat session resource for a given terminal instance, if it has been registered.
* @paraminstance The terminal instance to look up
* @returns The chat session resource if found, undefined otherwise
*/
getChatSessionResourceForInstance
(
:
)
:
URI
|
undefined
;
/**
* Check if a terminal is a background terminal (tool-driven terminal that may be hidden from
* normal UI).
* @paramterminalToolSessionId The tool session ID to check, if provided
* @returns True if the terminal is a background terminal, false otherwise
*/
isBackgroundTerminal
(
?
:
string
)
:
boolean
;
registerOutputSource
(
:
string
,
:
)
:
;
getOutputSource
(
:
string
|
undefined
)
:
|
undefined
;
/**
* Register a chat terminal tool progress part for tracking and focus management.
* @parampart The progress part to register
* @returns A disposable that unregisters the progress part when disposed
*/
registerProgressPart
(
:
)
:
;
/**
* Set the currently focused progress part.
* @parampart The progress part to focus
*/
setFocusedProgressPart
(
:
)
:
void
;
/**
* Clear the focused state from a progress part.
* @parampart The progress part to clear focus from
*/
clearFocusedProgressPart
(
:
)
:
void
;
/**
* Get the currently focused progress part, if any.
* @returns The focused progress part or undefined if none is focused
*/
getFocusedProgressPart
(
)
:
|
undefined
;
/**
* Get the most recently registered progress part, if any.
* @returns The most recent progress part or undefined if none exist
*/
getMostRecentProgressPart
(
)
:
|
undefined
;
/**
* Enable or disable auto approval for all commands in a specific session.
* @paramchatSessionResource The chat session resource URI
* @paramenabled Whether to enable or disable session auto approval
*/
setChatSessionAutoApproval
(
:
URI
,
:
boolean
)
:
void
;
/**
* Check if a session has auto approval enabled for all commands.
* @paramchatSessionResource The chat session resource URI
* @returns True if the session has auto approval enabled
*/
hasChatSessionAutoApproval
(
:
URI
)
:
boolean
;
/**
* Add a session-scoped auto-approve rule.
* @paramchatSessionResource The chat session resource URI
* @paramkey The rule key (command or regex pattern)
* @paramvalue The rule value (approval boolean or object with approve and matchCommandLine)
*/
addSessionAutoApproveRule
(
:
URI
,
:
string
,
:
boolean
|
{
:
boolean
;
?
:
boolean
}
)
:
void
;
/**
* Get all session-scoped auto-approve rules for a specific chat session.
* @paramchatSessionResource The chat session resource URI
* @returns A record of all session-scoped auto-approve rules for the session
*/
getSessionAutoApproveRules
(
:
URI
)
:
<
<
string
,
boolean
|
{
:
boolean
;
?
:
boolean
}
>>
;
/**
* Generate auto-approve rule actions for a command line that was not evaluated by the
* built-in run in terminal tool, such as terminal confirmations surfaced by agent host
* sessions. The command line is parsed into sub-commands and evaluated against the
* persisted configuration rules only (never workbench session rules, which agent hosts
* do not consume) to produce the same persistent-rule suggestions the built-in tool
* offers.
* @paramcommandLine The full command line being confirmed
* @paramlanguage The language to parse the command line with
* @returns The actions to show in the confirmation dropdown, or undefined if the command
* line could not be analyzed
*/
getAutoApproveActions
(
:
string
,
:
'shellscript'
|
'powershell'
)
:
Promise
<
[
]
|
undefined
>
;
/**
* Signal that a foreground terminal tool invocation should continue in the background.
* This causes the tool to return its current output immediately while the terminal keeps running.
* @paramterminalToolSessionId The tool session ID to continue in background
*/
continueInBackground
(
:
string
)
:
void
;
/**
* Event fired when a terminal tool invocation should continue in the background.
*/
readonly
:
<
string
>
;
/**
* Register an AHP command source for a tool session. The source provides command detection
* events for terminals connected via the Agent Host Protocol.
* @paramterminalToolSessionId The tool session ID to associate with the source
* @paramsource The AHP command source
* @returns A disposable that unregisters the source when disposed
*/
registerAhpCommandSource
(
:
string
,
:
,
:
Promise
<
>
)
:
;
/**
* Retrieve the AHP command source for a given tool session.
* @paramterminalToolSessionId The tool session ID to look up
* @returns The AHP command source if registered, undefined otherwise
*/
getAhpCommandSource
(
:
string
)
:
|
undefined
;
}
/**
* A service responsible for managing terminal editing state and functionality. This includes
* tracking which terminal is currently being edited and managing editable data associated with
* terminal instances.
*/
export
interface
ITerminalEditingService
{
readonly
:
undefined
;
/**
* Get the editable data for a terminal instance.
* @paraminstance The terminal instance.
* @returns The editable data if the instance is editable, undefined otherwise.
*/
getEditableData
(
:
)
:
|
undefined
;
/**
* Set the editable data for a terminal instance.
* @paraminstance The terminal instance.
* @paramdata The editable data to set, or null to clear.
*/
setEditable
(
:
,
:
|
null
)
:
void
;
/**
* Check if a terminal instance is currently editable.
* @paraminstance The terminal instance to check.
* @returns True if the instance is editable, false otherwise.
*/
isEditable
(
:
|
undefined
)
:
boolean
;
/**
* Get the terminal instance that is currently being edited.
* @returns The terminal instance being edited, or undefined if none.
*/
getEditingTerminal
(
)
:
|
undefined
;
/**
* Set the terminal instance that is currently being edited.
* @paraminstance The terminal instance to set as editing, or undefined to clear.
*/
setEditingTerminal
(
:
|
undefined
)
:
void
;
}
export
const
enum
{
=
0
,
=
1
,
=
2
,
=
3
}
export
interface
IQuickPickTerminalObject
{
:
|
|
{
:
;
:
{
?
:
string
;
?
:
string
}
}
|
undefined
;
:
|
undefined
;
}
export
interface
IMarkTracker
{
scrollToPreviousMark
(
?
:
,
?
:
boolean
,
?
:
boolean
)
:
void
;
scrollToNextMark
(
)
:
void
;
selectToPreviousMark
(
)
:
void
;
selectToNextMark
(
)
:
void
;
selectToPreviousLine
(
)
:
void
;
selectToNextLine
(
)
:
void
;
clear
(
)
:
void
;
scrollToClosestMarker
(
:
string
,
?
:
string
,
?
:
boolean
|
undefined
)
:
void
;
scrollToLine
(
:
number
,
:
)
:
void
;
revealCommand
(
:
|
|
URI
,
?
:
)
:
void
;
revealRange
(
:
)
:
void
;
registerTemporaryDecoration
(
:
,
:
|
undefined
,
:
boolean
)
:
void
;
showCommandGuide
(
:
|
undefined
)
:
void
;
saveScrollState
(
)
:
void
;
restoreScrollState
(
)
:
void
;
}
export
interface
ITerminalGroup
{
:
|
undefined
;
:
[
]
;
:
string
;
readonly
:
boolean
;
readonly
:
<
>
;
readonly
:
<
>
;
readonly
:
<
void
>
;
readonly
:
<
>
;
focusPreviousPane
(
)
:
void
;
focusNextPane
(
)
:
void
;
resizePane
(
:
)
:
void
;
resizePanes
(
:
number
[
]
)
:
void
;
setActiveInstanceByIndex
(
:
number
,
?
:
boolean
)
:
void
;
attachToElement
(
:
)
:
void
;
addInstance
(
:
)
:
void
;
removeInstance
(
:
)
:
void
;
moveInstance
(
:
<
>
,
:
number
,
:
'before'
|
'after'
)
:
void
;
setVisible
(
:
boolean
)
:
void
;
layout
(
:
number
,
:
number
)
:
void
;
addDisposable
(
:
)
:
void
;
split
(
:
)
:
;
getLayoutInfo
(
:
boolean
)
:
;
}
export
const
enum
{
,
}
export
interface
IDetachedXTermOptions
{
:
number
;
:
number
;
:
;
?
:
&
;
readonly
?
:
boolean
;
:
;
?
:
boolean
;
}
/**
* A generic interface implemented in both the {@link ITerminalInstance} (an
* interface used for terminals attached to the terminal panel or editor) and
* {@link IDetachedTerminalInstance} (a terminal used elsewhere in VS Code UI).
*/
export
interface
IBaseTerminalInstance
{
readonly
:
;
/**
* DOM element the terminal is mounted in.
*/
readonly
?
:
;
/**
* Current selection in the terminal.
*/
readonly
:
string
|
undefined
;
/**
* Check if anything is selected in terminal.
*/
hasSelection
(
)
:
boolean
;
/**
* Clear current selection.
*/
clearSelection
(
)
:
void
;
/**
* Focuses the terminal instance if it's able to (the xterm.js instance must exist).
*
* @paramforce Force focus even if there is a selection.
*/
focus
(
?
:
boolean
)
:
void
;
/**
* Force the scroll bar to be visible until {@link resetScrollbarVisibility} is called.
*/
forceScrollbarVisibility
(
)
:
void
;
/**
* Resets the scroll bar to only be visible when needed, this does nothing unless
* {@link forceScrollbarVisibility} was called.
*/
resetScrollbarVisibility
(
)
:
void
;
/**
* Gets a terminal contribution by its ID.
*/
getContribution<Textends ITerminalContribution>
(
:
string
)
:
T
|
null
;
}
/**
* A {@link ITerminalInstance}-like object that emulates a subset of
* capabilities. This instance is returned from {@link ITerminalService.createDetachedTerminal}
* to represent terminals that appear in other parts of the VS Code UI outside
* of the "Terminal" view or editors.
*/
export
interface
IDetachedTerminalInstance
extends
IDisposable
,
{
readonly
:
;
/**
* Event fired when data is received from the terminal.
*/
:
<
string
>
;
/**
* Attached the terminal to the given element. This should be preferred over
* calling {@link IXtermTerminal.attachToElement} so that extra DOM elements
* for contributions are initialized.
*
* @paramcontainer Container the terminal will be rendered in
* @paramoptions Additional options for mounting the terminal in an element
*/
attachToElement
(
:
,
?
:
<
>
)
:
void
;
}
export
const
=
(
:
|
)
:
is
=>
!
isNumber
(
(
as
)
.
)
;
export
interface
ITerminalService
extends
ITerminalInstanceHost
{
readonly
:
undefined
;
/** Gets all terminal instances, including editor, terminal view (group), and background instances. */
readonly
:
readonly
[
]
;
readonly
:
readonly
[
]
;
/** Gets detached terminal instances created via {@link createDetachedXterm}. */
readonly
:
<
>
;
readonly
:
boolean
;
readonly
:
;
readonly
:
Promise
<
void
>
;
/** The number of restored terminal groups on startup. */
readonly
:
number
;
readonly
:
<
>
;
readonly
:
<
>
;
readonly
:
<
>
;
readonly
:
<
void
>
;
readonly
:
<
void
>
;
// Group events
readonly
:
<
|
undefined
>
;
// Multiplexed events
readonly
:
<
{
:
;
:
string
}
>
;
readonly
:
<
>
;
readonly
:
<
{
:
;
:
boolean
}
>
;
readonly
:
<
>
;
readonly
:
<
>
;
readonly
:
<
>
;
readonly
:
<
>
;
readonly
:
<
>
;
readonly
:
<
>
;
readonly
:
<
>
;
/**
* Creates a terminal.
* @paramoptions The options to create the terminal with, when not specified the default
* profile will be used at the default target.
*/
createTerminal
(
?
:
)
:
Promise
<
>
;
/**
* Creates and focuses a terminal.
* @paramoptions The options to create the terminal with, when not specified the default
* profile will be used at the default target.
*/
createAndFocusTerminal
(
?
:
)
:
Promise
<
>
;
/**
* Creates a detached xterm instance which is not attached to the DOM or
* tracked as a terminal instance.
* @params options The options to create the terminal with
*/
createDetachedTerminal
(
:
)
:
Promise
<
>
;
/**
* Creates a raw terminal instance, this should not be used outside of the terminal part.
*/
getInstanceFromId
(
:
number
)
:
|
undefined
;
/**
* An owner of terminals might be created after reconnection has occurred,
* so store them to be requested/adopted later
* @deprecated Use {@link onDidReconnectToSession}
*/
getReconnectedTerminals
(
:
string
)
:
[
]
|
undefined
;
getActiveOrCreateInstance
(
?
:
{
?
:
boolean
}
)
:
Promise
<
>
;
revealTerminal
(
:
,
?
:
boolean
)
:
Promise
<
void
>
;
/**
* @paraminstance
* @paramsuppressSetActive Do not set the active instance when there is only one terminal
* @paramforceSaveState Used when the window is shutting down and we need to reveal and save hideFromUser terminals
*/
showBackgroundTerminal
(
:
,
?
:
boolean
)
:
Promise
<
void
>
;
/**
* Moves a visible terminal instance to the background. The terminal process
* remains alive but the instance is removed from its group/editor and tracked
* internally so it can later be shown again via {@link showBackgroundTerminal}.
*/
moveToBackground
(
:
)
:
void
;
revealActiveTerminal
(
?
:
boolean
)
:
Promise
<
void
>
;
moveToEditor
(
:
,
?
:
|
SIDE_GROUP_TYPE
|
ACTIVE_GROUP_TYPE
|
AUX_WINDOW_GROUP_TYPE
)
:
void
;
moveIntoNewEditor
(
:
)
:
void
;
moveToTerminalView
(
:
|
URI
)
:
Promise
<
void
>
;
getPrimaryBackend
(
)
:
|
undefined
;
setNextCommandId
(
:
number
,
:
string
,
:
string
)
:
Promise
<
void
>
;
/**
* Fire the onActiveTabChanged event, this will trigger the terminal dropdown to be updated,
* among other things.
*/
refreshActiveGroup
(
)
:
void
;
registerProcessSupport
(
:
boolean
)
:
void
;
showProfileQuickPick
(
:
'setDefault'
|
'createInstance'
,
?
:
string
|
URI
)
:
Promise
<
|
undefined
>
;
setContainers
(
:
,
:
)
:
void
;
requestStartExtensionTerminal
(
:
,
:
number
,
:
number
)
:
Promise
<
|
undefined
>
;
isAttachedToTerminal
(
:
)
:
boolean
;
safeDisposeTerminal
(
:
)
:
Promise
<
void
>
;
getDefaultInstanceHost
(
)
:
;
getInstanceHost
(
:
|
undefined
)
:
Promise
<
>
;
resolveLocation
(
?
:
)
:
Promise
<
|
undefined
>
;
setNativeDelegate
(
:
)
:
void
;
/**
* Creates an instance event listener that listens to all instances, dynamically adding new
* instances and removing old instances as needed.
* @paramgetEvent Maps the instance to the event.
*/
createOnInstanceEvent<T>
(
getEvent
:
(
:
)
=>
<
T
>
)
:
<
,
T
>
;
/**
* Creates a capability event listener that listens to capabilities on all instances,
* dynamically adding and removing instances and capabilities as needed.
* @paramcapabilityId The capability type to listen to an event on.
* @paramgetEvent Maps the capability to the event.
*/
/**
* Reveals the terminal and, if provided, scrolls to the command mark.
* @paramresource the terminal resource
*/
openResource
(
:
URI
)
:
void
;
}
/**
* A service that provides convenient access to the terminal configuration and derived values.
*/
export
interface
ITerminalConfigurationService
{
readonly
:
undefined
;
/**
* A typed and partially validated representation of the terminal configuration.
*/
readonly
:
<
>
;
/**
* The default location for terminals.
*/
readonly
:
;
/**
* Fires when something within the terminal configuration changes.
*/
readonly
:
<
void
>
;
setPanelContainer
(
:
)
:
void
;
configFontIsMonospace
(
)
:
boolean
;
getFont
(
:
,
?
:
,
?
:
boolean
)
:
;
/**
* Whether a particular command should skip the shell and go to be handled like a regular
* keybinding instead.
* @paramcommandId The command ID to check.
*/
shouldCommandSkipShell
(
:
string
)
:
boolean
;
}
export
class
TerminalLinkQuickPickEvent
extends
MouseEvent
{
}
export
interface
ITerminalServiceNativeDelegate
{
getWindowCount
(
)
:
Promise
<
number
>
;
}
/**
* This service is responsible for integrating with the editor service and managing terminal
* editors.
*/
export
interface
ITerminalEditorService
extends
ITerminalInstanceHost
{
readonly
:
undefined
;
/** Gets all _terminal editor_ instances. */
readonly
:
readonly
[
]
;
openEditor
(
:
,
?
:
)
:
Promise
<
void
>
;
detachInstance
(
:
)
:
void
;
splitInstance
(
:
,
?
:
)
:
Promise
<
>
;
revealActiveEditor
(
?
:
boolean
)
:
Promise
<
void
>
;
resolveResource
(
:
)
:
URI
;
reviveInput
(
:
)
:
;
getInputFromResource
(
:
URI
)
:
;
}
export
const
=
'terminalEditor'
;
interface
ITerminalEditorInputObject
{
readonly
:
number
;
readonly
:
number
;
readonly
:
string
;
readonly
:
;
readonly
:
string
;
readonly
:
|
undefined
;
readonly
:
string
|
undefined
;
readonly
?
:
boolean
;
readonly
?
:
;
readonly
?
:
boolean
;
readonly
?
:
boolean
;
readonly
?
:
;
readonly
:
string
;
}
export
interface
ISerializedTerminalEditorInput
extends
ITerminalEditorInputObject
{
}
export
interface
IDeserializedTerminalEditorInput
extends
ITerminalEditorInputObject
{
}
export
type
ITerminalLocationOptions
=
|
|
{
:
<
>
}
|
{
:
boolean
}
;
export
interface
ICreateTerminalOptions
{
/**
* The shell launch config or profile to launch with, when not specified the default terminal
* profile will be used.
*/
?
:
|
|
;
/**
* The current working directory to start with, this will override IShellLaunchConfig.cwd if
* specified.
*/
?
:
string
|
URI
;
/**
* The terminal's resource, passed when the terminal has moved windows.
*/
?
:
URI
;
/**
* The terminal's location (editor or panel), it's terminal parent (split to the right), or editor group
*/
?
:
;
/**
* This terminal will not wait for contributed profiles to resolve which means it will proceed
* when the workbench is not yet loaded.
*/
?
:
boolean
;
}
export
interface
TerminalEditorLocation
{
:
|
SIDE_GROUP_TYPE
|
ACTIVE_GROUP_TYPE
|
AUX_WINDOW_GROUP_TYPE
;
?
:
boolean
;
?
:
[
'auxiliary'
]
;
}
/**
* This service is responsible for managing terminal groups, that is the terminals that are hosted
* within the terminal panel, not in an editor.
*/
export
interface
ITerminalGroupService
extends
ITerminalInstanceHost
{
readonly
:
undefined
;
/** Gets all _terminal view_ instances, ie. instances contained within terminal groups. */
readonly
:
readonly
[
]
;
readonly
:
readonly
[
]
;
:
|
undefined
;
readonly
:
number
;
/**
* Gets or sets the last accessed menu, this is used to select the instance(s) for menu actions.
*/
:
'inline-tab'
|
'tab-list'
;
readonly
:
<
|
undefined
>
;
readonly
:
<
>
;
/** Fires when a group is created, disposed of, or shown (in the case of a background group). */
readonly
:
<
void
>
;
/** Fires when the panel has been shown and expanded, so has non-zero dimensions. */
readonly
:
<
void
>
;
readonly
:
<
>
;
createGroup
(
?
:
)
:
;
createGroup
(
?
:
)
:
;
getGroupForInstance
(
:
)
:
|
undefined
;
/**
* Moves a terminal instance's group to the target instance group's position.
* @paramsource The source instance to move.
* @paramtarget The target instance to move the source instance to.
*/
moveGroup
(
:
<
>
,
:
)
:
void
;
moveGroupToEnd
(
:
<
>
)
:
void
;
moveInstance
(
:
,
:
,
:
'before'
|
'after'
)
:
void
;
unsplitInstance
(
:
)
:
void
;
joinInstances
(
:
[
]
)
:
void
;
instanceIsSplit
(
:
)
:
boolean
;
getGroupLabels
(
)
:
string
[
]
;
setActiveGroupByIndex
(
:
number
)
:
void
;
setActiveGroupToNext
(
)
:
void
;
setActiveGroupToPrevious
(
)
:
void
;
setActiveInstanceByIndex
(
:
number
)
:
void
;
setContainer
(
:
)
:
void
;
showPanel
(
?
:
boolean
)
:
Promise
<
void
>
;
hidePanel
(
)
:
void
;
focusTabs
(
)
:
void
;
focusHover
(
)
:
void
;
updateVisibility
(
)
:
void
;
}
/**
* An interface that indicates the implementer hosts terminal instances, exposing a common set of
* properties and events.
*/
export
interface
ITerminalInstanceHost
{
readonly
:
|
undefined
;
readonly
:
readonly
[
]
;
readonly
:
<
>
;
readonly
:
<
>
;
readonly
:
<
|
undefined
>
;
readonly
:
<
void
>
;
readonly
:
<
>
;
setActiveInstance
(
:
)
:
void
;
/**
* Reveal and focus the instance, regardless of its location.
*/
focusInstance
(
:
)
:
Promise
<
void
>
;
/**
* Reveal and focus the active instance, regardless of its location.
*/
focusActiveInstance
(
)
:
Promise
<
void
>
;
/**
* Gets an instance from a resource if it exists. This MUST be used instead of getInstanceFromId
* when you only know about a terminal's URI. (a URI's instance ID may not be this window's instance ID)
*/
getInstanceFromResource
(
:
|
undefined
)
:
|
undefined
;
}
/**
* Similar to xterm.js' ILinkProvider but using promises and hides xterm.js internals (like buffer
* positions, decorations, etc.) from the rest of vscode. This is the interface to use for
* workbench integrations.
*/
export
interface
ITerminalExternalLinkProvider
{
provideLinks
(
:
,
:
string
)
:
Promise
<
[
]
|
undefined
>
;
}
export
interface
ITerminalLink
{
/** The startIndex of the link in the line. */
:
number
;
/** The length of the link in the line. */
:
number
;
/** The descriptive label for what the link does when activated. */
?
:
string
;
/**
* Activates the link.
* @paramtext The text of the link.
*/
activate
(
:
string
)
:
void
;
}
export
interface
ISearchOptions
{
/** Whether the find should be done as a regex. */
?
:
boolean
;
/** Whether only whole words should match. */
?
:
boolean
;
/** Whether find should pay attention to case. */
?
:
boolean
;
/** Whether the search should start at the current search position (not the next row). */
?
:
boolean
;
}
export
interface
ITerminalInstance
extends
IBaseTerminalInstance
{
/**
* The ID of the terminal instance, this is an arbitrary number only used to uniquely identify
* terminal instances within a window.
*/
readonly
:
number
;
/**
* A unique URI for this terminal instance with the following encoding:
* path: /<workspace ID>/<instance ID>
* fragment: Title
* Note that when dragging terminals across windows, this will retain the original workspace ID /instance ID
* from the other window.
*/
readonly
:
URI
;
readonly
:
number
;
readonly
:
number
;
readonly
:
number
;
readonly
:
number
;
readonly
?
:
number
;
readonly
?
:
number
;
readonly
:
;
readonly
:
boolean
;
readonly
?
:
;
readonly
?
:
string
;
readonly
?
:
;
readonly
:
string
;
readonly
?
:
string
;
readonly
?
:
string
;
readonly
?
:
;
readonly
?
:
;
readonly
?
:
string
;
readonly
?
:
string
;
readonly
?
:
;
readonly
:
boolean
;
readonly
:
|
undefined
;
readonly
:
string
[
]
|
undefined
;
readonly
:
|
undefined
;
/**
* The underlying disposable store, allowing objects who share the same lifecycle as the
* terminal instance but are created externally to be managed by the instance.
*/
readonly
:
;
readonly
:
;
/**
* The process ID of the shell process, this is undefined when there is no process associated
* with this terminal.
*/
:
number
|
undefined
;
/**
* The position of the terminal.
*/
:
|
undefined
;
:
<
|
undefined
>
;
/**
* The id of a persistent process. This is defined if this is a terminal created by a pty host
* that supports reconnection.
*/
readonly
:
number
|
undefined
;
/**
* Whether the process should be persisted across reloads.
*/
readonly
:
boolean
;
/*
* Whether this terminal has been disposed of
*/
readonly
:
boolean
;
/**
* Whether the terminal's pty is hosted on a remote.
*/
readonly
:
boolean
;
/**
* The remote authority of the terminal's pty.
*/
readonly
:
string
|
undefined
;
/**
* Whether an element within this terminal is focused.
*/
readonly
:
boolean
;
/**
* The ID of the session that this terminal is connected to
*/
readonly
:
string
;
/**
* Get or set the behavior of the terminal when it closes. This was indented only to be called
* after reconnecting to a terminal.
*/
:
|
undefined
;
/**
* An event that fires when the terminal instance's title changes.
*/
readonly
:
<
>
;
/**
* An event that fires when the terminal instance's icon changes.
*/
readonly
:
<
{
:
;
:
boolean
}
>
;
/**
* An event that fires just before the terminal instance is disposed, while `xterm.js` and
* other instance-owned resources are still alive. Subscribe here if you need to clean up
* state that depends on those resources (e.g. xterm.js addons). For "the instance is gone"
* notifications, use {@link onDisposed} instead.
*/
readonly
:
<
>
;
/**
* An event that fires when the terminal instance is disposed, after `xterm.js` has been
* disposed.
*/
readonly
:
<
>
;
readonly
:
<
>
;
readonly
:
<
void
>
;
readonly
:
<
>
;
readonly
:
<
void
>
;
readonly
:
<
void
>
;
readonly
:
<
boolean
>
;
readonly
:
<
>
;
readonly
:
<
void
>
;
readonly
:
<
>
;
readonly
:
<
string
>
;
readonly
:
<
>
;
readonly
:
<
void
>
;
readonly
:
<
|
undefined
>
;
readonly
:
<
string
>
;
readonly
:
<
>
;
readonly
:
<
boolean
>
;
/**
* An event that fires when a terminal is dropped on this instance via drag and drop.
*/
readonly
:
<
>
;
/**
* Attach a listener to the raw data stream coming from the pty, including ANSI escape
* sequences.
*/
readonly
:
<
string
>
;
readonly
:
<
string
>
;
/**
* Attach a listener to the binary data stream coming from xterm and going to pty
*/
readonly
:
<
string
>
;
/**
* Attach a listener to listen for new lines added to this terminal instance.
*
* @paramlistener The listener function which takes new line strings added to the terminal,
* excluding ANSI escape sequences. The line event will fire when an LF character is added to
* the terminal (ie. the line is not wrapped). Note that this means that the line data will
* not fire for the last line, until either the line is ended with a LF character of the process
* is exited. The lineData string will contain the fully wrapped line, not containing any LF/CR
* characters.
*/
readonly
:
<
string
>
;
/**
* Attach a listener that fires when the terminal's pty process exits. The number in the event
* is the processes' exit code, an exit code of undefined means the process was killed as a result of
* the ITerminalInstance being disposed.
*/
readonly
:
<
number
|
|
undefined
>
;
/**
* The exit code or undefined when the terminal process hasn't yet exited or
* the process exit code could not be determined. Use {@link exitReason} to see
* why the process has exited.
*/
readonly
:
number
|
undefined
;
/**
* The reason the terminal process exited, this will be undefined if the process is still
* running.
*/
readonly
:
|
undefined
;
/**
* The xterm.js instance for this terminal.
*/
readonly
?
:
;
/**
* Resolves when the xterm.js instance for this terminal is ready.
*/
readonly
:
Promise
<
|
undefined
>
;
/**
* Returns an array of data events that have fired within the first 10 seconds. If this is
* called 10 seconds after the terminal has existed the result will be undefined. This is useful
* when objects that depend on the data events have delayed initialization, like extension
* hosts.
*/
readonly
:
string
[
]
|
undefined
;
/** A promise that resolves when the terminal's pty/process have been created. */
readonly
:
Promise
<
void
>
;
/** Whether the terminal's process has child processes (ie. is dirty/busy). */
readonly
:
boolean
;
/**
* The title of the terminal. This is either title or the process currently running or an
* explicit name given to the terminal instance through the extension API.
*/
readonly
:
string
;
/**
* How the current title was set.
*/
readonly
:
;
/**
* The shell type of the terminal.
*/
readonly
:
|
undefined
;
/**
* The focus state of the terminal before exiting.
*/
readonly
:
boolean
;
/**
* False when the title is set by an API or the user. We check this to make sure we
* do not override the title when the process title changes in the terminal.
*/
:
boolean
;
/**
* The shell launch config used to launch the shell.
*/
readonly
:
;
/**
* Whether to disable layout for the terminal. This is useful when the size of the terminal is
* being manipulating (e.g. adding a split pane) and we want the terminal to ignore particular
* resize events.
*/
:
boolean
;
/**
* The description of the terminal, this is typically displayed next to {@link title}.
*/
:
string
|
undefined
;
/**
* The remote-aware $HOME directory (or Windows equivalent) of the terminal.
*/
:
string
|
undefined
;
/**
* The nonce used to verify commands coming from shell integration.
*/
:
string
;
/**
* Registers and returns a marker
* @paramthe y offset from the cursor
*/
registerMarker
(
?
:
number
)
:
|
undefined
;
/**
* Adds a marker to the buffer, mapping it to an ID if provided.
*/
addBufferMarker
(
:
)
:
void
;
/**
*
* @paramstartMarkId The ID for the start marker
* @paramendMarkId The ID for the end marker
* @paramhighlight Whether the buffer from startMarker to endMarker
* should be highlighted
*/
scrollToMark
(
:
string
,
?
:
string
,
?
:
boolean
)
:
void
;
/**
* Dispose the terminal instance, removing it from the panel/service and freeing up resources.
*
* @paramreason The reason why the terminal is being disposed
*/
dispose
(
?
:
)
:
void
;
/**
* Informs the process that the terminal is now detached and
* then disposes the terminal.
*
* @paramreason The reason why the terminal is being disposed
*/
detachProcessAndDispose
(
:
)
:
Promise
<
void
>
;
/**
* When the panel is hidden or a terminal in the editor area becomes inactive, reset the focus context key
* to avoid issues like #147180.
*/
resetFocusContextKey
(
)
:
void
;
/**
* Focuses the terminal instance when it's ready (the xterm.js instance much exist). This is the
* best focus call when the terminal is being shown for example.
* when the terminal is being shown.
*
* @paramforce Force focus even if there is a selection.
*/
focusWhenReady
(
?
:
boolean
)
:
Promise
<
void
>
;
/**
* Send text to the terminal instance. The text is written to the stdin of the underlying pty
* process (shell) of the terminal instance.
*
* @paramtext The text to send.
* @paramshouldExecute Indicates that the text being sent should be executed rather than just inserted in the terminal.
* The character(s) added are \n or \r\n, depending on the platform. This defaults to `true`.
* @parambracketedPasteMode Whether to wrap the text in the bracketed paste mode sequence when
* it's enabled. When true, the shell will treat the text as if it were pasted into the shell,
* this may for example select the text and it will also ensure that the text will not be
* interpreted as a shell keybinding.
*/
sendText
(
:
string
,
:
boolean
,
?
:
boolean
)
:
Promise
<
void
>
;
/**
* Sends a signal to the terminal instance's process.
*
* @paramsignal The signal to send (e.g., 'SIGTERM', 'SIGINT', 'SIGKILL').
*/
sendSignal
(
:
string
)
:
Promise
<
void
>
;
/**
* Sends a path to the terminal instance, preparing it as needed based on the detected shell
* running within the terminal. The text is written to the stdin of the underlying pty process
* (shell) of the terminal instance.
*
* @paramoriginalPath The path to send.
* @paramshouldExecute Indicates that the text being sent should be executed rather than just inserted in the terminal.
* The character(s) added are \n or \r\n, depending on the platform. This defaults to `true`.
*/
sendPath
(
:
string
|
URI
,
:
boolean
)
:
Promise
<
void
>
;
runCommand
(
:
string
,
?
:
boolean
,
?
:
string
,
?
:
boolean
,
?
:
string
)
:
Promise
<
void
>
;
/**
* Takes a path and returns the properly escaped path to send to a given shell. On Windows, this
* includes trying to prepare the path for WSL if needed.
*
* @paramoriginalPath The path to be escaped and formatted.
*/
preparePathForShell
(
:
string
)
:
Promise
<
string
>
;
/**
* Formats a file system URI for display in UI so that it appears in the terminal shell's format.
* @paramuri The URI to format.
*/
getUriLabelForShell
(
:
URI
)
:
Promise
<
string
>
;
/** Scroll the terminal buffer down 1 line. */
scrollDownLine
(
)
:
void
;
/** Scroll the terminal buffer down 1 page. */
scrollDownPage
(
)
:
void
;
/** Scroll the terminal buffer to the bottom. */
scrollToBottom
(
)
:
void
;
/** Scroll the terminal buffer up 1 line. */
scrollUpLine
(
)
:
void
;
/** Scroll the terminal buffer up 1 page. */
scrollUpPage
(
)
:
void
;
/** Scroll the terminal buffer to the top. */
scrollToTop
(
)
:
void
;
/**
* Clears the terminal buffer, leaving only the prompt line and moving it to the top of the
* viewport.
*/
clearBuffer
(
)
:
void
;
/**
* Attaches the terminal instance to an element on the DOM, before this is called the terminal
* instance process may run in the background but cannot be displayed on the UI.
*
* @paramcontainer The element to attach the terminal instance to.
*/
attachToElement
(
:
)
:
void
;
/**
* Detaches the terminal instance from the terminal editor DOM element.
*/
detachFromElement
(
)
:
void
;
/**
* Layout the terminal instance.
*
* @paramdimension The dimensions of the container.
*/
layout
(
:
{
:
number
;
:
number
}
)
:
void
;
/**
* Sets whether the terminal instance's element is visible in the DOM.
*
* @paramvisible Whether the element is visible.
*/
setVisible
(
:
boolean
)
:
void
;
/**
* Immediately kills the terminal's current pty process and launches a new one to replace it.
*
* @paramshell The new launch configuration.
*/
reuseTerminal
(
:
)
:
Promise
<
void
>
;
/**
* Relaunches the terminal, killing it and reusing the launch config used initially. Any
* environment variable changes will be recalculated when this happens.
*/
relaunch
(
)
:
void
;
/**
* Sets the terminal instance's dimensions to the values provided via the onDidOverrideDimensions event,
* which allows overriding the regular dimensions (fit to the size of the panel).
*/
setOverrideDimensions
(
:
)
:
void
;
/**
* Sets the terminal instance's dimensions to the values provided via quick input.
*/
setFixedDimensions
(
)
:
Promise
<
void
>
;
/**
* Toggles terminal line wrapping.
*/
toggleSizeToContentWidth
(
)
:
Promise
<
void
>
;
/**
* Gets the initial current working directory, fetching it from the backend if required.
*/
getInitialCwd
(
)
:
Promise
<
string
>
;
/**
* Gets the current working directory from cwd detection capabilities if available, otherwise
* from the backend. This will return the initial cwd if cwd detection is not available (ie.
* on Windows when shell integration is disabled).
*/
getSpeculativeCwd
(
)
:
Promise
<
string
>
;
/**
* Gets the cwd as a URI that has been validated to exist.
*/
getCwdResource
(
)
:
Promise
<
URI
|
undefined
>
;
/**
* Sets the title of the terminal to the provided string. If no title is provided, it will reset
* to the terminal's title if it was not explicitly set by the user or API.
* @paramtitle The new title.
*/
rename
(
?
:
string
)
:
Promise
<
void
>
;
/**
* Sets or triggers a quick pick to change the icon of this terminal.
*/
changeIcon
(
?
:
)
:
Promise
<
|
undefined
>
;
/**
* Sets or triggers a quick pick to change the color of the associated terminal tab icon.
*/
changeColor
(
?
:
string
,
?
:
boolean
)
:
Promise
<
string
|
undefined
>
;
/**
* Attempts to detect and kill the process listening on specified port.
* If successful, places commandToRun on the command line
*/
freePortKillProcess
(
:
string
,
:
string
)
:
Promise
<
void
>
;
/**
* Update the parent context key service to use for this terminal instance.
*/
setParentContextKeyService
(
:
)
:
void
;
/**
* Handles a mouse event for the terminal, this may happen on an anscestor of the terminal
* instance's element.
* @paramevent The mouse event.
* @paramcontextMenu The context menu to show if needed.
* @returns Whether the context menu should be suppressed.
*/
handleMouseEvent
(
:
,
:
)
:
Promise
<
{
:
boolean
}
|
void
>
;
}
export
const
enum
{
=
20000
}
export
interface
IXtermAttachToElementOptions
{
/**
* Whether GPU rendering should be enabled for this element, defaults to true.
*/
:
boolean
;
}
export
interface
IXtermTerminal
extends
IDisposable
{
/**
* An object that tracks when commands are run and enables navigating and selecting between
* them.
*/
readonly
:
;
/**
* Reports the status of shell integration and fires events relating to it.
*/
readonly
:
;
readonly
:
;
readonly
:
<
void
>
;
readonly
:
<
{
:
number
;
:
number
}
>
;
readonly
:
<
{
:
;
?
:
boolean
}
>
;
readonly
:
<
{
:
}
>
;
/**
* Event fired when focus enters (fires with true) or leaves (false) the terminal.
*/
readonly
:
<
boolean
>
;
/**
* Fires after a search is performed.
*/
readonly
:
<
void
>
;
/**
* Fires before a search is performed.
*/
readonly
:
<
void
>
;
/**
* Gets a view of the current texture atlas used by the renderers.
*/
readonly
:
Promise
<
>
|
undefined
;
/**
* Whether the `disableStdin` option in xterm.js is set.
*/
readonly
:
boolean
;
/**
* Whether the terminal is currently focused.
*/
readonly
:
boolean
;
/**
* Whether a canvas-based renderer is being used.
*/
readonly
:
boolean
;
/**
* The last `onData` input event fired by {@link RawXtermTerminal.onData}.
*/
readonly
:
string
|
undefined
;
/**
* Attached the terminal to the given element
* @paramcontainer Container the terminal will be rendered in
* @paramoptions Additional options for mounting the terminal in an element
*/
attachToElement
(
:
,
?
:
<
>
)
:
void
;
?
:
{
:
number
;
:
number
}
;
/**
* Find the next instance of the term
*/
findNext
(
:
string
,
:
)
:
Promise
<
boolean
>
;
/**
* Find the previous instance of the term
*/
findPrevious
(
:
string
,
:
)
:
Promise
<
boolean
>
;
/**
* Forces the terminal to redraw its viewport.
*/
forceRedraw
(
)
:
void
;
/**
* Gets the font metrics of this xterm.js instance.
*/
getFont
(
)
:
;
/**
* Gets the content between two markers as VT sequences.
* @paramstartMarker The marker to start from. When not provided, will start from 0.
* @paramendMarker The marker to end at. When not provided, will end at the last line.
* @paramskipLastLine Whether the last line should be skipped (e.g. when it's the prompt line)
*/
getRangeAsVT
(
?
:
,
?
:
,
?
:
boolean
)
:
Promise
<
string
>
;
/**
* Gets whether there's any terminal selection.
*/
hasSelection
(
)
:
boolean
;
/**
* Clears any terminal selection.
*/
clearSelection
(
)
:
void
;
/**
* Selects all terminal contents/
*/
selectAll
(
)
:
void
;
/**
* Selects the content between the two markers by their VS Code OSC `SetMarker`
* ID. It's a no-op if either of the two markers are not found.
*
* @paramfromMarkerId Start marker ID
* @paramtoMarkerId End marker ID
* @paramscrollIntoView Whether the terminal should scroll to the start of
* the range, defaults tof alse
*/
selectMarkedRange
(
:
string
,
:
string
,
?
:
boolean
)
:
void
;
/**
* Copies the terminal selection.
* @paramcopyAsHtml Whether to copy selection as HTML, defaults to false.
*/
copySelection
(
?
:
boolean
,
?
:
)
:
void
;
/**
* Focuses the terminal. Warning: {@link ITerminalInstance.focus} should be
* preferred when dealing with terminal instances in order to get
* accessibility triggers.
*/
focus
(
)
:
void
;
/** Scroll the terminal buffer down 1 line. */
scrollDownLine
(
)
:
void
;
/** Scroll the terminal buffer down 1 page. */
scrollDownPage
(
)
:
void
;
/** Scroll the terminal buffer to the bottom. */
scrollToBottom
(
)
:
void
;
/** Scroll the terminal buffer up 1 line. */
scrollUpLine
(
)
:
void
;
/** Scroll the terminal buffer up 1 page. */
scrollUpPage
(
)
:
void
;
/** Scroll the terminal buffer to the top. */
scrollToTop
(
)
:
void
;
/** Scroll the terminal buffer to a set line */
scrollToLine
(
:
number
,
?
:
)
:
void
;
/**
* Clears the terminal buffer, leaving only the prompt line and moving it to the top of the
* viewport.
*/
clearBuffer
(
)
:
void
;
/**
* Clears the search result decorations
*/
clearSearchDecorations
(
)
:
void
;
/**
* Clears the active search result decorations
*/
clearActiveSearchDecoration
(
)
:
void
;
/**
* Returns a reverse iterator of buffer lines as strings
*/
getBufferReverseIterator
(
)
:
<
string
>
;
/**
* Gets the contents of the buffer from a start marker (or line 0) to the end marker (or the
* last line).
*/
getContentsAsText
(
?
:
,
?
:
)
:
string
;
/**
* Gets the buffer contents as HTML.
*/
getContentsAsHtml
(
)
:
Promise
<
string
>
;
/**
* Refreshes the terminal after it has been moved.
*/
refresh
(
)
:
void
;
getXtermTheme
(
?
:
)
:
;
}
export
interface
IDetachedXtermTerminal
extends
IXtermTerminal
{
/**
* Writes data to the terminal.
* @paramdata data to write
* @paramcallback Optional callback that fires when the data was processed
* by the parser.
*/
write
(
:
string
|
,
?
:
(
)
=>
void
)
:
void
;
/**
* Resizes the terminal.
*/
resize
(
:
number
,
:
number
)
:
void
;
/**
* Performs a full reset (RIS) of the terminal, clearing all content
* and resetting cursor position to the origin.
*/
reset
(
)
:
void
;
/**
* Updates the terminal configuration from current settings.
*/
updateConfig
(
)
:
void
;
/**
* Updates the terminal theme from the current color theme.
*/
updateTheme
(
)
:
void
;
/**
* Updates the xterm log level to match the given VS Code log level.
*/
updateLogLevel
(
)
:
void
;
/**
* Access to the terminal buffer for reading cursor position and content.
*/
readonly
:
;
/**
* The number of columns in the terminal.
*/
readonly
:
number
;
}
export
interface
IInternalXtermTerminal
{
/**
* Writes text directly to the terminal, bypassing the process.
*
* **WARNING:** This should never be used outside of the terminal component and only for
* developer purposed inside the terminal component.
*/