Steps to reproduce
After doing this command I have to click 3 or 4 times on the folder shortcut, in Windows taskbar, before I can show the window
After doing this command I have to click 3 or 4 times on the folder shortcut, in Windows taskbar, before I can show the window
works for me in the sandbox vault.
this bug seems to come from not having an await
I’ve just did this function on a button. without the await I have exactly the same behaviour
with the await it’s opening right in front. I saw on the discord someone else telling it
async function openDirectoryInFileManager() {
const filePath = (app as any).vault.adapter.getFullPath(pluginItem.dir);
const directoryPath = path.dirname(filePath);
try {
await shell.openPath(directoryPath); // this await
console.log('Directory opened in the file manager.');
} catch (err) {
console.error(`Error opening the directory: ${err.message}`);
}
}
openDirectoryInFileManager();
What I think happens is that you have something in your vault that takes the focus back from file explorer.
Can you provide a screen recording of this happening in the sandbox vault?
Ok the sandbox
I deactivated all plugins at start in windows
I deactivated all plugins in Obsidian. still happening. → ok this is what sandbox is for
If obsidian is not in full screen, it’s not doing it.
once you did it (clicking until it shows), it’s not doing it again until an obsidian restart (for this obsidian cession)