Skip to content
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

Define number of lines when output is large #1973

Open
radare opened this issue Jan 17, 2015 · 9 comments
Open

Define number of lines when output is large #1973

radare opened this issue Jan 17, 2015 · 9 comments

Comments

@radare
Copy link
Collaborator

radare commented Jan 17, 2015

When output is too big in scr.interactive there should be more options than just "Yes" or "No".

I'm proposing the following:

  • p : use scr.pager (less, more, ..)
  • 10 : any numeric argument will assume that it must flush only the first 10 lines and drop the rest.

We can add r_cons_head() and r_cons_tail() functions to chop the non-flushed buffer.

@jvoisin
Copy link
Contributor

jvoisin commented Jan 17, 2015

What about pager instead of p, since it's not that obvious.

@radare
Copy link
Collaborator Author

radare commented Jan 17, 2015

The yesno() expects only 1 char

On 17 Jan 2015, at 05:05, jvoisin notifications@github.com wrote:

What about pager instead of p, since it's not that obvious.


Reply to this email directly or view it on GitHub.

@radare
Copy link
Collaborator Author

radare commented Jan 28, 2015

the value in scr.interactive can be pager perfectly. i was talking about the function itself

@radare
Copy link
Collaborator Author

radare commented Mar 23, 2015

instead of saying "wanna dump 300KB of text" just say: "wanna see 200 lines of text?"

@stale
Copy link

stale bot commented Jun 16, 2020

This issue has been automatically marked as stale because it has not had recent activity. Considering a lot has changed since its creation, we kindly ask you to check again if the issue you reported is still relevant in the current version of radare2. If it is, update this issue with a comment, otherwise it will be automatically closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jun 16, 2020
@trufae
Copy link
Collaborator

trufae commented Jun 16, 2020

Still waiting for feedback or comments after 5 years. Personally i dont think we need any configuration overcomplications here. but maybe its worth to check when the output contains a very long line show in size instead of lines. to confirm the user, because a 100MB single line will just say: "do you want to print 1 line?" which makes not much sense to warn the user for that when the reality is another.

So yeah, this bug must be fixed still

@stale stale bot removed the stale label Jun 16, 2020
@alex-bender
Copy link
Contributor

@trufae I'm going to check that

@alex-bender
Copy link
Contributor

Any hints where to start?

@trufae
Copy link
Collaborator

trufae commented Mar 2, 2021

i would start like this:

[0x100001060]> cat /etc/services
Do you want to print 13921 lines? (y/N)

grep in the r2 source code to find this message. ( git grep 'Do you want to print')

when found. youll see something like this:

Screenshot 2021-03-02 at 18 04 12

so the steps to solve this problem would be:

  • Remove the COUNT_LINES ifdef, the else branch have not been used and its not that slow to count chars everytime we print something..
  • Move the count lines to a separate function
  • Make this function count an extra line every time there's a line with more than 80 chars

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

No branches or pull requests

4 participants