Skip to content

Hide columns on Ctrl+T - #308

Open
GRbit wants to merge 1 commit into
ddworken:masterfrom
GRbit:hide-columns
Open

GRbit wants to merge 1 commit into
ddworken:masterfrom
GRbit:hide-columns

Conversation

@GRbit

@GRbit GRbit commented Mar 16, 2025

Copy link
Copy Markdown
Contributor

Hi there!

I've made a cool feature which I use a lot, and finally found time to refine the code and make a PR.
Now there is a hotkey to hide all the columns but the "Command".

In a small terminal window when I search for commands, it could be just impossible to find the command you need. Look at this:
image
But once I press Ctrl+T, it becomes much clearer:
image

The only bad thing. It's a bit hard for me to figure out how to write proper tests for it...

It would be very nice to get a couple of hints on how to do this, or at least to know if the feature looks good to you and you want to have. Knowing that I'm not the only one who wants it would give me some motivation.

Pressing ctrl+t (configurable via `hishtory config-set key-bindings
hide-columns`) toggles the search table between the configured columns
and a Command-only view.

The hidden state lives only in the TUI model: both directions of the
toggle re-run the search query with the reduced or full column list, so
every table rebuild path (resize, delete, filter changes) stays
consistent. The column-width cache is keyed by the displayed column set
because cached rows from one set can be wider than another, which
otherwise causes an out-of-range panic.
@GRbit GRbit changed the title WIP: hide columns Hide columns on Ctrl+T Jul 21, 2026
@GRbit

GRbit commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

Hey @ddworken ,
I've updated the PR changing the approach a bit (found a bug with crashing in some cases) and adding tests for this feature.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant