MCPcopy
hub / github.com/ZToolsCenter/ZTools / killCurrentPlugin

Method killCurrentPlugin

src/main/managers/pluginManager.ts:1173–1190  ·  view source on GitHub ↗

* 终止当前插件并返回搜索页面 * 用于 Cmd+Q / Ctrl+Q 快捷键

()

Source from the content-addressed store, hash-verified

1171 * 用于 Cmd+Q / Ctrl+Q 快捷键
1172 */
1173 public killCurrentPlugin(): void {
1174 if (!this.currentPluginPath) {
1175 console.log('[Plugin] 没有正在运行的插件')
1176 return
1177 }
1178
1179 const pluginPath = this.currentPluginPath
1180
1181 // 终止插件
1182 const success = this.killPlugin(pluginPath)
1183
1184 if (success && this.mainWindow) {
1185 windowManager.notifyBackToSearch()
1186 // 主窗口获取焦点
1187 this.mainWindow.webContents.focus()
1188 console.log('[Plugin] 已终止插件并返回搜索页面')
1189 }
1190 }
1191
1192 // 发送输入事件到当前插件(统一接口)
1193 public sendInputEvent(

Callers 1

Calls 3

killPluginMethod · 0.95
notifyBackToSearchMethod · 0.80
focusMethod · 0.80

Tested by

no test coverage detected