Project

General

Profile

Feature #49

Do not use more characters in a line than terminal width.

Added by Robin Hahling over 8 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
-
Start date:
03/28/2012
Due date:
% Done:

0%

Estimated time:

Description

Do not use more characters in a line than terminal width.


Related issues

Related to Feature #48: Do not use more than 80 character when output is pipedClosed03/28/2012

Actions

History

#1

Updated by Robin Hahling over 8 years ago

When I started to write dfc, I thought that I would make the ouput fit 80 columns. But when I kept adding new options and information, I realized that this was impossible.

Maybe you can give me more information about how you would like the output but personally, I have no clue. What I could implement, however, is an option to not display the bar but I guess this does not really answer the question.

#2

Updated by Christian Hesse over 8 years ago

I would not show the type column by default. df does neither but has a switch -T for that.

Todays long device paths are a problem as well... "/dev/mapper/cvg-home" takes a lot of space. If required you could line break after devices that are longer than x character and make sure that the other columns are aligned correctly.

Another idea would be to replace the device path by the file system label, possibly with square brackets around it. "/dev/mapper/cvg-home" would become "[home]" for me.

#3

Updated by Robin Hahling over 8 years ago

The first thing you point out (do not show the type by default but use -T switch for that has been implemented in version 2.1.0.

I totally agree about the "too long path" problem. I thought about doing exactly what you suggested. ;)

However, I do not think I will implement the "bracket" idea. Truncating the name is done more easily and it can be done without loosing to much information. For instance, "/dev/mapper/cvg-home" would become something like "+per/cvg-home" depending on how many characters I keep.

#4

Updated by Anonymous over 8 years ago

Ok, I'm fine with truncating. ;)

#5

Updated by Sylvain Laperche over 8 years ago

When you will begin to implement this feature, you can use the following snippet to retrieve the number of columns provided by the terminal (this code handle the resizing). ************************************************************************
#include <sys/ioctl.h>
#include <stdio.h>
#include <unistd.h>

/*

#6

Updated by Sylvain Laperche over 8 years ago

Shit, the layout is a mess with the code >_<

#7

Updated by Robin Hahling over 8 years ago

  • Status changed from New to Closed

Yep, layout can bring some headache :P

I think that what you're trying to tell me to do is what I already implemented about 12 hours ago (see this commit: http://projects.gw-computing.net/projects/dfc/repository/revisions/809aea1edbaa56334c1db92f463a9e6a606967d4/diff)

I guess feature #65 closes this one. If you do not agree, please, comment and motivate.

Also available in: Atom PDF