You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice if histdb allowed the user to specify the maximum width of each of the fields in histdb's output, and then wrap long lines to fit in to those fields.
Currently, the "column" command through which histdb pipes its output to only wrap once the entire line exceeds the screen width, and the wrapping only happens where the line exceeds the screen width.
This causes really awkward displays of histdb output which contains some really long cwd and/or commands. Just one such long line with, say, a really long cwd, will cause the cmd field to be displayed far to the right with lots of wasted whitespace in between, making visually connecting most of the commands with the cwd's more difficult than it could be if field widths were limited to something narrower.
The other problem is that when the "column" command does wrap, it doesn't keep the wrapping inside the relevant field, but starts prints the excess starting with the left-most column of the next line. This behavior is helpful when one needs to copy the long line using a terminal that can't narrow the selection to just between certain columns on the screen, or where preserving of the original whitespace in the command matters. But it visually messes up the screen and makes it hard to read through lots of histdb output.
All these use cases could be accommodated if there was an option to set field widths to arbitrary values (with perhaps some way of setting a value of "unlimited" for each field -- which appears to be the current default behavior) and wrap properly within those field widths.
The text was updated successfully, but these errors were encountered:
I'm actually reconsidering this feature request, because its implementation will probably unecessarily bloat-up histdb.
As long as histdb can output its fields with clearly distinguishable separators (which it already does, if you take out the pipe to the "column" command), then it can probably be left up to the user to do further formatting of that output.
So I think it might make more sense to just let the field separator be user-configurable through an option, and have another option to feed the output through the "column" command or not. That would allow histdb to stay lean and yet give the user access to the raw field values to wrap themselves, if they want.
Yeah, this is slightly poor UI, but I get the column-ing for free by using column. I don't want to write a width-aware version of column in zsh. Usually if something wraps and I don't want it to, I just pipe it to less or most or similar and scroll right.
I think it would be nice if someone produced a better version of column that could do this job right though.
I'll add some options for separator / column stuff.
It would be nice if histdb allowed the user to specify the maximum width of each of the fields in histdb's output, and then wrap long lines to fit in to those fields.
Currently, the "column" command through which histdb pipes its output to only wrap once the entire line exceeds the screen width, and the wrapping only happens where the line exceeds the screen width.
This causes really awkward displays of histdb output which contains some really long cwd and/or commands. Just one such long line with, say, a really long cwd, will cause the cmd field to be displayed far to the right with lots of wasted whitespace in between, making visually connecting most of the commands with the cwd's more difficult than it could be if field widths were limited to something narrower.
The other problem is that when the "column" command does wrap, it doesn't keep the wrapping inside the relevant field, but starts prints the excess starting with the left-most column of the next line. This behavior is helpful when one needs to copy the long line using a terminal that can't narrow the selection to just between certain columns on the screen, or where preserving of the original whitespace in the command matters. But it visually messes up the screen and makes it hard to read through lots of histdb output.
All these use cases could be accommodated if there was an option to set field widths to arbitrary values (with perhaps some way of setting a value of "unlimited" for each field -- which appears to be the current default behavior) and wrap properly within those field widths.
The text was updated successfully, but these errors were encountered: