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

Directly call $this->getOutput()->write() to avoid an extra newline in the tail command #32

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

squatto
Copy link
Contributor

@squatto squatto commented Oct 24, 2023

Currently, the tail command calls $this->line($line), which in turn calls $this->getOutput()->writeln($line). Since the log file is being read with fgets(), $line includes the ending newline character. Passing this to writeln() appends another newline character, resulting in an empty/blank line between each output line:

Screenshot 2023-10-24 at 2 02 01 PM

This change simply directly calls $this->getOutput()->write($line) to avoid appending an extra newline character:

Screenshot 2023-10-24 at 2 02 12 PM

This resolves #12

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.

Tail command adds extra blank lines
1 participant