-
Notifications
You must be signed in to change notification settings - Fork 1
Set and restore raw mode using x/term
on Unix systems
#3
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
Conversation
On Linux, set the terminal to raw mode and restore it using MakeRaw() and Restore() in x/term respectively, which is used upstream in place of x/sys/unix.IoctlSetTermios() or syscall.Syscall6() in other platforms. MakeRaw() performs the same changes with certain termios fields, but copies the whole struct prior instead of those fields only.
Switch to Linux screen implementation on all Unix platforms excluding MacOS, and add Unix platforms that are supported upstream only to the build constraint. The modifications on certain termios fields only differ on BSD systems where VMIN and VTIME were not modified.
Only new OpenBSD releases will benefit currently if this PR is merged, but may this at least be reviewed sometime, since it has been more than 1 year since such releases where Micro stopped running? I think I've read on OpenBSD mailing lists that Tcell cannot be patched in their package of Micro due to being a Go dependency, but I don't remember which thread I have read this. |
Quick questions (without looking into this in any depth):
I guess we cannot guarantee a fast review, but we can add zyedidia/micro#3557 to the list of blockers for v2.0.15 (https://github.com/zyedidia/micro/milestone/3) if needed. |
I could understand that this PR may not be reviewed early or fast, due to probably having less priority than other issues that are more important to Micro itself. Still, I believe that this PR shouldn't take too long to review since it switches to functions in
It may not seem pleasant for users on a specific platform that Micro remains broken 1 year after the previous version, so I would suggest to do this. |
I agree to declare it as a blocker.We‘ve to fix it downstream like suggested, since we‘re unfornunately far away from using upstream tcell directly.Am 03.10.2025 um 15:36 schrieb niten94 ***@***.***>:niten94 left a comment (micro-editor/tcell#3)
Quick questions (without looking into this in any depth):
Is this a v2.0.14 regression?
Are these fixes applicable to upstream tcell?
No, but this fixes a bug that doesn't occur upstream. OpenBSD 7.5 and newer is currently the only platform where the screen cannot start, due to a lot of factors including the removal of syscall(2) which are addressed in Go 1.23 and x/term.
No, since upstream Tcell already switched to one generic implementation that uses x/term:
https://github.com/gdamore/tcell/blob/d86b440bcb24a485e77211ed87edb91c6f600fe5/tty_unix.go#L83
I guess we cannot guarantee a fast review
I could understand that this PR may not be reviewed early or fast, due to probably having less priority than other issues that are more important to Micro itself.
Still, I believe that this PR shouldn't take too long to review since it switches to functions in x/term like upstream as a somewhat quick fix, which are similar to the code replaced in this PR.
but we can add zyedidia/micro#3557 to the list of blockers for v2.0.15 (https://github.com/zyedidia/micro/milestone/3) if needed.
It may not seem pleasant for users on a specific platform that Micro remains broken 1 year after the previous version, so I would suggest to do this.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
I've looked through the changes, looks quite sane. But I haven't tested it on anything other than Linux. |
The differences with the original implementation are the same with BSD systems.
10d8c90
to
46e2256
Compare
In |
I was also noticed by mail and fixed the legacy workflow with the min. required go version BTW:
This can be changed in you fork with the repository settings... |
This pull request switches all Unix platforms to only one implementation, that uses some functions in
x/term
like upstream to set the terminal to raw mode and restore it. This is done to avoid related bugs on new platform releases by relying on a module instead, and also deduplicate code.This was mainly done to fix a bug on OpenBSD 7.5 or newer where the screen doesn't start, which also requires builds to be done using Go 1.23 or newer.
Previous implementations also specifically had at least one of these issues:
Syscall*()
(BSD systems)VMIN
andVTIME
not set (BSD systems)There had been no issues when I tested on Linux, OpenBSD, FreeBSD and OpenIndiana (illumos distribution, like Solaris).
This pull request replaces #2 which is similar, but it is slightly modified to present changes better.
Related: zyedidia/micro#3557