Skip to content

Instantly share code, notes, and snippets.

@nocd5
Last active August 29, 2015 14:03
Show Gist options
  • Save nocd5/d37cdb377fc112d0de5f to your computer and use it in GitHub Desktop.
Save nocd5/d37cdb377fc112d0de5f to your computer and use it in GitHub Desktop.
termbox-goが、Windows XPとckw/console2/ConEmuの組み合わせで動作しない不具合修正
diff --git a/syscalls_windows.go b/syscalls_windows.go
index 4c6f941..4de0e5f 100644
--- a/syscalls_windows.go
+++ b/syscalls_windows.go
@@ -58,4 +58,7 @@ const (
generic_read = 0x80000000
generic_write = 0x40000000
console_textmode_buffer = 0x1
+
+ file_share_read = 0x00000001
+ file_share_write = 0x00000002
)
diff --git a/termbox_windows.go b/termbox_windows.go
index d6eef90..891b797 100644
--- a/termbox_windows.go
+++ b/termbox_windows.go
@@ -111,7 +111,7 @@ func set_console_screen_buffer_size(h syscall.Handle, size coord) (err error) {
func create_console_screen_buffer() (h syscall.Handle, err error) {
r0, _, e1 := syscall.Syscall6(proc_create_console_screen_buffer.Addr(),
- 5, uintptr(generic_read|generic_write), 0, 0, console_textmode_buffer, 0, 0)
+ 5, uintptr(generic_read|generic_write), uintptr(file_share_read|file_share_write), 0, console_textmode_buffer, 0, 0)
if int(r0) == 0 {
if e1 != 0 {
err = error(e1)
@nocd5
Copy link
Author

nocd5 commented Jul 5, 2014

参考: ConEmu FAQ

Windows 7では問題なさそう
参考: T's-Neko様のブログ記事

@nocd5
Copy link
Author

nocd5 commented Sep 15, 2014

Windows8.1でも必要っぽい:space_invader:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment