Give the terminal and folder grant services to each plugin session
Bind the native terminal service and the folder grant service of the plugin to its ExternalSession. Without this change, api.pty and api.files are absent.
This commit is contained in:
@@ -5,6 +5,7 @@ import { listen } from "@tauri-apps/api/event";
|
||||
import { workspaceList, workspaceRead, workspaceReadBytes, workspaceWrite } from "../workspace/api";
|
||||
import { gitApi } from "../git/service";
|
||||
import { ExternalSession, deadline } from "./externalSession";
|
||||
import { filesTransport, ptyTransport } from "./nativeServices";
|
||||
import { pluginAccess, type PluginTool } from "./access";
|
||||
import { containsPane, splitPane, removePane, type SplitLayout } from "../workspace/splitLayout";
|
||||
import type { PluginViewOpenOptions } from "./sdk";
|
||||
@@ -253,6 +254,8 @@ async function activate(row: InstalledPlugin, builtin?: PluginModule) {
|
||||
const session = new ExternalSession(id, {
|
||||
completionTransport,
|
||||
git: gitApi,
|
||||
pty: ptyTransport,
|
||||
files: filesTransport(id),
|
||||
backgrounds: {
|
||||
chooseFolder: () => invoke<string | null>('backgrounds_choose_folder', { id }),
|
||||
defaultFolder: () => invoke<string>('backgrounds_default_folder', { id }),
|
||||
|
||||
Reference in New Issue
Block a user