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

[Feature Request] remember previous piped input buffers, automatically #120

Closed
ryenus opened this issue Feb 4, 2021 · 4 comments
Closed

Comments

@ryenus
Copy link
Contributor

ryenus commented Feb 4, 2021

Sometimes when less is used with piped input, especially when the input data is generated by some heavy lifting commands, it would be nice if less can automatically cache the input buffer, so that one can get it back when the data needs to be inspected again.

This can be an opt-in feature so that only enabled when configured, and when less is executed without any input, it can automatically bring back the most recent buffer, or maybe with an argument specifying which buffer to restore.

@gwsw
Copy link
Owner

gwsw commented Feb 4, 2021

Can you clarify this? Less already buffers all input data (unless -B is used), and you can inspect it again by just jumping or scrolling to it. Or are you referring to saving the entire input file between sessions? You can do that with the "s" command, are you asking something different?

@ryenus
Copy link
Contributor Author

ryenus commented Feb 5, 2021

I'm looking for something like the automated, or more streamlined version of the s command.
so whenever the input is from pipe, the buffer is automatically saved, to some predefined location.

@ryenus ryenus changed the title [Feature Request] remember previous piped input buffers [Feature Request] remember previous piped input buffers, automatically Feb 5, 2021
@gwsw
Copy link
Owner

gwsw commented Feb 13, 2021

Couldn't this be done with a simple frontend script, something like this?

tee ~/lessdata/$(date +%s) | less $*

@gwsw gwsw closed this as completed Jan 13, 2023
@ryenus
Copy link
Contributor Author

ryenus commented Jan 14, 2023

tee ~/lessdata/$(date +%s) | less $*

I've adopted this and it actually works very well, thank you!

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

2 participants