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

[10.x] Show source content on last line when CLI dump output is greater than display height #47514

Closed
wants to merge 1 commit into from

Conversation

calebdw
Copy link
Contributor

@calebdw calebdw commented Jun 20, 2023

Hello!

This PR builds upon #44211 and also displays the source content at the end of the dd output when the output is larger than the display height.

I've had several instance in CLI mode where a dd outputs miles of text, and I have to scroll for a long time to to try and find the source. Also having the source at the bottom is super convenient:

image

@calebdw calebdw changed the title Show source content on last line when CLI dump output is greater than display height [10.x] Show source content on last line when CLI dump output is greater than display height Jun 20, 2023
@taylorotwell taylorotwell requested a review from nunomaduro June 21, 2023 23:01
@taylorotwell taylorotwell marked this pull request as draft June 21, 2023 23:01
@calebdw
Copy link
Contributor Author

calebdw commented Sep 15, 2023

@nunomaduro, is there anything holding up this PR?

@morloderex
Copy link
Contributor

@calebdw draft pr's are not reviewed, as far as i know.

@nunomaduro nunomaduro self-assigned this Oct 10, 2023
@nunomaduro
Copy link
Member

nunomaduro commented Oct 11, 2023

What happens if the user dds multiple values. Something like dd(range(1, 50), range(1, 50));? It does reads weird for me:
Screenshot 2023-10-11 at 17 36 02

Feel free to re-open this pull request - if you offer a solution for this situation.

@nunomaduro nunomaduro closed this Oct 11, 2023
@calebdw
Copy link
Contributor Author

calebdw commented Oct 11, 2023

@nunomaduro, that's because the source content is printed at both the beginning and end in this case...

I suppose we could do one of two things:

  1. Always print the source content on the last line
  2. Switch from printing on the first line to the last line if the output is larger than the display height

(1) would be the easiest / most consistent solution as there would be no need to check the display height and functionally it would work for all situations no matter how large the output is.

@nunomaduro
Copy link
Member

@nunomaduro, that's because the source content is printed at both the beginning and end in this case...

I am aware.

Always print the source content on the last line

Feel that I kind of prefer to see the source on the first line by default.

Switch from printing on the first line to the last line if the output is larger than the display height

This will cause an issue when dumping two values, and the second is a one-liner:
Screenshot 2023-10-11 at 17 58 48

@calebdw
Copy link
Contributor Author

calebdw commented Oct 11, 2023

@nunomaduro, I don't see an issue with that...you'll get the exact same thing if you try to dd two ints:

image

How do you propose to find the source of a dd when it's dumping 5,000+ lines (this has happened)? I believe the best solution would be to simply move the source to the last line for all cases

@nunomaduro
Copy link
Member

Can you make a new pull request where you propose that change? With clear screenshots of the before vs after? Thanks!

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.

3 participants