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

Disable --tty for subprocess when parent process is non-tty #1305

Closed
wants to merge 1 commit into from

Conversation

xz-dev
Copy link

@xz-dev xz-dev commented Sep 14, 2023

First, stdin not need --tty option, it only dependent --interactive option. Secendly, when running in subprocess mode, disable --tty option if parent process does not have a tty. This prevents the subprocess incorrectly detecting tty and enabling interactive features like ansible-config init.
For example, if you use ansible-navigator config init -m stdout > config, the subprocess will incorrectly detect tty and waiting 'q' to exit less and cause errors of config. This change avoids that.

More code see at here ansible_navigator. ansible_navigator enable input_fd even if in non-tty mode, It is understandable because they are able to control the input and output based on needs.

First, stdin not need --tty option, it only dependent --interactive option.
Secendly, when running in subprocess mode, disable --tty option if
parent process does not have a tty. This prevents the
subprocess incorrectly detecting tty and enabling interactive
features like `ansible-config init`.
For example, if you use `ansible-navigator config init -m stdout > config`, the subprocess will incorrectly detect tty and waiting 'q' to exit less and cause errors of config. This change avoids that.
@xz-dev xz-dev requested a review from a team as a code owner September 14, 2023 06:26
@xz-dev
Copy link
Author

xz-dev commented Sep 14, 2023

Rename branch name.

@xz-dev xz-dev closed this Sep 14, 2023
@xz-dev
Copy link
Author

xz-dev commented Sep 14, 2023

To #1306

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant