Show in system explorer on Windows

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
exploreropen

Did you follow the troubleshooting guide? [Y/N]

Expected result

Actual result

Environment


Additional information

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
gif 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)

I was fed up to have this bug even after a fresh installation under windows 11
so I did a fix if someone needs it

1 Like

I still can’t reproduce it.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.