Truncated filenames in terminal output
Hey! I think croc is amazing!
A minor suggestion I have is about how it truncates file and folder names to 16 characters in the progress output when sending or receiving files, regardless of available terminal space. This can be inconvenient, particularly when transferring folders or files with names that differ only in their final characters (such as sequentially numbered files).
Upon reviewing issue #195, I incorrectly assumed that croc would utilize the maximum available terminal space to display file names.
It would be cool if the progress output could display more characters.
Please submit pr!
I found several places where truncation is performed:
- https://github.com/schollz/croc/blob/main/src/utils/utils.go#L133
- https://github.com/schollz/croc/blob/main/src/utils/utils.go#L167
- https://github.com/schollz/croc/blob/main/src/croc/croc.go#L1731
- https://github.com/schollz/croc/blob/main/src/croc/croc.go#L1910
I could just replace 20 with a larger number: would this work?
Alternatively, one could calculate the width of terminal with:
width, _, err := term.GetSize(int(os.Stdout.Fd()))
I'm not a Go programmer, so I'm just assuming.
Let me know if it does work! Happy to have the PR