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

Windows console fixes #12064

Merged
merged 1 commit into from Apr 6, 2015
Merged

Windows console fixes #12064

merged 1 commit into from Apr 6, 2015

Conversation

@brendandixon
Copy link
Contributor

@brendandixon brendandixon commented Apr 3, 2015

Corrected integer size passed to Windows
Corrected DisableEcho / SetRawTerminal to not modify state
Cleaned up and made routines more idiomatic
Corrected raw mode state bits
Removed duplicate IsTerminal
Corrected off-by-one error
Minor idiomatic change

Signed-off-by: Brendan Dixon brendand@microsoft.com

Corrected integer size passed to Windows
Corrected DisableEcho / SetRawTerminal to not modify state
Cleaned up and made routines more idiomatic
Corrected raw mode state bits
Removed duplicate IsTerminal
Corrected off-by-one error
Minor idiomatic change

Signed-off-by: Brendan Dixon <brendand@microsoft.com>
@ahmetb
Copy link
Contributor

@ahmetb ahmetb commented Apr 3, 2015

@icecrime @tiborvass @jfrazelle Folks meet @brendandixon, our new ANSI emulation maintainer.

This change reduces panics on terminal-attached sessions a great deal (for example I haven't got one today 😄) as far as I can tell and fixes several other minor displaying problems. I really appreciate if you folks can review and try out.

I think we should take this for 1.6. (I know, this is short notice but this observably improves the quality).

@jessfraz jessfraz added this to the 1.6.0 milestone Apr 3, 2015
@jessfraz
Copy link
Contributor

@jessfraz jessfraz commented Apr 3, 2015

does this fix the panics?

@ahmetb
Copy link
Contributor

@ahmetb ahmetb commented Apr 3, 2015

@jfrazelle as far as I can tell, yeah "many of them", however we do not have a systematic way to test and we've seen that not all repro steps causes panics in everybody's computer. I remember @icecrime/@tiborvass were observing certain panics with repro steps. That's why I'd love if you guys try it out.

As I said, this visibly reduces panics on terminal attach.

@icecrime
Copy link
Contributor

@icecrime icecrime commented Apr 3, 2015

My hat off to you guys: it does fix the reproducible panics I encountered. 😮 LGTM 👍

@tiborvass
Copy link
Collaborator

@tiborvass tiborvass commented Apr 3, 2015

Hey @unclejack, since you're the buffer master, would you mind taking a peek at the ANSI code (that this PR modifies) sometime? There are bunch of weird things it's doing :(

@brendandixon
Copy link
Contributor Author

@brendandixon brendandixon commented Apr 3, 2015

I will address them. It's going to take a couple/ three days.

On Apr 3, 2015, at 3:59 PM, Tibor Vass notifications@github.com wrote:

Hey @unclejack, since you're the buffer master, would you mind taking a peek at the ANSI code (that this PR modifies) sometime? There are bunch of weird things it's doing :(


Reply to this email directly or view it on GitHub.

@jessfraz
Copy link
Contributor

@jessfraz jessfraz commented Apr 4, 2015

I can attest that this does not make things worse LGTM

@jessfraz
Copy link
Contributor

@jessfraz jessfraz commented Apr 4, 2015

also thanks so much for the hustle

@brendandixon
Copy link
Contributor Author

@brendandixon brendandixon commented Apr 4, 2015

Well, that sets a high bar. :)

Brendan
423.922.8798
brendandixon@me.com

On Apr 3, 2015, at 5:57 PM, Jessie Frazelle notifications@github.com wrote:

I can attest that this does not make things worse LGTM


Reply to this email directly or view it on GitHub.

@LK4D4
Copy link
Contributor

@LK4D4 LK4D4 commented Apr 4, 2015

Also @stevvooe fixed similar bufio bug in pull.

inFd = file.Fd()
isTerminalIn = IsTerminal(inFd)
}
isTerminalIn = IsConsole(inFd)

This line highlights a nit I have with renaming the Terminal stuff in _windows to Console...we just end up with a mix at the two levels of abstraction that makes the code no clearer...arguably more confusing.

Copy link
Contributor Author

@brendandixon brendandixon Apr 5, 2015

Actually, the reason I renamed them is that the concepts are sufficiently separate to avoid mixed assumptions. Consoles in Windows are only somewhat like Terminals (TTYs) in Unix / Linux. Further, since the code is part of the abstraction layer for Windows, it made most sense to use Windows-centric terms at that level and buried within the Windows files.

I'm not married to these ideas, but they motivated the name.

kk

@tiborvass
Copy link
Collaborator

@tiborvass tiborvass commented Apr 6, 2015

LGTM

@LK4D4
Copy link
Contributor

@LK4D4 LK4D4 commented Apr 6, 2015

I should note that pkg/term/term_windows.go has wrong build-tag, it should be followed by empty line :) But it's unrelated to this change.

@brendandixon
Copy link
Contributor Author

@brendandixon brendandixon commented Apr 6, 2015

We plan other changes to clean-up, simplify, and improve the code. I'll merge these suggestions with those changes.

@LK4D4
Copy link
Contributor

@LK4D4 LK4D4 commented Apr 6, 2015

LGTM

jessfraz pushed a commit that referenced this issue Apr 6, 2015
@jessfraz jessfraz merged commit 37a1658 into moby:master Apr 6, 2015
2 checks passed
return winconsole.SetConsoleMode(fd, state.mode)
mode := state.mode
mode &^= winconsole.ENABLE_ECHO_INPUT
mode |= winconsole.ENABLE_PROCESSED_INPUT | winconsole.ENABLE_LINE_INPUT
Copy link
Contributor

@calavera calavera Apr 6, 2015

these options don't mutate state.mode anymore, is this correct @brendandixon, @ahmetalpbalkan? I wonder if this can be a possible cause of the term resizing regression that we just detected.

Copy link
Contributor Author

@brendandixon brendandixon Apr 7, 2015

The code has had window resize issues. These changes did not introduce them nor expose them. The intention here is to honor the "contract" of DisableEcho as implemented by other terminal code.

@brendandixon brendandixon deleted the win-cli/rawfix branch Apr 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

9 participants