lsd-rs / lsd-rs/lsd

[Bug]: symlink issues

Open
#1,144 0 comments 0 reactions 1 assignee View on GitHub

@zwpaper is already working on this.

Since Jun 20, 2025.

Dominant language
Rust
Stars
16.2k
Forks
510
PR merge metrics
No merged PRs in 30d

Description

### Version

- [x] latest

### version

havoq@vbox:~/src/helix/contrib> \lsd --version
lsd 1.1.5

Symlink issues:
0. Un-flagged 'long' : This is the typical and expected output of an 'lsd -l' listing.
```
havoq@vbox:~/src/helix/contrib> \lsd -l
d0755. havoq havoq 2025-06-20 00:21:13 62B -- completion
.0644. havoq havoq 2025-06-20 00:21:13 264K -- helix-256p.ico
.0644. havoq havoq 2025-06-20 00:21:13 4.6K -- Helix.appdata.xml
.0644. havoq havoq 2025-06-20 00:21:13 4.0K -- Helix.desktop
.0644. havoq havoq 2025-06-20 00:21:13 15K -- helix.png
.0755. havoq havoq 2025-06-20 00:21:13 84B -- hx_launcher.sh
l0777. havoq havoq 2025-06-20 00:21:13 17B -- themes ⇒ ../runtime/themes
```
1. -L : When using -L to show size of target link directory, this also removes the target notation in the output. Since there is a separate flag for this (--no-symlink) it should leave the 'name -> target' output alone and only modify the dir-size output.

```
havoq@vbox:~/src/helix/contrib> \lsd -lL
d0755. havoq havoq 2025-06-20 00:21:13 62B -- completion
.0644. havoq havoq 2025-06-20 00:21:13 264K -- helix-256p.ico
.0644. havoq havoq 2025-06-20 00:21:13 4.6K -- Helix.appdata.xml
.0644. havoq havoq 2025-06-20 00:21:13 4.0K -- Helix.desktop
.0644. havoq havoq 2025-06-20 00:21:13 15K -- helix.png
.0755. havoq havoq 2025-06-20 00:21:13 84B -- hx_launcher.sh
d0755. havoq havoq 2025-06-20 00:21:13 5.8K -- themes
```
2. --total-size : This flag does not affect symlinks but likely should and deprecate the -L flag or make them synonymous.

```
havoq@vbox:~/src/helix/contrib> lsd -l --total-size
d0755. havoq havoq 2025-06-20 00:21:13 6.9K -- completion
.0644. havoq havoq 2025-06-20 00:21:13 264K -- helix-256p.ico
.0644. havoq havoq 2025-06-20 00:21:13 4.6K -- Helix.appdata.xml
.0644. havoq havoq 2025-06-20 00:21:13 4.0K -- Helix.desktop
.0644. havoq havoq 2025-06-20 00:21:13 15K -- helix.png
.0755. havoq havoq 2025-06-20 00:21:13 84B -- hx_launcher.sh
l0777. havoq havoq 2025-06-20 00:21:13 17B -- themes ⇒ ../runtime/themes
```

3. -L --total-size : When these flags are used together, the directory sizes are correct; however, the symlinks revert to size '0' even though the -L flag was supplied. Also, the aforementioned de-referencing happens in this combination as well.

```
havoq@vbox:~/src/helix/contrib> lsd -lL --total-size
d0755. havoq havoq 2025-06-20 00:21:13 6.9K -- completion
.0644. havoq havoq 2025-06-20 00:21:13 264K -- helix-256p.ico
.0644. havoq havoq 2025-06-20 00:21:13 4.6K -- Helix.appdata.xml
.0644. havoq havoq 2025-06-20 00:21:13 4.0K -- Helix.desktop
.0644. havoq havoq 2025-06-20 00:21:13 15K -- helix.png
.0755. havoq havoq 2025-06-20 00:21:13 84B -- hx_launcher.sh
d0755. havoq havoq 2025-06-20 00:21:13 0B -- themes
```

TLDR:
lsd needs some love on the routines that affect size and display of information on directories and symlinks.

### What OS are you seeing the problem on?

Linux

### installation

Package Delivery

### term

havoq@vbox:~/src/helix/contrib> echo $TERM
xterm-256color

### ls-colors

havoq@vbox:~/src/helix/contrib> echo $LS_COLORS

### What happened?

```markdown
Notated also in lsd-version segment since 'code' formatting is not supported in this field.

Symlink issues:
0. Un-flagged 'long' : This is the typical and expected output of an 'lsd -l' listing.

havoq@vbox:~/src/helix/contrib> \lsd -l
d0755. havoq havoq 2025-06-20 00:21:13 62B -- completion
.0644. havoq havoq 2025-06-20 00:21:13 264K -- helix-256p.ico
.0644. havoq havoq 2025-06-20 00:21:13 4.6K -- Helix.appdata.xml
.0644. havoq havoq 2025-06-20 00:21:13 4.0K -- Helix.desktop
.0644. havoq havoq 2025-06-20 00:21:13 15K -- helix.png
.0755. havoq havoq 2025-06-20 00:21:13 84B -- hx_launcher.sh
l0777. havoq havoq 2025-06-20 00:21:13 17B -- themes ⇒ ../runtime/themes

1. -L : When using -L to show size of target link directory, this also removes the target notation in the output. Since there is a separate flag for this (--no-symlink) it should leave the 'name -> target' output alone and only modify the dir-size output.

havoq@vbox:~/src/helix/contrib> \lsd -lL
d0755. havoq havoq 2025-06-20 00:21:13 62B -- completion
.0644. havoq havoq 2025-06-20 00:21:13 264K -- helix-256p.ico
.0644. havoq havoq 2025-06-20 00:21:13 4.6K -- Helix.appdata.xml
.0644. havoq havoq 2025-06-20 00:21:13 4.0K -- Helix.desktop
.0644. havoq havoq 2025-06-20 00:21:13 15K -- helix.png
.0755. havoq havoq 2025-06-20 00:21:13 84B -- hx_launcher.sh
d0755. havoq havoq 2025-06-20 00:21:13 5.8K -- themes

2. --total-size : This flag does not affect symlinks but likely should and deprecate the -L flag or make them synonymous.

havoq@vbox:~/src/helix/contrib> lsd -l --total-size
d0755. havoq havoq 2025-06-20 00:21:13 6.9K -- completion
.0644. havoq havoq 2025-06-20 00:21:13 264K -- helix-256p.ico
.0644. havoq havoq 2025-06-20 00:21:13 4.6K -- Helix.appdata.xml
.0644. havoq havoq 2025-06-20 00:21:13 4.0K -- Helix.desktop
.0644. havoq havoq 2025-06-20 00:21:13 15K -- helix.png
.0755. havoq havoq 2025-06-20 00:21:13 84B -- hx_launcher.sh
l0777. havoq havoq 2025-06-20 00:21:13 17B -- themes ⇒ ../runtime/themes

3. -L --total-size : When these flags are used together, the directory sizes are correct; however, the symlinks revert to size '0' even though the -L flag was supplied. Also, the aforementioned de-referencing happens in this combination as well.

havoq@vbox:~/src/helix/contrib> lsd -lL --total-size
d0755. havoq havoq 2025-06-20 00:21:13 6.9K -- completion
.0644. havoq havoq 2025-06-20 00:21:13 264K -- helix-256p.ico
.0644. havoq havoq 2025-06-20 00:21:13 4.6K -- Helix.appdata.xml
.0644. havoq havoq 2025-06-20 00:21:13 4.0K -- Helix.desktop
.0644. havoq havoq 2025-06-20 00:21:13 15K -- helix.png
.0755. havoq havoq 2025-06-20 00:21:13 84B -- hx_launcher.sh
d0755. havoq havoq 2025-06-20 00:21:13 0B -- themes

TLDR:
lsd needs some love on the routines that affect size and display of information on directories and symlinks.
```

### What expected?

```markdown
--See above--
```

### What else?

```markdown
I verified that this behavior is consistent on linux, Windows (Git Bash shell), and Windows PowerShell.
```

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.