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

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

Merged
merged 1 commit into from
Jul 17, 2018

Conversation

clue
Copy link
Owner

@clue clue commented Jul 7, 2018

Builds on top of #73

@clue clue added the bug label Jul 7, 2018
@clue clue added this to the v2.2.0 milestone Jul 7, 2018
@clue clue merged commit 1ddc137 into clue:master Jul 17, 2018
@clue clue deleted the resetty branch July 17, 2018 08:19
// Reset stty so it behaves normally again
shell_exec(sprintf('stty %s', $this->originalTtyMode));
shell_exec('stty ' . escapeshellarg($this->originalTtyMode));
Copy link
Owner Author

@clue clue Aug 31, 2018

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 free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant