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: Make long_slow_command | less +&foobar\n usable #532

Open
paddor opened this issue Jun 24, 2024 · 0 comments
Open

Feature request: Make long_slow_command | less +&foobar\n usable #532

paddor opened this issue Jun 24, 2024 · 0 comments

Comments

@paddor
Copy link

paddor commented Jun 24, 2024

I'd like to use less like long_slow_command | grep foobar. That way it would filter lines right after start up, but I could still switch to viewing all lines later (using &\n). This is useful e.g. in web development where you have a Procfile that starts multiple commands like backend, frontend, and verbose simulators, and only want to see certain lines of the simulators by default.

Compare the following two commands:

tail -n +1 -f /etc/hosts | grep 127
127.0.0.1 localhost
127.0.1.1 my-machine-name
^C
tail -n +1 -f /etc/hosts | less +\&127\n  # Fish syntax

The second command shows nothing until you hit ^C and then shows all lines.

I'm not aware of any currently supported less options to get this behavior. Using stdbuf -i0 -o0 doesn't help.
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

No branches or pull requests

1 participant