8000 [Process] Buggy terminal after interrupting TTY Process · Issue #44045 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
[Process] Buggy terminal after interrupting TTY Process #44045
Closed
@tom-combet

Description

@tom-combet

Symfony version(s) affected

5.3

Description

Interrupting a Process with TTY mode in a Command leads to broken terminal: we can't see what we're typing anymore.

It happens only for processes that require user input several times. The bug occurs if there are remaining steps to complete the operation. So if we interrupt the process at the last step, bug doesn't occur.
Typically, my use case is using Maker Bundle. So for instance, bug occurs with make:entity, but not with make:controller.

How to reproduce

  1. Make a basic command with make:command or manually.
  2. Implement SignalableCommandInterface and susbcribe to SIGINT signal.
  3. Run a Process that require user input multiple times with TTY mode enabled in execute command function, like this:
        $process = Process::fromShellCommandline('php bin/console make:entity');
        $process->setTty(true);

        $process->run();
  1. Run command at the project root (php bin/console your-command).
  2. Interrupt command at the first step.
  3. See that you can't see what you're typing anymore in the terminal (but you're typing!).

Possible Solution

It should be a problem with standard input/output not given back to the parent process, but I don't have enough knowledge in systems to fix it alone...

Additional Context

image

As you can see, you don't see the php -v I entered after interrupting the Test command that launches make:entity process. Only the result of it appears.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0