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
proposal: x/sys: move crypto/terminal to sys repository #12101
Comments
Related discussion: https://groups.google.com/forum/#!topic/golang-nuts/c1dOr7eknBA |
Seems non-controversial to live somewhere. Note that we already have stuff like http://godoc.org/golang.org/x/crypto/ssh/terminal#GetSize Maybe that's the right package to complete the work. |
@bradfitz Actually, that looks like exactly the functionality I was desiring, with the exception that it lives in an odd place (crypto/ssh, where I never would have thought to look for it). I wonder if it should be moved to a top-level package instead of being part of crypto/ssh or is it too late to fix the namespacing? |
I've always felt the ssh/terminal package was a storage outlier. I'd On Wed, 16 Sep 2015 06:21 Shawn notifications@github.com wrote:
|
Well, it's not really "termios" since that's a *NIX concept, so while I hate to engage in bikeshedding, I'd suggest it either belongs in x/sys, x/terminal, or x/term. I'm happy to do the work if someone wants to suggest the desired direction as I have no particular preference here. |
I'm happy with term, and can contribute Darwin and Linux implementations golang.org/x/sys/term Sounds fine to me. On Wed, 16 Sep 2015 09:37 Shawn notifications@github.com wrote:
|
I have a Python Windows code for GetWindowSize in case somebody would like to port it, see https://bitbucket.org/techtonik/python-pager/src/2936adb19c9407b8e890949f9e88bf4f0461a524/pager.py?at=default&fileviewer=file-view-default#pager.py-35 |
The console interfaces of the future look like those created with https://bitbucket.org/libtcod/libtcod/ so it would be good to plan for that now. |
Seems there's consensus to move this code. There's a question about precisely where it should go, but I'm marking this as accepted since it's so uncontroversial. (famous last words) I'd like to hear from @agl who I believe originally authored the terminal package. |
I'm happy with moving |
I unaccept this proposal. Except at the lowest levels this has nothing to do with system calls. It seems pretty clear to me that x/sys is not appropriate (nor is x/crypto but at least it's already there). |
@rsc it seems overkill to create an x/term subrepo, but would you consider something like x/os with an expanded scope including terminal handling ? |
I think we can repurpose the x/sys sub-repo with system programming
packages. Having a terminal package at x/sys/unix/terminal will be
helpful. (Perhaps we can even have a x/sys/terminal?)
see also #12853 about adding termios stuff to x/sys where it's suggested
that we add them to x/sys/unix/termios instead.
|
@minux terminal is slow and inefficient legacy system that is only good for abusing Linux through COM ports. What users really need is either modern cross-platform console interfaces, such as https://bitbucket.org/libtcod/libtcod/wiki/Features or fast remote access https://mosh.mit.edu/ So choose the name carefully. |
Another terminal library worth mentioning: http://garrett.damore.org/2015/10/tcell-terminal-functionality-for-pure.html |
I think we can decline this in favor of #13104 (not that 13104 is completely decided yet). |
I would like to propose the addition of a set of functions and supporting data types to support getting / setting terminal window size across platforms.
This would also likely require the addition of something like this to x/sys:
On Linux, OS X, etc. this is done via syscalls using ioctl(), etc. On Windows, this is done possibly via GetConsoleScreenBufferInfo and SetConsoleWindowInfo. On Solaris, this is done via libc.ioctl().
Docker (pkg/term/*) and other Go-based projects like to retrieve or set this information, it would be helpful if this was abstracted away for various projects as can be seen in a simple github search of Go source files:
https://github.com/search?utf8=%E2%9C%93&q=%22TIOCGWINSZ%22+extension%3Ago&type=Code&ref=advsearch&l=
I am willing to provide the implementation and tests for Solaris, and Linux, and I can attempt one for Windows.
I have not proposed an addition before to any of the Go packages or tools, so please forgive me if I have not adhered to the correct process ( I'm attempting to follow https://github.com/golang/proposal#readme ).
I don't know if the sys package is the most appropriate place for this or not; I'm just trying to figure out how to avoid the current situation of duplicating terminal information code across various Go projects in the community leading to them not working as expected or being unsupported on some platforms.
The text was updated successfully, but these errors were encountered: