Skip to main content

Interface: ProviderConnectionShellAccess

Callback for openning shell session

Methods

open()

open(): ProviderConnectionShellAccessSession

Opens new session using ProviderConnectionShellAccessImpl class

Returns

ProviderConnectionShellAccessSession

Example

import * as api from '@podman-desktop/api';

class ProviderConnectionShellAccessImpl implements ProviderConnectionShellAccess {
open(): ProviderConnectionShellAccessSession {
// This is client that will connect to your shell
#client = new Client();

// You need to listen to events from client and forward them to the caller by using the object returned below

return {
onData,
onError,
onEnd,
write,
resize,
close,
};
}
}

export async function activate(extensionContext: api.ExtensionContext): Promise<void> {
const providerConnectionShellAccess = new ProviderConnectionShellAccessImpl(machineInfo);

// Create containerProviderConnection object
const containerProviderConnection: extensionApi.ContainerProviderConnection = {
...
shellAccess: providerConnectionShellAccess,
...
};

const disposable = provider.registerContainerProviderConnection(containerProviderConnection);
extensionContext.subscriptions.push(disposable);
}

Defined in

packages/extension-api/src/extension-api.d.ts:833