micro-editor/micro · error

Terminal emulator is not supported on this system

Error message

Terminal emulator is not supported on this system

What it means

Returned by NewTermPane (internal/action/termpane.go:64) when the compiled-in constant TermEmuSupported is false — i.e. the same unsupported-platform condition as error [10], re-checked at the constructor as defense in depth. It prevents constructing a TermPane (which wraps a shell.Terminal plus display.TermWindow) in a build that has no pty support.

Source

Thrown at internal/action/termpane.go:64

}

func termMapMouse(k MouseEvent, action string) {
	// TODO: map mouse
	termMapKey(k, action)
}

type TermPane struct {
	*shell.Terminal
	display.Window

	mouseReleased bool
	id            uint64
	tab           *Tab
}

func NewTermPane(x, y, w, h int, t *shell.Terminal, id uint64, tab *Tab) (*TermPane, error) {
	if !TermEmuSupported {
		return nil, errors.New("Terminal emulator is not supported on this system")
	}

	th := new(TermPane)
	th.Terminal = t
	th.id = id
	th.mouseReleased = true
	th.Window = display.NewTermWindow(x, y, w, h, t)
	th.tab = tab
	return th, nil
}

func (t *TermPane) ID() uint64 {
	return t.id
}

func (t *TermPane) SetID(i uint64) {
	t.id = i
}

View on GitHub (pinned to 1c8b82b32e)

Solutions

  1. Gate the call: if !action.TermEmuSupported { skip / show message } before NewTermPane
  2. Ensure your build compiles terminal_supported.go (unix) and never both stub and real implementation — check custom build tags in forks
  3. For users: use WSL or an external terminal instead of the internal pane on Windows

Example fix

// before
tp, err := NewTermPane(x, y, w, h, term, id, tab) // always errs on windows

// after
if !TermEmuSupported {
    return nil, errors.New("Terminal emulator is not supported on this system")
}
tp, err := NewTermPane(x, y, w, h, term, id, tab)
Defensive patterns

Strategy: type-guard

Validate before calling

if !action.TermEmuSupported {
    return nil, errors.New("terminal panes unavailable in this build")
}
tp, err := action.NewTermPane(x, y, w, h, term, id, tab)

Type guard

// Guard before constructing the pane
func newTermPaneSafe(x, y, w, h int, t *shell.Terminal, id uint64, tab *action.Tab) (*action.TermPane, error) {
    if !action.TermEmuSupported {
        return nil, errors.New("Terminal emulator is not supported on this system")
    }
    return action.NewTermPane(x, y, w, h, t, id, tab)
}

Try / catch

tp, err := NewTermPane(v.X, v.Y, v.Width, v.Height, t, id, MainTab())
if err != nil {
    if strings.Contains(err.Error(), "not supported on this system") {
        // build lacks pty support: present the external-shell fallback once
        InfoBar.Error(err)
        return nil
    }
    return err
}

Prevention

When it happens

Trigger: Calling action.NewTermPane(...) directly (as command.go:1161 and terminal_supported.go:37 do) in a windows/plan9 build, or a fork/vendor that compiles termpane.go without terminal_supported.go so the constant stays false.

Common situations: Plugin code constructing terminal panes manually; maintainers porting micro to a new OS where the build tags were not updated and the unsupported stub still links.

Related errors


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