{"record":{"id":"d4a6ad28d1077576","repo":"micro-editor/micro","slug":"no-clipboard-received-from-terminal","errorCode":null,"errorMessage":"No clipboard received from terminal","messagePattern":"No clipboard received from terminal","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"internal/clipboard/terminal.go","lineNumber":26,"sourceCode":"\t\"github.com/micro-editor/tcell/v2\"\n)\n\ntype terminalClipboard struct{}\n\nvar terminal terminalClipboard\n\nfunc (t terminalClipboard) read(reg string) (string, error) {\n\tscreen.Screen.GetClipboard(reg)\n\t// wait at most 200ms for response\n\tfor {\n\t\tselect {\n\t\tcase event := <-screen.Events:\n\t\t\te, ok := event.(*tcell.EventPaste)\n\t\t\tif ok {\n\t\t\t\treturn e.Text(), nil\n\t\t\t}\n\t\tcase <-time.After(200 * time.Millisecond):\n\t\t\treturn \"\", errors.New(\"No clipboard received from terminal\")\n\t\t}\n\t}\n}\n\nfunc (t terminalClipboard) write(text, reg string) error {\n\treturn screen.Screen.SetClipboard(text, reg)\n}\n","sourceCodeStart":8,"sourceCodeEnd":34,"githubUrl":"https://github.com/micro-editor/micro/blob/1c8b82b32e408a5faf340039ed92d5266bea3293/internal/clipboard/terminal.go#L8-L34","documentation":"Returned by the terminal (OSC 52) clipboard backend when micro sends a clipboard read request to the terminal and receives no tcell EventPaste within a hard-coded 200ms window. It means the terminal did not answer the escape-sequence clipboard query — most terminals either do not implement OSC 52 reads or deliberately disable them for security.","triggerScenarios":"Setting \"clipboard\": \"terminal\" and then invoking paste/copy, in a terminal without OSC 52 clipboard-query support (many VTE-based terminals, terminals with clipboard reads disabled), or inside tmux/screen without the clipboard passthrough option enabled. The loop in internal/clipboard/terminal.go:26 waits on screen.Events and gives up at time.After(200ms).","commonSituations":"SSH sessions where the user expects clipboard forwarding via OSC 52, tmux users missing `set -g set-clipboard on`, or users switching from external tools (xclip/pbcopy) to the terminal method on a host whose terminal emulator rejects read queries.","solutions":["Switch method: `set clipboard external` (needs xclip/xsel/wl-clipboard/pbcopy present) or `set clipboard internal` (micro-local register only).","If you want OSC 52 to work: use a terminal that supports clipboard queries (e.g. recent kitty/alacritty/wezterm) and inside tmux enable `set -g set-clipboard on` plus `set -as terminal-overrides ',*:Ms=...OSC52...'`.","Increase tolerance: note the 200ms is hard-coded; on slow SSH links even capable terminals can miss the window, so prefer external over slow links.","Verify support first: run `micro`, set clipboard=terminal, and attempt a paste; if the error appears, your terminal does not answer queries."],"exampleFix":"# before (~/.config/micro/settings.json):\n{ \"clipboard\": \"terminal\" }\n# paste -> 'No clipboard received from terminal' after 200ms\n\n# after:\n{ \"clipboard\": \"external\" }  # and install xclip / wl-clipboard","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"text, err := clipboard.Read(clipboard.ClipboardReg)\nif err != nil {\n    if strings.Contains(err.Error(), \"No clipboard received from terminal\") {\n        clipboard.SetMethod(\"external\") // or \"internal\"\n        text, err = clipboard.Read(clipboard.ClipboardReg)\n    }\n}","preventionTips":["Prefer clipboard method \"external\" (with xclip/wl-clipboard/pbcopy installed) unless you specifically need OSC 52.","Over SSH or in tmux, verify OSC 52 support once before relying on it, and enable tmux set-clipboard.","Treat the 200ms terminal response window as best-effort; never make terminal clipboard reads the only path for critical data."],"tags":["clipboard","osc52","terminal","timeout","ssh"],"backgroundTag":null,"analyzedSha":"1c8b82b32e408a5faf340039ed92d5266bea3293","analyzedAt":"2026-08-15T20:01:45.134Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}