{"record":{"id":"f8c107e0a9547885","repo":"micro-editor/micro","slug":"unsupported-operating-system","errorCode":null,"errorMessage":"Unsupported operating system","messagePattern":"Unsupported operating system","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/action/terminal_unsupported.go","lineNumber":12,"sourceCode":"//go:build plan9 || nacl || windows\n\npackage action\n\nimport \"errors\"\n\n// TermEmuSupported is a constant that marks if the terminal emulator is supported\nconst TermEmuSupported = false\n\n// RunTermEmulator returns an error for unsupported systems (non-unix systems\nfunc RunTermEmulator(input string, wait bool, getOutput bool, callback func(out string, userargs []any), userargs []any) error {\n\treturn errors.New(\"Unsupported operating system\")\n}\n","sourceCodeStart":1,"sourceCodeEnd":14,"githubUrl":"https://github.com/micro-editor/micro/blob/1c8b82b32e408a5faf340039ed92d5266bea3293/internal/action/terminal_unsupported.go#L1-L14","documentation":"Constant-shaped error returned by RunTermEmulator in internal/action/terminal_unsupported.go, a file only compiled for plan9, nacl or windows (//go:build tag). The integrated terminal emulator requires a unix pty layer, so on these platforms the stub unconditionally returns this error for any attempt to run a terminal command. It is a build-time capability gate, not a runtime failure.","triggerScenarios":"On Windows (or plan9), executing > term, running the 'term' command from a plugin/lua (RunTermEmulator is documented in runtime/help/plugins.md), or any code path that shells out through micro's built-in terminal pane.","commonSituations":"Cross-platform Lua plugins that call the term emulator without checking action.TermEmuSupported; users switching from Linux and expecting the same > term workflow; CI running micro on windows containers.","solutions":["Before calling, branch on the exported constant action.TermEmuSupported (false exactly on these platforms) and skip or substitute","On Windows, use the regular shell integration instead: ':shell'-style external shells or run commands via the sucmd/os layer rather than the internal emulator","Run micro under WSL if the embedded terminal is a hard requirement"],"exampleFix":"// before\naction.RunTermEmulator(\"ls -la\", false, false, nil, nil) // panics UX on windows\n\n// after\nif !action.TermEmuSupported {\n    // fall back to non-interactive command execution\n    return errors.New(\"terminal emulator unavailable\")\n}\naction.RunTermEmulator(\"ls -la\", false, false, nil, nil)","handlingStrategy":"type-guard","validationCode":"// Capability check exported by the package\nif !action.TermEmuSupported {\n    return errors.New(\"terminal emulator not available on this platform\")\n}\nerr := action.RunTermEmulator(cmd, false, false, cb, nil)","typeGuard":"// Platform capability guard (constant is false on windows/plan9 builds)\nfunc canRunTermEmulator() bool {\n    return action.TermEmuSupported\n}\n// Use it to narrow behavior:\nif canRunTermEmulator() { runEmbedded() } else { runExternalShell() }","tryCatchPattern":"err := action.RunTermEmulator(input, wait, getOut, cb, args)\nif err != nil {\n    if err.Error() == \"Unsupported operating system\" {\n        // permanent for this build: disable the feature, don't retry\n        disableTermFeature()\n        return nil\n    }\n    return err\n}","preventionTips":["Always branch on TermEmuSupported before any term-emulator code path","Feature-detect once at plugin init and cache the result","Remember this is compile-time determined: no runtime update fixes it, only a different platform"],"tags":["terminal","platform","windows","build-tags","unsupported"],"backgroundTag":null,"analyzedSha":"1c8b82b32e408a5faf340039ed92d5266bea3293","analyzedAt":"2026-08-15T20:01:45.134Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}