Files
vmux/workspace.go
Pierre Martin c9a28df3dc test(02-02): add failing tests for PPID chain walk + workspace resolution
- TestReadPPID, TestReadPPIDMissing
- TestResolveWorkspace, TestResolveWorkspaceNotFound, TestResolveWorkspaceMaxDepth
- TestBuildTerminalWorkspaceMapUnit
- Add go.i3wm.org/i3/v4 dependency
2026-03-23 17:42:44 +01:00

33 lines
948 B
Go

package main
import (
i3 "go.i3wm.org/i3/v4"
)
// X11PIDResolver abstrait la lecture de _NET_WM_PID pour testabilite.
type X11PIDResolver interface {
GetPID(windowID int64) (int, error)
}
// I3TreeProvider abstrait i3.GetTree() pour testabilite.
type I3TreeProvider interface {
GetTree() (i3.Tree, error)
}
// ReadPPID lit le PPid depuis /proc/PID/status. procDir injectable pour les tests.
func ReadPPID(procDir string, pid int) (int, error) {
return 0, nil
}
// ResolveWorkspace remonte la chaine PPID depuis claudePID jusqu'a trouver
// un PID connu dans terminalWorkspaces. Max 20 niveaux.
func ResolveWorkspace(procDir string, claudePID int, terminalWorkspaces map[int]string) string {
return ""
}
// BuildTerminalWorkspaceMap construit la map terminalPID -> workspaceName.
// Utilise i3 GetTree + X11 _NET_WM_PID.
func BuildTerminalWorkspaceMap(tree I3TreeProvider, x11 X11PIDResolver) (map[int]string, error) {
return nil, nil
}