Skip to content

Commit 959f2e2

Browse files
committed
Windows版ビルドエラー対応
1 parent 5b32887 commit 959f2e2

File tree

2 files changed

+25
-4
lines changed

2 files changed

+25
-4
lines changed

pty_router_windows.go

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,33 @@
11
//go:build windows
2+
// +build windows
23

34
package main
45

6+
import "log"
7+
8+
// PTY is not supported on Windows.
9+
// These are stub functions to allow compilation.
10+
11+
// GetPTYPaths returns empty slice on Windows (PTY not supported)
12+
func GetPTYPaths() []string {
13+
return []string{}
14+
}
15+
516
// GetPTYPath returns empty string on Windows (PTY not supported)
617
func GetPTYPath() string {
718
return ""
819
}
920

10-
// startRigWatcherWithPTY is not supported on Windows
21+
// startRigWatcherWithPTY is not supported on Windows.
22+
// Logs a warning and does nothing (caller should fall back to non-PTY mode).
1123
func startRigWatcherWithPTY() {
12-
// PTY is not available on Windows
24+
log.Println("[RIG-PTY] PTY mode is not supported on Windows, ignoring UsePTY setting")
25+
// Do not call startRigWatcher() here to avoid infinite loop.
26+
// The rig watcher will not start in PTY mode on Windows.
27+
// User should disable UsePTY in settings on Windows.
28+
}
29+
30+
// broadcastPTYPaths is a no-op on Windows
31+
func broadcastPTYPaths() {
32+
// PTY not supported on Windows
1333
}

rig.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"encoding/binary"
66
"encoding/json"
77
"log"
8+
"runtime"
89
"strings"
910
"sync"
1011
"time"
@@ -79,8 +80,8 @@ func startRigWatcher() {
7980
selectedIndex := config.SelectedRigIndex
8081
configLock.RUnlock()
8182

82-
// PTYモードの場合は別関数へ
83-
if usePTY {
83+
// PTYモードの場合は別関数へ(macOS/Linuxのみ)
84+
if usePTY && (runtime.GOOS == "darwin" || runtime.GOOS == "linux") {
8485
startRigWatcherWithPTY()
8586
return
8687
}

0 commit comments

Comments
 (0)