module.exports = async (params) => { const { app } = params; // 获取当前仓库路径 const vaultPath = app.vault.adapter.basePath; // 构建 Windows Terminal 命令 const command = `wt -d "${vaultPath}"`; // 使用 Node.js child_process 执行命令 const { exec } = require('child_process'); exec(command, (error, stdout, stderr) => { if (error) { console.error('执行失败:', error); new Notice('无法打开终端'); return; } console.log('终端已打开'); }); };