Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Truncated filenames in terminal output #787

Closed
arialdomartini opened this issue Aug 26, 2024 · 3 comments · Fixed by #794
Closed

Truncated filenames in terminal output #787

arialdomartini opened this issue Aug 26, 2024 · 3 comments · Fixed by #794

Comments

@arialdomartini
Copy link

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.

image

It would be cool if the progress output could display more characters.

@schollz
Copy link
Owner

schollz commented Aug 26, 2024

Please submit pr!

@arialdomartini
Copy link
Author

arialdomartini commented Aug 27, 2024

I found several places where truncation is performed:

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.

@schollz
Copy link
Owner

schollz commented Aug 27, 2024

Let me know if it does work! Happy to have the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants