Skip to content

Fix and simplify restoring TTY mode when ext-readline is not in use - #74

Merged
clue merged 1 commit into
clue:masterfrom
clue-labs:resetty
Jul 17, 2018
Merged

Fix and simplify restoring TTY mode when ext-readline is not in use#74
clue merged 1 commit into
clue:masterfrom
clue-labs:resetty

Conversation

@clue

@clueclue commented Jul 7, 2018

Copy link
Copy Markdown
Owner

Builds on top of #73

@clueclue added the bug Something isn't working label Jul 7, 2018
@clueclue added this to the v2.2.0 milestone Jul 7, 2018
@clue
clue merged commit 1ddc137 into clue:masterJul 17, 2018
@clue
clue deleted the resetty branch July 17, 2018 08:19
Comment threadsrc/Stdio.php
} elseif ($this->originalTtyMode !== null && is_resource(STDIN) && $this->isTty()) {
// Reset stty so it behaves normally again
shell_exec(sprintf('stty %s', $this->originalTtyMode));
shell_exec('stty ' . escapeshellarg($this->originalTtyMode));

@clueclueAug 31, 2018

Copy link
Copy Markdown
OwnerAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This simple change introduces a subtle bug fixed in #78. The originalTtyMode contains a trailing newline, passing this to escapeshellarg() means that this will now be passed as part of the argument to the stty bin which rejects this format because it does not expect a trailing newline.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugSomething isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@clue