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

Use x/term on Unix systems, deduplicate tscreen_*.go #2

Open
wants to merge 1 commit into
base: legacy
Choose a base branch
from

Conversation

niten94
Copy link

@niten94 niten94 commented Jan 18, 2025

The behavior that occurs when calling syscall.Syscall and passing syscall.SYS_IOCTL in OpenBSD has been changed in Go 1.23 because syscall(2) is removed in OpenBSD 7.5. There may be changes in any platform where using syscall.Syscall* will not work, so Syscall6 is replaced with golang.org/x/term.*. There are other changes with functionality on BSD systems because the files are merged.

I do not know how micro was able to start up properly on old OpenBSD versions even though unsafe.Pointer was not converted to uintptr in arguments like written in the 4th pattern written in documentation, but the screen would be blank in newer versions.

Micro seemed to start up properly when I tested using an OpenBSD 7.6 VM. I do not have a MacOS machine so I cannot test if there are no bugs on MacOS. The changes may not be tested and thought well enough.

Fixes zyedidia/micro#3557

- Replace unix.Ioctl* in tscreen_{linux,solaris}.go and Syscall6 in
  tscreen_{bsd,darwin}.go with functions in golang.org/x/term.
- Merge tscreen_windows.go with tscreen_stub.go, and adjust
  tscreen_darwin.go to tscreen_linux.go. Merge other files with
  tscreen_linux.go and rename to tscreen_unix.go.
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.

1 participant