8000 [Console] cursor tweaks by fabpot · Pull Request #36433 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Console] cursor tweaks #36433

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

Merged
merged 4 commits into from
Apr 12, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Split a method
  • Loading branch information
fabpot committed Apr 12, 2020
commit 55fef914cc6ef40a50a1481e4932845ff988e447
16 changes: 10 additions & 6 deletions src/Symfony/Component/Console/Cursor.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,17 @@ public function show()
/**
* Clears all the output from the current line.
*/
public function clearLine(bool $fromCurrentPosition = false)
public function clearLine()
{
if (true === $fromCurrentPosition) {
$this->output->write("\x1b[K");
} else {
$this->output->write("\x1b[2K");
}
$this->output->write("\x1b[2K");
}

/**
* Clears all the output from the current line after the current position.
*/
public function clearLineAfter()
{
$this->output->write("\x1b[K");
}

/**
Expand Down
0