<p dir="auto"><strong>Symfony version(s) affected</strong>: 4.1 and 4.2</p>
<p dir="auto"><strong>Description</strong><br>
While appending new rows to a console table, content starts to be duplicated once the height of the table reaches the height of the terminal.</p>
<details>
<summary>Here's what I get when appending 20 rows in a 15 rows tall terminal</summary> <br>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="❯ bin/console table
+----+
+----+
| 0  |
+----+
| 0  |
| 1  |
+----+
| 0  |
| 1  |
| 2  |
+----+
| 0  |
| 1  |
| 2  |
| 3  |
+----+
| 0  |
| 1  |
| 2  |
| 3  |
| 4  |
+----+
| 0  |
| 1  |
| 2  |
| 3  |
| 4  |
| 5  |
+----+
| 0  |
| 1  |
| 2  |
| 3  |
| 4  |
| 5  |
| 6  |
| 7  |
| 8  |
| 9  |
| 10 |
| 11 |
| 12 |
| 13 |
| 14 |
| 15 |
| 16 |
| 17 |
| 18 |
| 19 |
+----+"><pre class="notranslate"><code class="notranslate">❯ bin/console table
+----+
+----+
| 0  |
+----+
| 0  |
| 1  |
+----+
| 0  |
| 1  |
| 2  |
+----+
| 0  |
| 1  |
| 2  |
| 3  |
+----+
| 0  |
| 1  |
| 2  |
| 3  |
| 4  |
+----+
| 0  |
| 1  |
| 2  |
| 3  |
| 4  |
| 5  |
+----+
| 0  |
| 1  |
| 2  |
| 3  |
| 4  |
| 5  |
| 6  |
| 7  |
| 8  |
| 9  |
| 10 |
| 11 |
| 12 |
| 13 |
| 14 |
| 15 |
| 16 |
| 17 |
| 18 |
| 19 |
+----+
</code></pre></div>
</details>
<br>
<details>
<summary>Here's what I get when appending 20 rows in a 25 rows tall terminal</summary> <br>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="❯ bin/console table
+----+
| 0  |
| 1  |
| 2  |
| 3  |
| 4  |
| 5  |
| 6  |
| 7  |
| 8  |
| 9  |
| 10 |
| 11 |
| 12 |
| 13 |
| 14 |
| 15 |
| 16 |
| 17 |
| 18 |
| 19 |
+----+"><pre class="notranslate"><code class="notranslate">❯ bin/console table
+----+
| 0  |
| 1  |
| 2  |
| 3  |
| 4  |
| 5  |
| 6  |
| 7  |
| 8  |
| 9  |
| 10 |
| 11 |
| 12 |
| 13 |
| 14 |
| 15 |
| 16 |
| 17 |
| 18 |
| 19 |
+----+
</code></pre></div>
</details>
<br>
<p dir="auto"><strong>How to reproduce</strong><br>
Create a new Symfony project: <code class="notranslate">composer create-project symfony/website-skeleton path/to/dir</code></p>
<p dir="auto">Create a new file <code class="notranslate">src/Command/TableCommand.php</code> with the following content:</p>
<div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&lt;?php

namespace App\Command;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Helper\Table;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class TableCommand extends Command
{
    protected static $defaultName = 'table';

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $table = new Table($output-&gt;section());
        $table-&gt;render();

        for ($i = 0 ; $i &lt; 50 ; $i++) {
            $table-&gt;appendRow([$i]);
        }
    }
}"><pre class="notranslate"><span class="pl-ent">&lt;?php</span>

<span class="pl-k">namespace</span> <span class="pl-v">App</span>\<span class="pl-v">Command</span>;

<span class="pl-k">use</span> <span class="pl-v">Symfony</span>\<span class="pl-v">Component</span>\<span class="pl-v">Console</span>\<span class="pl-v">Command</span>\<span class="pl-v">Command</span>;
<span class="pl-k">use</span> <span class="pl-v">Symfony</span>\<span class="pl-v">Component</span>\<span class="pl-v">Console</span>\<span class="pl-v">Helper</span>\<span class="pl-v">Table</span>;
<span class="pl-k">use</span> <span class="pl-v">Symfony</span>\<span class="pl-v">Component</span>\<span class="pl-v">Console</span>\<span class="pl-v">Input</span>\<span class="pl-v">InputInterface</span>;
<span class="pl-k">use</span> <span class="pl-v">Symfony</span>\<span class="pl-v">Component</span>\<span class="pl-v">Console</span>\<span class="pl-v">Output</span>\<span class="pl-v">OutputInterface</span>;

<span class="pl-k">class</span> <span class="pl-v">TableCommand</span> <span class="pl-k">extends</span> <span class="pl-v">Command</span>
{
    <span class="pl-k">protected</span> <span class="pl-k">static</span> <span class="pl-c1"><span class="pl-c1">$</span>defaultName</span> = <span class="pl-s">'table'</span>;

    <span class="pl-k">protected</span> <span class="pl-k">function</span> <span class="pl-en">execute</span>(<span class="pl-smi"><span class="pl-smi">InputInterface</span></span> <span class="pl-s1"><span class="pl-c1">$</span>input</span>, <span class="pl-smi"><span class="pl-smi">OutputInterface</span></span> <span class="pl-s1"><span class="pl-c1">$</span>output</span>)
    {
        <span class="pl-s1"><span class="pl-c1">$</span>table</span> = <span class="pl-k">new</span> <span class="pl-v">Table</span>(<span class="pl-s1"><span class="pl-c1">$</span>output</span>-&gt;<span class="pl-en">section</span>());
        <span class="pl-s1"><span class="pl-c1">$</span>table</span>-&gt;<span class="pl-en">render</span>();

        for (<span class="pl-s1"><span class="pl-c1">$</span>i</span> = <span class="pl-c1">0</span> ; <span class="pl-s1"><span class="pl-c1">$</span>i</span> &lt; <span class="pl-c1">50</span> ; <span class="pl-s1"><span class="pl-c1">$</span>i</span>++) {
            <span class="pl-s1"><span class="pl-c1">$</span>table</span>-&gt;<span class="pl-en">appendRow</span>([<span class="pl-s1"><span class="pl-c1">$</span>i</span>]);
        }
    }
}</pre></div>
<p dir="auto">Run <code class="notranslate">bin/console table</code> in a terminal with less than 50 rows of height.</p>
<p dir="auto"><strong>Possible Solution</strong><br>
Honestly, I'm not really sure what's happening here so I can 't really help, but I would be glad to provide you with more informations if this bug is specific to my environment.</p>
<p dir="auto"><strong>Additional context</strong><br>
I reproduced this in macOS terminal and iTerm2, but didn't try anywhere else.</p>
<p dir="auto">Upon clearing the cache a fatal error is thrown:</p>
<p dir="auto"><code class="notranslate">Fatal error: Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Parse error: syntax error, unexpected '\' (T_NS_SEPARATOR), expecting identifier (T_STRING) in [...]var/cache/dev/appDevDebugProjectContainer.php:7161</code></p>
<p dir="auto">Here's the corresponding line:<br>
<code class="notranslate">class VichUploaderBundleHandlerUploadHandler_000000003557d388000000006581de10da75941a549785cf26d7df71050c90e4 extends \\Vich\UploaderBundle\Handler\UploadHandler implements \\ProxyManager\Proxy\VirtualProxyInterface {</code><br>
It's obvious that the error is caused by the duplicate backslashes.</p>
<p dir="auto"><a href="https://github.com/symfony/symfony/issues/9815" data-hovercard-type="issue" data-hovercard-url="/symfony/symfony/issues/9815/hovercard">#9815</a> seems to be related, but <a href="https://github.com/symfony/symfony/pull/9816" data-hovercard-type="pull_request" data-hovercard-url="/symfony/symfony/pull/9816/hovercard">#9816</a> does not fix this behaviour since it started after the most recent <code class="notranslate">composer update</code>.</p>