walles / moar

Moar is a pager. It's designed to just do the right thing without any configuration.
Other
587 stars 17 forks source link

reading large compressed file with maor and press ESC to quit cause cli freeze #172

Closed ciscohack closed 6 months ago

ciscohack commented 6 months ago

Hi Johan,

On the latest moar version CLI freezes when reading a large compressed file and pipes with ack for certain keywords. you can see in below screenshot after pressing ESC or quit key nothing happening and it stuck in prompt

image
ciscohack commented 6 months ago

I see the issue is happening with the alias "alias mo='ct moar -style=catppuccin-macchiato'"

I also noticed reading compressed file with moar and pipe with ack for searching any keyword but it failed to search and produce output

ct is a syntax highlighter tool .. more details are in below reference link below. Can you please fix this? https://github.com/hSaria/ChromaTerm

walles commented 6 months ago

Since moar's output is going to a pipe, moar will just pass its input file right through.

The reason ack isn't finding anything is that it's trying to search compressed input.

Using cat instead of moar would get you the same result.

ciscohack commented 6 months ago

@walles Thanks for the comment. ok, the cat does not support compressed files so not tried but if that is the case then pipe option cli stuck seems not the right thing. also noticed while search in moar also freeze cli for few second if you typed the keyword incorrectly and keyword not present in searched file

walles commented 6 months ago

To search a gzipped file from the command line (moar not involved):

gunzip -c cluster_trace.log.gz | ack 'CRIT'

If you have problems when searching by pressing / inside of moar, then:

  1. How large was the input?
  2. Was it compressed?
ciscohack commented 6 months ago

To search a gzipped file from the command line (moar not involved):

gunzip -c cluster_trace.log.gz | ack 'CRIT'

If you have problems when searching by pressing / inside of moar, then:

  1. How large was the input?
  2. Was it compressed?

Ok, I thought since Moar is able to reach compressed files without extracting file.. it is able to grep keywords also but thanks for clarification.

Yes file is very large 1M lines if log..compressed and uncompressed but freeze with / search for few sec in case of wrong typo or sometime with correct keyword

walles commented 6 months ago

Can you do this and post the result?

gunzip -c cluster_trace.log.gz | wc 

This will tell me how many lines and chars there are in your log file.

ciscohack commented 6 months ago

Can you do this and post the result?

gunzip -c cluster_trace.log.gz | wc 

This will tell me how many lines and chars there are in your log file.

This file is still small but I used log file even bigger in size... Here is the result of your requested command

gunzip -c cluster_trace.log.gz | wc
7866 103841 885450

here is bigger file size info

moar sw-techsupport | wc
925120 4953043 46990036

walles commented 6 months ago

Cool, so about 1M lines, 5M words and 50MB size.

ciscohack commented 6 months ago

@walles I have noticed one more issue if you use chromaterm (https://github.com/hSaria/ChromaTerm) and create alias like

mo = "ct moar" and then if run mo and pipe anything to this example mo | wc ..it freeze the cli or tab and ctrl + c/z/d nothing works ..... I suggested please fix this also

walles commented 6 months ago

@walles I have noticed one more issue if you use chromaterm (https://github.com/hSaria/ChromaTerm) and create alias like

mo = "ct moar" and then if run mo and pipe anything to this example mo | wc ..it freeze the cli or tab and ctrl + c/z/d nothing works ..... I suggested please fix this also

Please open a separate issue for this.

ciscohack commented 6 months ago

@walles I have noticed one more issue if you use chromaterm (https://github.com/hSaria/ChromaTerm) and create alias like mo = "ct moar" and then if run mo and pipe anything to this example mo | wc ..it freeze the cli or tab and ctrl + c/z/d nothing works ..... I suggested please fix this also

Please open a separate issue for this.

The issue mentioned in this ticket is the same, right? I just added more conditions to it

walles commented 6 months ago

There are at least three separate issues reported in here:

Kindly open separate issues for these.

ciscohack commented 6 months ago

Sure thanks Opened 3 tickets as suggested. Hope you are now aware of all the reported scenarios... I am travelling so will be unable.

walles commented 6 months ago

On the latest moar version CLI freezes when reading a large compressed file and pipes with ack for certain keywords. you can see in below screenshot after pressing ESC or quit key nothing happening and it stuck in prompt

image

Assuming this is with ct enabled, the CLI freeze is a duplicate of #176.