-
-
Notifications
You must be signed in to change notification settings - Fork 661
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
GNU ls columns #1
Comments
Yay, thanks for this. I relicenced exa to MIT because that seemed to be the main one round these here parts, so there's now no issue of code sharing. I'm going to take a look at your code and probably steal some of it because I can't bend my mind about the way that ls calculates the rows and columns. |
Started working on this today in the grid-view branch. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You've been asking about how to calculate the columns.
First you'll have to calculate the the widths of strings which isn't easy when you have unicode file names: here
Then you'll have to get the width of the terminal: here (tested only on linux)
Then you'll have to calculate the actual widths of the columns the way GNU ls does it: here (this is very similar to the way GNU ls does it)
This code is from my own ls implementation which I'm too lazy to continue. If you want you can use it under the MIT license.
The text was updated successfully, but these errors were encountered: