8000 interactive filter · Issue #443 · pamburus/hl · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

interactive 8000 filter #443

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

Open
slavaGanzin opened this issue Sep 17, 2024 · 5 comments
Open

interactive filter #443

slavaGanzin opened this issue Sep 17, 2024 · 5 comments

Comments

@slavaGanzin
Copy link

Hi. Awesome work

But I didn't get why user can't change filtering options in interactive mode. Coming from HyperDX land, that's unexpected.

@pamburus
Copy link
Owner

Hi, thanks.
Yes, an interactive mode would be very useful.
I've been thinking about it lately, I'll probably try to implement something soon.
I just wanted to finish one more feature first.

@LeeTeng2001
Copy link

bump

@LeeTeng2001
Copy link

any pinpoint on this? I can work on this issue

@LeeTeng2001
Copy link

I feel like if we were to support this feature, hl must provides its own terminal viewer based on other rust lib instead of relying on external viewer command tools such as less. On top of that, less is not available on Windows which is a pain to use.

@pamburus
Copy link
Owner
pamburus commented Feb 19, 2025

I agree that installing Less on Windows is not as easy as it may seem.
There are several ways to get Less on Windows.

  1. Install jftuga/less-Windows. This link can be found on the official website. I tried it and can say that it is quite buggy, at least visually. It breaks a lot of ANSI escape sequences and everything looks kind of crooked. It also seems to be quite slow.
  2. Build it from source with Virtual Studio or with gcc for mingw64. I have not tried this yet, it requires too much effort.
  3. Install it from Scoop with scoop install less.
  4. Install it from Chocolatey with choco install less.

The builds from both the Scoop and Chocolatey repositories work perfectly on Windows 11 2024H2 and Windows Terminal. Nothing is broken and the performance is impressive.
Added corresponding notes to the README.md for the Windows users about the proper way to install Less on Windows.

Please try this first, and if you still feel that adding TUI to hl is very necessary, and can't wait and you have enough desire and time for it, you can at least try to make a prototype. But be warned, the current project structure is a bit messy. This is my first project in Rust, and I struggled a lot until I got some experience and confidence in Rust. So, I don't think the current state of the project is well suited for active open contributions of such significant size as TUI support. If you can find a way to create a prototype without refactoring existing code, you're welcome. I think using ratatui is probably the best way. But I really doubt that it is possible to add TUI support without significant refactoring of the existing code.

I would like to avoid adding another refactoring at this point, because I am already in the middle of a massive refactoring of the internal data model and parsing. Since I only work on this project when I have some free time and am not overloaded with my main job, I expect this refactoring to be finished in a month or two at best. And I believe that this refactoring will make it much easier to add TUI support. At least it gets rid of annoying lifetime parameters and allows free passing of individual log records. Currently, everything is tied to arena-allocated segments and all records borrow the source data from the segment. However, I have a feeling that it will probably require another refactoring or two. For example, it seems to me that loading data in the opposite or random direction on demand will require additional refactoring. Currently, the pipeline is set up once and then all data is processed according to the sequence originally set up with the pipeline. There is some random access stuff in --sort mode, but I don't think it will fit perfectly in TUI scenarios.

Probably the easiest way to add a minimalist TUI without refactoring existing code, and that behaves similarly to Less, is to just make it work at the binary stream level over some pipes or channels. But I don't see much point in that, except that it allows you to use the built-in pager without any additional binary dependencies. Installing Less is not that difficult. If you want to make a generic pager that is an alternative to Less, you can do it as a separate project, but this will involve a lot of pain in handling ANSI escape sequences and other control characters.

The real value of adding TUI is the ability to conveniently navigate between log records, change filters on the fly, toggle other display options such as sorting, or hide/show some fields that clutter the screen, focus on some fields of interest, going back to the previous view, and so on. That's not an easy task, but I think that's where this project needs to go.

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

No branches or pull requests

3 participants
0