-
Notifications
You must be signed in to change notification settings - Fork 2k
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
ssh/terminal: add Terminal.SetEnterClear(bool) #84
base: master
Are you sure you want to change the base?
Conversation
This PR (HEAD: 8ec69c2) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/crypto/+/170861 to see it. Tip: You can toggle comments from me using the |
Message from Andrey Petrov: Patch Set 1: Gentle ping Would love a review for this. Merging this would allow me to stop using a forked version of ssh/terminal. :D Thank you. :) Please don’t reply on this GitHub thread. Visit golang.org/cl/170861. |
Message from Brad Fitzpatrick: Patch Set 2: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/170861. |
SetEnterClear controls whether to keep the input line after enter by pushing \r\n, or to clear the line into a fresh prompt without echo'ing it above the prompt. Using SetEnterClear allows us to control what content is rendered on enter, so it does not have to be a verbatim echo. For example, ssh-chat uses this to render timestamps in front of each line. The default behaviour continues to be backwards-compatible.
8ec69c2
to
2980e83
Compare
This PR (HEAD: 2980e83) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/crypto/+/170861 to see it. Tip: You can toggle comments from me using the |
Message from Andrey Petrov: Patch Set 3: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/170861. |
Message from Brad Fitzpatrick: Patch Set 3: R=agl Adam, any thoughts on this? Code & docs seem fine, but I'm not sure whether this functionality is some standard thing with some standard name that other libraries provide. Please don’t reply on this GitHub thread. Visit golang.org/cl/170861. |
Message from Brad Fitzpatrick: Patch Set 3: Run-TryBot+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/170861. |
Message from Gobot Gobot: Patch Set 3: TryBots beginning. Status page: https://farmer.golang.org/try?commit=fdb03171 Please don’t reply on this GitHub thread. Visit golang.org/cl/170861. |
Message from Gobot Gobot: Patch Set 3: TryBot-Result+1 TryBots are happy. Please don’t reply on this GitHub thread. Visit golang.org/cl/170861. |
Message from Adam Langley: Patch Set 3: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/170861. |
Message from Andrey Petrov: Patch Set 3: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/170861. |
Message from Andrey Petrov: Patch Set 3: Code-Review-1 Please don't merge this yet. This change might have a scenario where it causes a slice out of bounds panic during runtime. I need to investigate further. Meanwhile, I'd still love Adam's feedback and advice on how to best proceed. Please don’t reply on this GitHub thread. Visit golang.org/cl/170861. |
This PR (HEAD: 0335b09) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/crypto/+/170861 to see it. Tip: You can toggle comments from me using the |
Message from Andrey Petrov: Patch Set 4: I managed to reproduce the crash that was happening because of the There's no longer a crash, but now there's weird echo indent issues that I have not figured out. I think it's related to the cursor/position math. Resetting t.cursorX, t.cursorY = 0, 0 makes it worse. I pasted a small demo program here with a screenshot and log of the output: https://gist.github.com/shazow/5cedec7ac685eb6de10f826b22acb01d I'd appreciate any guidance for what might be going on here. Please don’t reply on this GitHub thread. Visit golang.org/cl/170861. |
Message from Go Bot: Patch Set 3: TryBots beginning. Status page: https://farmer.golang.org/try?commit=fdb03171 Please don’t reply on this GitHub thread. Visit golang.org/cl/170861. |
Message from Go Bot: Patch Set 3: TryBot-Result+1 TryBots are happy. Please don’t reply on this GitHub thread. Visit golang.org/cl/170861. |
Adds support for the Policy URI signature subpacket type from RFC 4880 section 5.2.3.20.
Message from Andrey Petrov: Patch Set 4: I managed to reproduce the crash that was happening because of the There's no longer a crash, but now there's weird echo indent issues that I have not figured out. I think it's related to the cursor/position math. Resetting t.cursorX, t.cursorY = 0, 0 makes it worse. I pasted a small demo program here with a screenshot and log of the output: https://gist.github.com/shazow/5cedec7ac685eb6de10f826b22acb01d I'd appreciate any guidance for what might be going on here. Please don’t reply on this GitHub thread. Visit golang.org/cl/170861. |
Message from Andrey Petrov: Patch Set 1: Gentle ping Would love a review for this. Merging this would allow me to stop using a forked version of ssh/terminal. :D Thank you. :) Please don’t reply on this GitHub thread. Visit golang.org/cl/170861. |
Message from Brad Fitzpatrick: Patch Set 2: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/170861. |
Message from Andrey Petrov: Patch Set 3: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/170861. |
Message from Brad Fitzpatrick: Patch Set 3: R=agl Adam, any thoughts on this? Code & docs seem fine, but I'm not sure whether this functionality is some standard thing with some standard name that other libraries provide. Please don’t reply on this GitHub thread. Visit golang.org/cl/170861. |
Message from Brad Fitzpatrick: Patch Set 3: Run-TryBot+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/170861. |
Message from Gopher Robot: Patch Set 3: TryBots beginning. Status page: https://farmer.golang.org/try?commit=fdb03171 Please don’t reply on this GitHub thread. Visit golang.org/cl/170861. |
Message from Gopher Robot: Patch Set 3: TryBot-Result+1 TryBots are happy. Please don’t reply on this GitHub thread. Visit golang.org/cl/170861. |
Message from Adam Langley: Patch Set 3: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/170861. |
Message from Andrey Petrov: Patch Set 3: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/170861. |
Message from Andrey Petrov: Patch Set 3: Code-Review-1 Please don't merge this yet. This change might have a scenario where it causes a slice out of bounds panic during runtime. I need to investigate further. Meanwhile, I'd still love Adam's feedback and advice on how to best proceed. Please don’t reply on this GitHub thread. Visit golang.org/cl/170861. |
Message from Andrey Petrov: Patch Set 4: I managed to reproduce the crash that was happening because of the There's no longer a crash, but now there's weird echo indent issues that I have not figured out. I think it's related to the cursor/position math. Resetting t.cursorX, t.cursorY = 0, 0 makes it worse. I pasted a small demo program here with a screenshot and log of the output: https://gist.github.com/shazow/5cedec7ac685eb6de10f826b22acb01d I'd appreciate any guidance for what might be going on here. Please don’t reply on this GitHub thread. Visit golang.org/cl/170861. |
SetEnterClear controls whether to keep the input line after enter by
pushing
\r\n
, or to clear the line into a fresh prompt without echoingit above the prompt.
Using SetEnterClear allows us to control what content is rendered on
enter, so it does not have to be a verbatim echo.
For example, ssh-chat uses this for things like rendering timestamps in front of each
line, or transforming the command in other ways.
The default behavior continues to be backwards-compatible.