vinnymeller / twm

Tmux Workspace Manager
MIT License
35 stars 3 forks source link

No handling for symbolink links #40

Closed Zstorm999 closed 1 month ago

Zstorm999 commented 1 month ago

Hello !

I have been using twm for a few month, and I’m very satisfied with it, however I recently noticed a small issue: workspaces are not found when behind a symbolic link.

I tracked this down to a limitation in src/matches.rs, at line 25:

        .filter(|e| {
            e.file_type().is_dir()
                // this can definitely be improved in the future 
                && !e.path().components().any(|c| match c.as_os_str().to_str() {
                    Some(s) => config.exclude_path_components.iter().any(|e| s == e),
                    None => true,
                })
        })

There is a specific function is_symlink() on the result of file_type() to handle this case.

Zstorm999 commented 1 month ago

Fixed in #41