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

libcontainer/console_linux.go: Make SaneTerminal public #1479

Merged

Conversation

wking
Copy link
Contributor

@wking wking commented Jun 8, 2017

And use it only in local tooling that is forwarding the pseudoterminal master. That way runC no longer has an opinion on the onlcr setting for folks who are creating a terminal and detaching. They'll use --console-socket and can setup the pseudoterminal however they like without runC having an opinion. With this commit, the only cases where runC still applies SaneTerminal is when it is the process consuming the master descriptor.

Previous discussion in #1146 (which landed saneTerminal in the first place) and also on IRC earlier today. From that IRC discussion, this PR takes the “whoever gets the master descriptor can set it up as they see fit” approach. And alternative floated by @crosbymichael was to expose some subset of the termios structure in the config which had later support from @mrunalp. After further discussion, both @cyphar (here) and @crosbymichael (here) seem ok with the “setup the master descriptor as you see fit” approach I've taken here (although that doesn't mean they'll approve of the way I've implemented that approach).

@wking wking force-pushed the sane-terminal-for-forwarding-only branch from 147fc3a to 830c0d7 Compare June 8, 2017 04:32
And use it only in local tooling that is forwarding the pseudoterminal
master.  That way runC no longer has an opinion on the onlcr setting
for folks who are creating a terminal and detaching.  They'll use
--console-socket and can setup the pseudoterminal however they like
without runC having an opinion.  With this commit, the only cases
where runC still has applies SaneTerminal is when *it* is the process
consuming the master descriptor.

Signed-off-by: W. Trevor King <wking@tremily.us>
@wking
Copy link
Contributor Author

wking commented Jun 8, 2017

I've pushed 147fc3a830c0d7 to fix:

=== RUN   TestExecInTTY
--- FAIL: TestExecInTTY (0.29s)
	execin_test.go:335: unexpected carriage-return in output

@wking
Copy link
Contributor Author

wking commented Jun 8, 2017

Travis is complaining about the checkpoint issue I've been getting occasionally, which I think is unrelated to this PR (see also here and here). This time it's only for Go 1.8.

@crosbymichael
Copy link
Member

crosbymichael commented Jun 20, 2017

LGTM

ping @mrunalp

Approved with PullApprove

@mrunalp
Copy link
Contributor

mrunalp commented Jun 20, 2017

LGTM

Approved with PullApprove

@mrunalp mrunalp merged commit 035b578 into opencontainers:master Jun 20, 2017
@wking wking deleted the sane-terminal-for-forwarding-only branch June 20, 2017 19:49
dqminh added a commit to dqminh/console that referenced this pull request Jul 11, 2017
similar to opencontainers/runc#1479, we want to use this
for console's consumer so they dont have to create their own implementation.

Signed-off-by: Daniel Dao <dqminh89@gmail.com>
dqminh added a commit to dqminh/console that referenced this pull request Jul 12, 2017
similar to opencontainers/runc#1479, we want to use this
for console's consumer so they dont have to create their own implementation.

Signed-off-by: Daniel Dao <dqminh89@gmail.com>
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.

3 participants