-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Description
Currently, when a symbolic link points to a directory, bcd correctly cd's into it. However, when a symbolic link points to a file, the behavior is unclear or may not work as expected.
Expected Behavior
When selecting a symbolic link that points to a file, bcd should cd into the parent directory of the symlink itself (not the target file's directory).
Example:
/home/user/projects/mylink -> /etc/config/file.conf
When selecting mylink, should cd to /home/user/projects/
Current Behavior
Unknown - needs testing to confirm current behavior with file symlinks.
Proposed Solution
- Detect if the selected path is a symbolic link
- If it points to a file, resolve to the symlink's parent directory
- If it points to a directory, keep current behavior (cd into it)
Implementation Location
- Shell integration functions (
scripts/bcd.bash,scripts/bcd.zsh,scripts/bcd.fish) - The logic in the
if [[ -f "$selected_path" ]]branch may need to check for symlinks
Acceptance Criteria
- Selecting a symlink pointing to a file cd's to the symlink's parent directory
- Selecting a symlink pointing to a directory cd's into that directory
- Selecting a regular file cd's to its parent directory (existing behavior)
- Selecting a regular directory cd's into it (existing behavior)
Metadata
Metadata
Assignees
Labels
No labels