micro-editor/micro · error

Unsupported operating system

Error message

Unsupported operating system

What it means

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.

Solutions

  1. Before calling, branch on the exported constant action.TermEmuSupported (false exactly on these platforms) and skip or substitute
  2. 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
  3. Run micro under WSL if the embedded terminal is a hard requirement

Example fix

// before
action.RunTermEmulator("ls -la", false, false, nil, nil) // panics UX on windows

// after
if !action.TermEmuSupported {
    // fall back to non-interactive command execution
    return errors.New("terminal emulator unavailable")
}
action.RunTermEmulator("ls -la", false, false, nil, nil)
Defensive patterns

Strategy: type-guard

Validate before calling

// Capability check exported by the package
if !action.TermEmuSupported {
    return errors.New("terminal emulator not available on this platform")
}
err := action.RunTermEmulator(cmd, false, false, cb, nil)

Type guard

// Platform capability guard (constant is false on windows/plan9 builds)
func canRunTermEmulator() bool {
    return action.TermEmuSupported
}
// Use it to narrow behavior:
if canRunTermEmulator() { runEmbedded() } else { runExternalShell() }

Try / catch

err := action.RunTermEmulator(input, wait, getOut, cb, args)
if err != nil {
    if err.Error() == "Unsupported operating system" {
        // permanent for this build: disable the feature, don't retry
        disableTermFeature()
        return nil
    }
    return err
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of micro-editor/micro@1c8b82b32e (2026-08-15). Data as JSON: /api/errors/f8c107e0a9547885. Report an issue: GitHub.

Appendix: source

Thrown at internal/action/terminal_unsupported.go:12

//go:build plan9 || nacl || windows

package action

import "errors"

// TermEmuSupported is a constant that marks if the terminal emulator is supported
const TermEmuSupported = false

// RunTermEmulator returns an error for unsupported systems (non-unix systems
func RunTermEmulator(input string, wait bool, getOutput bool, callback func(out string, userargs []any), userargs []any) error {
	return errors.New("Unsupported operating system")
}

View on GitHub (pinned to 1c8b82b32e)